From 79489b3de092873ae90e6d1d4eb4d39649441a83 Mon Sep 17 00:00:00 2001 From: JediKev <kevin@enhancesoft.com> Date: Wed, 18 Oct 2017 08:53:52 -0500 Subject: [PATCH] issue: Help Topic SLA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This addresses issue 3979 where the system uses the default SLA plan if you don’t choose one in the creation process, even though the selected Help Topic has one explicitly set. This is due to the method that checks for an SLA plan selection upon ticket creation. The method uses `isset()` to determine whether or not the agent selected a help topic. If you don’t select an SLA plan the `slaId` will return `0` which, even though equals nothing, is still set. If the `slaId` is set then it will use that SLA plan or the default one. Since `0` is not an SLA plan, it will use the default SLA. So this adds a check beforehand to see if `slaId` is `0`. If so it will unset `slaId` and use either the Help Topic SLA or the default SLA. --- include/class.ticket.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/class.ticket.php b/include/class.ticket.php index 7cc661f95..a5b41c6c7 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -3321,6 +3321,10 @@ implements RestrictedAccess, Threadable { elseif (!isset($vars['teamId']) && $topic->getTeamId()) $vars['teamId'] = $topic->getTeamId(); + // Unset slaId if 0 to use the Help Topic SLA or Default SLA + if ($vars['slaId'] == 0) + unset($vars['slaId']); + //set default sla. if (isset($vars['slaId'])) $vars['slaId'] = $vars['slaId'] ?: $cfg->getDefaultSLAId(); -- GitLab