Skip to content
Snippets Groups Projects
Unverified Commit 0778e3b7 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4453 from JediKev/issue/task-term-search

issue: Task Term Search
parents e6cbc318 90cc65ae
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