Skip to content
Snippets Groups Projects
Commit 5df35707 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #663 from protich/issue/sla-autoselect


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

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 68d4fe99 3554fcb1
No related branches found
No related tags found
No related merge requests found
......@@ -1962,13 +1962,19 @@ class Ticket {
$vars['note']=sprintf('Ticket Updated by %s', $thisstaff->getName());
$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();
// Reselect SLA if transient
if(!$this->getSLAId() || $this->getSLA()->isTransient())
if (!$keepSLA
&& (!$this->getSLA() || $this->getSLA()->isTransient()))
$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()
&& (!$this->getEstDueDate() //Duedate + SLA cleared
|| 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.
Finish editing this message first!
Please register or to comment