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

bug: Check account manage auto-assign flag

Auto assign tickets to organization's account manager only if the flag is set and as
the last resort i.e topic or filters assignment takes precedence.
parent bb62d566
Branches
Tags
No related merge requests found
......@@ -71,6 +71,10 @@ class OrganizationModel extends VerySimpleModel {
return $this->check(self::COLLAB_ALL_MEMBERS);
}
function autoAssignAccountManager() {
return $this->check(self::ASSIGN_AGENT_MANAGER);
}
function getUpdateDate() {
return $this->updated;
}
......
......@@ -2411,15 +2411,6 @@ class Ticket {
$source = 'Email';
}
// Auto assignment to organization account manager
if (($org = $user->getOrganization())
&& ($code = $org->getAccountManagerId())) {
if (!isset($vars['staffId']) && $code[0] == 's')
$vars['staffId'] = substr($code, 1);
elseif (!isset($vars['teamId']) && $code[0] == 't')
$vars['teamId'] = substr($code, 1);
}
if (!isset($topic)) {
// This may return NULL, no big deal
$topic = $cfg->getDefaultTopic();
......@@ -2448,6 +2439,16 @@ class Ticket {
$vars['slaId'] = $topic->getSLAId();
}
// Auto assignment to organization account manager
if (($org = $user->getOrganization())
&& $org->autoAssignAccountManager()
&& ($code = $org->getAccountManagerId())) {
if (!isset($vars['staffId']) && $code[0] == 's')
$vars['staffId'] = substr($code, 1);
elseif (!isset($vars['teamId']) && $code[0] == 't')
$vars['teamId'] = substr($code, 1);
}
// Last minute checks
$priority = $form->getAnswer('priority');
if (!$priority || !$priority->getIdValue())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment