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

Decide if we need to keep the just selected SLA on ticket edit

parent 78841f4c
Branches
Tags
No related merge requests found
...@@ -1962,13 +1962,19 @@ class Ticket { ...@@ -1962,13 +1962,19 @@ class Ticket {
$vars['note']=sprintf('Ticket Updated by %s', $thisstaff->getName()); $vars['note']=sprintf('Ticket Updated by %s', $thisstaff->getName());
$this->logNote('Ticket Updated', $vars['note'], $thisstaff); $this->logNote('Ticket Updated', $vars['note'], $thisstaff);
// Decide if we need to keep the just selected SLA
$keepSLA = ($this->getSLAId() != $vars['slaId']);
// Reload the ticket so we can do further checking
$this->reload(); $this->reload();
// Reselect SLA if transient // Reselect SLA if transient
if(!$this->getSLAId() || $this->getSLA()->isTransient()) if (!$keepSLA
&& (!$this->getSLA() || $this->getSLA()->isTransient()))
$this->selectSLAId(); $this->selectSLAId();
//Clear overdue flag if duedate or SLA changes and the ticket is no longer overdue. // Clear overdue flag if duedate or SLA changes and the ticket is no longer overdue.
if($this->isOverdue() if($this->isOverdue()
&& (!$this->getEstDueDate() //Duedate + SLA cleared && (!$this->getEstDueDate() //Duedate + SLA cleared
|| Misc::db2gmtime($this->getEstDueDate()) > Misc::gmtime() //New due date in the future. || Misc::db2gmtime($this->getEstDueDate()) > Misc::gmtime() //New due date in the future.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment