getId()) die($txt['general']['invalidPath']);
//Make sure the staff is allowed to access the page.
if(!@$thisstaff->isStaff() || !$ticket->checkStaffAccess($thisstaff)) die($txt['general']['accessDenied']);
//Re-use the post info on error...savekeyboards.org (Why keyboard? -> some people care about objects than users!!)
$info=($_POST && $errors)?Format::input($_POST):array();
//Auto-lock the ticket if locking is enabled.. If already locked by the user then it simply renews.
if($cfg->getLockTime() && !$ticket->acquireLock($thisstaff->getId(),$cfg->getLockTime()))
$warn.=$txt['staff']['ticket_view_inc'][0];
//Get the goodies.
$dept = $ticket->getDept(); //Dept
$staff = $ticket->getStaff(); //Assigned or closed by..
$team = $ticket->getTeam(); //Assigned team.
$sla = $ticket->getSLA();
$lock = $ticket->getLock(); //Ticket lock obj
$id = $ticket->getId(); //Ticket ID.
//Useful warnings and errors the user might want to know!
if($ticket->isAssigned() && (
($staff && $staff->getId()!=$thisstaff->getId())
|| ($team && !$team->hasMember($thisstaff))
))
$warn.=' '.sprintf($txt['staff']['ticket_view_inc'][1], implode('/', $ticket->getAssignees())).'';
if(!$errors['err'] && ($lock && $lock->getStaffId()!=$thisstaff->getId()))
$errors['err']=sprintf($txt['staff']['ticket_view_inc'][2], $lock->getStaffName());
if(!$errors['err'] && ($emailBanned=TicketFilter::isBanned($ticket->getEmail())))
$errors['err']=$txt['staff']['ticket_view_inc'][3];
$unbannable=($emailBanned) ? BanList::includes($ticket->getEmail()) : false;
if($ticket->isOverdue())
$warn.=' '.$txt['staff']['ticket_view_inc'][4].'';
?>
getId()) as $form) {
// Skip core fields shown earlier in the ticket view
// TODO: Rewrite getAnswers() so that one could write
// ->getAnswers()->filter(not(array('field__name__in'=>
// array('email', ...))));
$answers = array_filter($form->getAnswers(), function ($a) {
return !in_array($a->getField()->get('name'),
array('email','subject','name','priority'));
});
if (count($answers) == 0)
continue;
?>