Skip to content
Permalink
Browse files

Queues: Agents with no team assignment

Commit d8b61e8 correctly addressed an issue with criteria for team assignment
when an agent doesn't belong to a single team, BUT failed to consider cases
that the criteria is part of a set of constraints. e.g Tickets assigned to
Me OR one of my Teams.

This commit adds a check to skip team check when multiple constraints are
included.
  • Loading branch information...
protich committed Nov 15, 2019
1 parent fe140f4 commit a00cee9cd042fa6c392ac107de7fbaf18fae8cc0
Showing with 4 additions and 3 deletions.
  1. +4 −3 include/class.search.php
@@ -1291,6 +1291,7 @@ function getSearchQ($method, $value, $name=false) {
$Q->negate();
case 'includes':
$teams = $agents = array();
$matches = count($value);
foreach ($value as $id => $ST) {
switch ($id[0]) {
case 'M':
@@ -1300,10 +1301,10 @@ function getSearchQ($method, $value, $name=false) {
$agents[] = (int) substr($id, 1);
break;
case 'T':
if (!$thisstaff || !($staffTeams = $thisstaff->getTeams()))
if ($thisstaff && ($staffTeams = $thisstaff->getTeams()))
$teams = array_merge($staffTeams);
elseif ($matches == 1)
return Q::any(['team_id' => null]);
$teams = array_merge($staffTeams);
break;
case 't':
$teams[] = (int) substr($id, 1);

0 comments on commit a00cee9

Please sign in to comment.
You can’t perform that action at this time.