diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php new file mode 100644 index 000000000..8def8cf88 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -0,0 +1,75 @@ +addSelect(' + CASE true WHEN workeval.endDAte IS NULL ELSE false END + AS eval_enddate_aggregator + ') + ->addGroupBy('eval_enddate_aggregator'); + } + + public function applyOn(): string + { + return Declarations::EVAL_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + // No form needed + } + + public function getLabels($key, array $values, $data) + { + return function ($value): string { + if ('_header' === $value) { + return ''; + } + switch ($value) { + case true: + return 'enddate is specified'; + + case false: + return 'enddate is not specified'; + + default: + throw new \LogicException(sprintf('The value %s is not valid', $value)); + } + + }; + } + + public function getQueryKeys($data): array + { + return ['eval_enddate_aggregator']; + } + + public function getTitle(): string + { + return 'Group evaluations having end date'; + } +} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 1be565938..bab2845ed 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -611,6 +611,10 @@ maxdate is specified: la date d'échéance est spécifiée maxdate is not specified: la date d'échéance n'est pas spécifiée "Filtered by maxdate: only %choice%": "Filtré par date d'échéance: uniquement si %choice%" +Group evaluations having end date: Grouper les évaluations qui ont une date de fin +enddate is specified: la date de fin est spécifiée +enddate is not specified: la date de fin n'est pas spécifiée + ## household filters/aggr Filter by composition: Filtrer les ménages par composition familiale Accepted composition: Composition familiale