Hey guys, having a little trouble with this mod:
Essentially, when a ticket goes overdue, in addition to marking it overdue, I'm trying to make the system assign it to a certain dept manager. (Currently, said dept manager's UID is hardcoded, since the logical approach didn't work)
So far, my current solution involves taking this section of the checkOverdue() function in ./include/class.ticket.php:
if(($stale=db_query($sql)) && db_num_rows($stale)){
while(list($id)=db_fetch_row($stale)){
$ticket = new Ticket($id);
if($ticket->markOverdue(true)){
$ticket->logActivity('Ticket Marked Overdue','Ticket flagged as overdue by the system.');
}
}
}
And modifying it thus:
if(($stale=db_query($sql)) && db_num_rows($stale)){
while(list($id)=db_fetch_row($stale)){
$ticket = new Ticket($id);
if(!$ticket->isAssigned() && $ticket->markOverdue(true) && $ticket->isOpen())
{
$ticket->assignStaff(21,"Overdue and orphaned. Reported to manager by system");
$ticket->logActivity('Ticket Marked Overdue','Ticket flagged as overdue and escalated by the system.');
}else
if($ticket->markOverdue(true)){
$ticket->logActivity('Ticket Marked Overdue','Ticket flagged as overdue by the system.');
}
}
}
What's happening (as you can probably figure out) is that it works perfectly. Except that the first person who's session calls class.ticket.php is the person who's name is on the reassignment, rather than "System". I can't think of an elegant solution to this. Any pointers?
Cheers,
Rincewind.