web/website/integrations/osticket/install-ticket-status-ui.py
unimatrixgit 77cdf19faa Checkpoint Alpha 1.0.0.3 graphical menus and moderation evidence
Preserve the current Alpha source and artwork snapshot. See handoff/alpha-1.0.0.3 for actual deployed hashes, checks, staged follow-ups and the production pause. This checkpoint does not claim every source feature is deployed.
2026-11-02 00:05:34 +01:00

18 lines
1.1 KiB
Python

#!/usr/bin/python3
"""Place native permission-checked appeal controls beneath each ticket status.
Only changes presentation hooks, not osTicket's submit, CSRF or permission code.
"""
import sys
from pathlib import Path
root=Path(sys.argv[1]).resolve()
path=root/'include/staff/ticket-view.inc.php'
source=path.read_text()
if 'dune-status-appeal-row' not in source:
source=source.replace("<?php require_once dirname(__DIR__,2).'/appeal-actions.php'; dune_appeal_controls($ticket,$thisstaff); ?>", "<?php require_once dirname(__DIR__,2).'/appeal-actions.php'; ?>")
source=source.replace('<?php dune_appeal_controls($ticket,$thisstaff); ?>\n','')
for name in ['reply_status_id','note_status_id']:
start=source.index('<select name="'+name+'">')
end=source.index('</tr>',source.index('</select>',start))+5
source=source[:end]+'\n<tr class="dune-status-appeal-row"><td colspan="2"><?php dune_appeal_controls($ticket,$thisstaff); ?></td></tr>'+source[end:]
path.write_text(source)
print('Appeal controls placed below Reply and Internal Note Ticket Status')