+1I've had a go at modifying the code:I'm using osticket 1.9.4in "include/class.ticket.php" file:changed the sql query on line 1081 added "isoverdue=0", e.g.function onResponse() {db_query('UPDATE '.TICKET_TABLE.' SET isanswered=1, lastresponse=NOW(), updated=NOW(), isoverdue=0 WHERE ticket_id='.db_input($this->getId()));$this->reload();}and changed the sql query on line 2868, added ".' AND (T1.lastmessage > T1.lastresponse) ' ", e.g.function checkOverdue() { $sql='SELECT ticket_id FROM '.TICKET_TABLE.' T1 ' .' INNER JOIN '.TICKET_STATUS_TABLE.' status ON (status.id=T1.status_id AND status.state="open") ' .' LEFT JOIN '.SLA_TABLE.' T2 ON (T1.sla_id=T2.id AND T2.isactive=1) ' .' WHERE isoverdue=0 ' .' AND ((reopened is NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),T1.created))>=T2.grace_period*3600) ' .' OR (reopened is NOT NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),reopened))>=T2.grace_period*3600) ' .' OR (duedate is NOT NULL AND duedate<NOW()) ' .' AND (T1.lastmessage > T1.lastresponse) ' //*** added this *** .' ) ORDER BY T1.created LIMIT 50'; if(($res=db_query($sql)) && db_num_rows($res)) { while(list($id)=db_fetch_row($res)) { if(($ticket=Ticket:($id)) && $ticket->markOverdue()) $ticket->logActivity(_S('Ticket Marked Overdue'), _S('Ticket flagged as overdue by the system.')); } } }
My intention was to remove "isoverdue" from any ticket that has been replied to. And only if the ticket has been replied to will it become overdue.
I've havent done comprehensive testing of this modification, so do it at your own risk. And let me know if you have any problems.