Skip to content
Snippets Groups Projects
Commit a2954699 authored by Peter Rotich's avatar Peter Rotich
Browse files

Remove SLA when overdue flag is cleared AND est. duedate is in the past. Only...

Remove SLA when overdue flag is cleared AND est. duedate is in the past. Only managers can manually clear overdue tickets.
parent eba99c39
Branches
Tags
No related merge requests found
......@@ -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());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment