From 8527c1907313f91d0d76a4adde1de369078518ad Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 31 Oct 2022 11:18:29 +0100 Subject: [PATCH] acp HasNoAction Filter (UNTESTED) --- .../HasNoActionFilter.php | 15 +++++++-------- .../translations/messages.fr.yml | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php index c6271b555..a26628e95 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php @@ -25,11 +25,11 @@ class HasNoActionFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { - $qb - ->andWhere( - $qb->expr()->in('', ':') - ) - ->setParameter('', $data[]); + if (!in_array('acpw', $qb->getAllAliases(), true)) { + $qb->join('acp.works', 'acpw'); + } + + $qb->andWhere('COUNT(acp.works) IS NULL'); } public function applyOn(): string @@ -39,13 +39,12 @@ class HasNoActionFilter implements FilterInterface public function buildForm(FormBuilderInterface $builder) { - $builder->add(); + // no form } public function describeAction($data, $format = 'string'): array { - return ['', [ - ]]; + return ['Filtered acp which has no actions']; } public function getTitle(): string diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 9243a51f8..be47a06c2 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -555,6 +555,7 @@ Date to: Date de fin Filter by temporary location: Filtrer les parcours avec une localisation temporaire Filter by which has no referrer: Filtrer les parcours sans référent Filter by which has no action: Filtrer les parcours qui n’ont pas d’actions +Filtered acp which has no actions: Filtré les parcours qui n'ont pas d'actions Group by number of actions: Grouper les parcours par nombre d’actions Filter by creator: Filtrer les parcours par créateur Filter by creator job: Filtrer les parcours par métier du créateur