Skip to content
Snippets Groups Projects
Commit 90cc65ae authored by JediKev's avatar JediKev
Browse files

issue: Task Term Search

This addresses an issue where searching for a Task by title returns all
Tasks in the search. This is due to the visibility filtering methods used to
filter tickets by staff's visibility.
parent 1fdd6783
No related branches found
No related tags found
No related merge requests found
......@@ -127,19 +127,19 @@ if ($filters)
// Impose visibility constraints
// ------------------------------------------------------------
// -- Open and assigned to me
$visibility = array(
$visibility = Q::any(
new Q(array('flags__hasbit' => TaskModel::ISOPEN, 'staff_id' => $thisstaff->getId()))
);
// -- Routed to a department of mine
if (!$thisstaff->showAssignedOnly() && ($depts=$thisstaff->getDepts()))
$visibility[] = new Q(array('dept_id__in' => $depts));
$visibility->add(new Q(array('dept_id__in' => $depts)));
// -- Open and assigned to a team of mine
if (($teams = $thisstaff->getTeams()) && count(array_filter($teams)))
$visibility[] = new Q(array(
$visibility->add(new Q(array(
'team_id__in' => array_filter($teams),
'flags__hasbit' => TaskModel::ISOPEN
));
$tasks->filter(Q::any($visibility));
)));
$tasks->filter(new Q($visibility));
// Add in annotations
$tasks->annotate(array(
......
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