diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php index 791b521af..1907edb57 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php @@ -11,9 +11,9 @@ declare(strict_types=1); namespace Chill\PersonBundle\Export\Filter\SocialWorkFilters; +use Chill\MainBundle\Entity\User; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\PickUserDynamicType; -use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -22,9 +22,7 @@ class CreatorFilter implements FilterInterface { private const PREFIX = 'acpw_filter_creator'; - public function __construct( - private readonly TranslatableStringHelper $translatableStringHelper - ) {} + public function __construct() {} public function addRole(): ?string { @@ -38,12 +36,7 @@ class CreatorFilter implements FilterInterface $qb ->join('acpw.createdBy', "{$p}_creator") ->andWhere($qb->expr()->in("{$p}_creator", ":{$p}_creators")) - ->setParameter("{$p}_creators", $data['creators']) - //->setParameter("{$p}_calc_date", $this->rollingDateConverter->convert( - // $data['creator_at'] ?? new RollingDate(RollingDate::T_TODAY) - //)) - ; - + ->setParameter("{$p}_creators", $data['creators']); } public function applyOn(): string @@ -57,24 +50,22 @@ class CreatorFilter implements FilterInterface ->add('creators', PickUserDynamicType::class, [ 'multiple' => true, 'label' => 'export.filter.work.by_creator.Creators', - ]) - //->add('creator_at', PickRollingDateType::class, [ - // 'label' => 'export.filter.work.by_creator.Calc date', - // 'help' => 'export.filter.work.by_creator.calc_date_help', - //]) - ; + ]); } public function describeAction($data, $format = 'string'): array { - return []; + return [ + 'export.filter.work.by_creator.Filtered by creator: only %creators%', [ + '%creators%' => implode(', ', array_map(static fn (User $u) => $u->getLabel(), $data['creators'])), + ], + ]; } public function getFormDefaultData(): array { return [ 'creators' => [], - //'creator_at' => new RollingDate(RollingDate::T_TODAY), ]; } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 6ee525f8b..878ff7970 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -1223,6 +1223,7 @@ export: by_creator: title: Filtrer les actions par créateur Creators: Créateur de l'action + "Filtered by creator: only %creators%": "Filtré par créateur de l'action: uniquement %creators%" #Calc date: Date à laquelle le créateur ... #calc_date_help: Il s'agit de la date à laquelle le créateur ... by_creator_job: