Commit c3677818 authored by Julien Fastré's avatar Julien Fastré

fix bug in listing users in form filtering tasks

parent e25621ef
Branch master
=============
- fix bug in filter task form: allow to show the list of users, which was hidden when the user had access to multiple centers;
......@@ -237,10 +237,11 @@ class SingleTaskListType extends AbstractType
}
$i = 0;
$circleCenterCond = $qb->expr()->orX();
foreach ($centers as $center) {
$circles = $this->authorizationHelper->getReachableCircles($user, $role, $center);
// add condition about person and circle
$qb->andWhere(
$circleCenterCond->add(
$qb->expr()->andX()
->add($qb->expr()->eq('person.center', ':center_'.$i))
->add($qb->expr()->in('task.circle', ':circles_'.$i))
......@@ -252,6 +253,7 @@ class SingleTaskListType extends AbstractType
// increase counter
$i++;
}
$qb->andWhere($circleCenterCond);
return $qb->getQuery()->getResult();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment