improve filter form

- hide form in some places ;
- i18n
- hide status filtering with a parameter (redundant)
This commit is contained in:
2018-05-08 22:56:45 +02:00
parent 650f2c8e18
commit 69eb9648c9
8 changed files with 103 additions and 32 deletions

View File

@@ -107,6 +107,15 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
$qb->andWhere($qb->expr()->eq('st.person', ':person'));
$qb->setParameter('person', $params['person']);
}
if (\array_key_exists('unassigned', $params) and $params['unassigned'] === true) {
if (\array_key_exists('user', $params) and !empty($params['user'])) {
throw new \UnexpectedValueException("You should not require for "
. "unassigned tasks and tasks assigned to some user.");
}
$qb->andWhere($qb->expr()->isNull('st.assignee'));
}
if (\array_key_exists('user', $params) and !empty($params['user'])) {
$qb->andWhere($qb->expr()->eq('st.assignee', ':user'));