mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
revert stepFilter to uniq selection
(cfr ddac410b2e5be2db7542dc92f89c5d0d4baf3ce7)
This commit is contained in:
parent
e728c00671
commit
ef827a1322
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user