mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Feature: [export][evaluation] Adding group by evaluation having end date
This commit is contained in:
parent
f0b2ec1348
commit
4ca10ce38d
@ -16,9 +16,17 @@ use Chill\PersonBundle\Export\Declarations;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class HavingEndDateAggregator implements AggregatorInterface
|
class HavingEndDateAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
|
public function __construct(TranslatorInterface $translator)
|
||||||
|
{
|
||||||
|
$this->translator = $translator;
|
||||||
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -27,10 +35,7 @@ class HavingEndDateAggregator implements AggregatorInterface
|
|||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
->addSelect('
|
->addSelect('CASE WHEN workeval.endDate IS NULL THEN true ELSE false END AS eval_enddate_aggregator')
|
||||||
CASE true WHEN workeval.endDAte IS NULL ELSE false END
|
|
||||||
AS eval_enddate_aggregator
|
|
||||||
')
|
|
||||||
->addGroupBy('eval_enddate_aggregator');
|
->addGroupBy('eval_enddate_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,17 +51,17 @@ class HavingEndDateAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return static function ($value): string {
|
return function ($value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return '';
|
return 'export.aggregator.eval.by_end_date.Has end date ?';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($value) {
|
switch ($value) {
|
||||||
case true:
|
case true:
|
||||||
return 'enddate is specified';
|
return $this->translator->trans('export.aggregator.eval.by_end_date.enddate is specified');
|
||||||
|
|
||||||
case false:
|
case false:
|
||||||
return 'enddate is not specified';
|
return $this->translator->trans('export.aggregator.eval.by_end_date.enddate is not specified');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new LogicException(sprintf('The value %s is not valid', $value));
|
throw new LogicException(sprintf('The value %s is not valid', $value));
|
||||||
@ -71,6 +76,6 @@ class HavingEndDateAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group evaluations having end date';
|
return 'export.aggregator.eval.by_end_date.Group evaluations having end date';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,3 +73,10 @@ services:
|
|||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: evaluation_bymaxdate_aggregator }
|
- { name: chill.export_aggregator, alias: evaluation_bymaxdate_aggregator }
|
||||||
|
|
||||||
|
Chill\PersonBundle\Export\Aggregator\EvaluationAggregators\HavingEndDateAggregator:
|
||||||
|
autowire: true
|
||||||
|
autoconfigure: true
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_aggregator, alias: evaluation_byend_date_aggregator }
|
||||||
|
|
||||||
|
@ -626,9 +626,6 @@ 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
|
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%"
|
"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
|
## household filters/aggr
|
||||||
Filter by composition: Filtrer les ménages par composition familiale
|
Filter by composition: Filtrer les ménages par composition familiale
|
||||||
@ -1018,6 +1015,12 @@ export:
|
|||||||
Group by current actions: Grouper les actions en cours
|
Group by current actions: Grouper les actions en cours
|
||||||
Current action: Action en cours
|
Current action: Action en cours
|
||||||
Not current action: Action terminée
|
Not current action: Action terminée
|
||||||
|
eval:
|
||||||
|
by_end_date:
|
||||||
|
Has end date ?: Évaluation en cours ?
|
||||||
|
Group evaluations having end date: Grouper les évaluations en cours (avec ou sans 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
|
||||||
filter:
|
filter:
|
||||||
course:
|
course:
|
||||||
by_user_scope:
|
by_user_scope:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user