diff --git a/include/class.ticket.php b/include/class.ticket.php index 94733adc14eb52fe26847297fb1d294a94bb7f72..17d2c56b3545733d3569261eacb1d8bd79328070 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1097,11 +1097,18 @@ class Ticket { if(!$this->isOverdue()) return true; + //NOTE: Previously logged overdue event is NOT annuled. + $sql='UPDATE '.TICKET_TABLE.' SET isoverdue=0, updated=NOW() '; + //clear due date if it's in the past if($this->getDueDate() && strtotime($this->getDueDate())<=time()) $sql.=', duedate=NULL'; + //Clear SLA if est. due date is in the past + if($this->getSLADueDate() && strtotime($this->getSLADueDate())<=time()) + $sql.=', sla_id=0 '; + $sql.=' WHERE ticket_id='.db_input($this->getId()); return (db_query($sql) && db_affected_rows());