diff --git a/include/class.dept.php b/include/class.dept.php index 2392dc205bd72b630299a568deb9cddf0bff8655..8adccb24730bf71b5948d98ee5dfe133ea878565 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -64,8 +64,9 @@ implements TemplateVariable { const ALERTS_DEPT_AND_EXTENDED = 1; const ALERTS_DEPT_ONLY = 0; - const FLAG_ASSIGN_MEMBERS_ONLY = 0x0001; - const FLAG_DISABLE_AUTO_CLAIM = 0x0002; + const FLAG_ASSIGN_MEMBERS_ONLY = 0x0001; + const FLAG_DISABLE_AUTO_CLAIM = 0x0002; + const FLAG_DISABLE_REOPEN_AUTO_ASSIGN = 0x0020; function asVar() { return $this->getName(); @@ -349,6 +350,10 @@ implements TemplateVariable { return $this->flags & self::FLAG_DISABLE_AUTO_CLAIM; } + function disableReopenAutoAssign() { + return $this->flags & self::FLAG_DISABLE_REOPEN_AUTO_ASSIGN; + } + function isGroupMembershipEnabled() { return $this->group_membership; } @@ -361,6 +366,7 @@ implements TemplateVariable { $ht['assign_members_only'] = $this->assignMembersOnly(); $ht['disable_auto_claim'] = $this->disableAutoClaim(); + $ht['disable_reopen_auto_assign'] = $this->disableReopenAutoAssign(); return $ht; } @@ -663,6 +669,7 @@ implements TemplateVariable { $this->flags = 0; $this->setFlag(self::FLAG_ASSIGN_MEMBERS_ONLY, isset($vars['assign_members_only'])); $this->setFlag(self::FLAG_DISABLE_AUTO_CLAIM, isset($vars['disable_auto_claim'])); + $this->setFlag(self::FLAG_DISABLE_REOPEN_AUTO_ASSIGN, isset($vars['disable_reopen_auto_assign'])); $this->path = $this->getFullPath(); diff --git a/include/class.ticket.php b/include/class.ticket.php index 47b1713c56729266597b7fd5fd94a8e6c3ef789b..814611955fd1109eb31b6bc3dfa8cb9a446ccf37 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1554,8 +1554,8 @@ implements RestrictedAccess, Threadable { // to unassigned pool. $dept = $this->getDept(); $staff = $this->getStaff() ?: $this->getLastRespondent(); - $autoclaim = ($cfg->autoClaimTickets() && !$dept->disableAutoClaim()); - if ($autoclaim + $autoassign = (!$dept->disableReopenAutoAssign()); + if ($autoassign && $staff // Is agent on vacation ? && $staff->isAvailable() diff --git a/include/i18n/en_US/help/tips/settings.ticket.yaml b/include/i18n/en_US/help/tips/settings.ticket.yaml index b13bd17c4f3bc9b2739ddb52f02c69c2d3ca497a..34c6e01b3921248e60472958754905eb3c25e43a 100644 --- a/include/i18n/en_US/help/tips/settings.ticket.yaml +++ b/include/i18n/en_US/help/tips/settings.ticket.yaml @@ -92,7 +92,8 @@ claim_tickets: content: > Enable this to auto-assign unassigned tickets to the responding Agent. <br><br> - Reopened tickets are always assigned to the last respondent. + Reopened tickets are always assigned to the last respondent unless auto + assign on reopen is disabled on the Department level. assigned_tickets: title: Assigned Tickets @@ -115,4 +116,3 @@ ticket_attachment_settings: class="doc-desc-title">issue details</span> field. These settings are used for all new tickets and new messages regardless of the source channel (web portal, email, api, etc.). - diff --git a/include/i18n/en_US/help/tips/staff.department.yaml b/include/i18n/en_US/help/tips/staff.department.yaml index 015c9b1224c3a6a8647e633e3dcb14dd3e2b6f82..d943530d968328af766e1695abe700222b4ec73e 100644 --- a/include/i18n/en_US/help/tips/staff.department.yaml +++ b/include/i18n/en_US/help/tips/staff.department.yaml @@ -85,6 +85,14 @@ disable_auto_claim: <br><br> Agents can still manually claim unassigned tickets +disable_reopen_auto_assign: + title: Disable Auto Assign on Reopen + content: > + Check this to <strong>disable</strong> auto-assignment of reopened tickets for + this department. + <br><br> + Otherwise, the Ticket will be auto assigned to the last responding Agent + auto_response_settings: title: Autoresponder Settings content: > diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php index 85b077388ac726543fe0f2a0512921b533c99b2d..30095d0d014e126f63c9ddc065b7e568408ce91e 100644 --- a/include/staff/department.inc.php +++ b/include/staff/department.inc.php @@ -167,6 +167,21 @@ $info = Format::htmlchars(($errors && $_POST) ? $_POST : $info); </td> </tr> + <tr> + <td><?php echo __('Reopen Auto Assignment'); ?>:</td> + <td> + <label> + <input type="checkbox" name="disable_reopen_auto_assign" <?php echo + $info['disable_reopen_auto_assign'] ? 'checked="checked"' : ''; ?>> + <?php echo sprintf('<strong>%s</strong> %s', + __('Disable'), + __('auto assign on reopen')); ?> + </label> + <i class="help-tip icon-question-sign" + href="#disable_reopen_auto_assign"></i> + </td> + </tr> + <tr> <th colspan="2"> <em><strong><?php echo __('Outgoing Email Settings'); ?></strong>:</em>