diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php index 98d496714..e3fbc19d5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php @@ -39,8 +39,10 @@ class StepFilter implements FilterInterface { $builder->add('accepted_steps', ChoiceType::class, [ 'choices' => self::STEPS, - 'multiple' => true, + 'multiple' => false, 'expanded' => true, + 'empty_data' => self::DEFAULT_CHOICE, + 'data' => self::DEFAULT_CHOICE, ]); } @@ -51,16 +53,10 @@ class StepFilter implements FilterInterface public function describeAction($data, $format = 'string') { - $steps = []; + $step = array_flip(self::STEPS)[$data['accepted_steps']]; - foreach ($data['accepted_steps'] as $v) { - $steps[] = $this->translator->trans( - array_flip(self::STEPS)[$v] - ); - } - - return ["Filtered by steps: only %steps%", [ - '%steps%' => implode(', ou ', $steps) + return ["Filtered by steps: only %step%", [ + '%step%' => $this->translator->trans($step) ]]; } @@ -72,7 +68,7 @@ class StepFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->in('acp.step', ':step'); + $clause = $qb->expr()->eq('acp.step', ':step'); if ($where instanceof Andx) { $where->add($clause); diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 288793af0..4c5ca1dcf 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -388,7 +388,7 @@ Accepted socialissues: Problématiques sociales Filter by step: Filtrer par statut du parcours Accepted steps: Statuts -"Filtered by steps: only %steps%": "Filtré par statut du parcours: uniquement %steps%" +"Filtered by steps: only %step%": "Filtré par statut du parcours: uniquement %step%" Filter by origin: Filtrer par origine du parcours Accepted origins: Origines