mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
Feature: [export] group accompanying period by number of actions
This commit is contained in:
parent
e6553e71ee
commit
5655f953d7
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
|
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AggregatorInterface;
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@ -23,9 +24,9 @@ class ByActionNumberAggregator implements AggregatorInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->addSelect('AS acp_by_action_number_aggregator')
|
$qb->addSelect('(SELECT COUNT(acp_by_action_action.id) FROM ' . AccompanyingPeriodWork::class . ' acp_by_action_action WHERE acp_by_action_action.accompanyingPeriod = acp) AS acp_by_action_number_aggregator')
|
||||||
->addGroupBy('acp_by_action_number_aggregator');
|
->addGroupBy('acp_by_action_number_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,17 +35,23 @@ class ByActionNumberAggregator implements AggregatorInterface
|
|||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// No form needed
|
// No form needed
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return static function ($value): string {
|
return static function ($value) {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
|
return 'export.aggregator.course.by_number_of_action.Number of actions';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1015,6 +1015,8 @@ export:
|
|||||||
Household composition: Composition du ménage
|
Household composition: Composition du ménage
|
||||||
Group course by household composition: Grouper les parcours par composition familiale des ménages des usagers concernés
|
Group course by household composition: Grouper les parcours par composition familiale des ménages des usagers concernés
|
||||||
Calc date: Date de calcul de la composition du ménage
|
Calc date: Date de calcul de la composition du ménage
|
||||||
|
by_number_of_action:
|
||||||
|
Number of actions: Nombre d'actions
|
||||||
filter:
|
filter:
|
||||||
course:
|
course:
|
||||||
by_user_scope:
|
by_user_scope:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user