mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch '__geounitstat' into 111_exports_suite (but disable GeoUnit Filter/Aggr)
This commit is contained in:
commit
32c600c155
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
|
||||
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class GeographicalUnitStatAggregator implements AggregatorInterface
|
||||
{
|
||||
/*
|
||||
private EntityRepository $repository;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
) {
|
||||
$this->repository = $em->getRepository(...::class);
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
return 'Geographical unit';
|
||||
}
|
||||
|
||||
$g = $this->repository->find($value);
|
||||
|
||||
return $g; //...
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getQueryKeys($data): array
|
||||
{
|
||||
return ['geographicalunitstat_aggregator'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
// TODO: Implement buildForm() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Group by geographical unit';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function addRole()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
|
||||
//$qb->addSelect('... AS geographicalunitstat_aggregator');
|
||||
|
||||
$groupby = $qb->getDQLPart('groupBy');
|
||||
|
||||
if (!empty($groupBy)) {
|
||||
$qb->addGroupBy('geographicalunitstat_aggregator');
|
||||
} else {
|
||||
$qb->groupBy('geographicalunitstat_aggregator');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function applyOn(): string
|
||||
{
|
||||
return Declarations::ACP_TYPE;
|
||||
}
|
||||
}
|
@ -44,12 +44,12 @@ services:
|
||||
tags:
|
||||
- { name: chill.export_filter, alias: accompanyingcourse_step_filter }
|
||||
|
||||
chill.person.export.filter_geographicalunitstat:
|
||||
class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\GeographicalUnitStatFilter
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
tags:
|
||||
- { name: chill.export_filter, alias: accompanyingcourse_geographicalunitstat_filter }
|
||||
#chill.person.export.filter_geographicalunitstat:
|
||||
# class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\GeographicalUnitStatFilter
|
||||
# autowire: true
|
||||
# autoconfigure: true
|
||||
# tags:
|
||||
# - { name: chill.export_filter, alias: accompanyingcourse_geographicalunitstat_filter }
|
||||
|
||||
chill.person.export.filter_socialaction:
|
||||
class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\SocialActionFilter
|
||||
@ -178,6 +178,13 @@ services:
|
||||
tags:
|
||||
- { name: chill.export_aggregator, alias: accompanyingcourse_step_aggregator }
|
||||
|
||||
#chill.person.export.aggregator_geographicalunitstat:
|
||||
# class: Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\GeographicalUnitStatAggregator
|
||||
# autowire: true
|
||||
# autoconfigure: true
|
||||
# tags:
|
||||
# - { name: chill.export_aggregator, alias: accompanyingcourse_geographicalunitstat_aggregator }
|
||||
|
||||
chill.person.export.aggregator_socialaction:
|
||||
class: Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\SocialActionAggregator
|
||||
autowire: true
|
||||
|
@ -449,6 +449,8 @@ Step: Statut
|
||||
Group by step: Grouper les parcours par statut du parcours
|
||||
|
||||
Filter by geographical unit: Filtrer les parcours par zone géographique
|
||||
Group by geographical unit: Grouper les parcours par zone géographique
|
||||
Geographical unit: Zone géographique
|
||||
|
||||
Filter by socialaction: Filtrer les parcours par action d'accompagnement
|
||||
Accepted socialactions: Actions d'accompagnement
|
||||
|
Loading…
x
Reference in New Issue
Block a user