import {readFileSync,writeFileSync} from 'node:fs'; const root=process.argv[2];if(!root)throw Error('Provide the native osTicket root'); const path=root+'/include/staff/ticket-view.inc.php';let html=readFileSync(path,'utf8'); const start=" \n "; if(!html.includes('Assigned staff')){const a=html.indexOf(start),b=html.indexOf(end,a);if(a<0||b'Assigned team','agents'=>'Assigned staff'] as $kind=>$label): $assignee=$kind==='teams'?$ticket->getTeam():$ticket->getStaff(); ?>\n :\n hasPerm(Ticket::PERM_ASSIGN)): ?>getId(); ?>/assign/\">\n getName()):'Unassigned'; ?>\n hasPerm(Ticket::PERM_ASSIGN)): ?>\n \n"+html.slice(b);writeFileSync(path,html);}