From cdaca533a02967ef36301564446da12b8f5ec2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Apr 2023 17:37:27 +0200 Subject: [PATCH] Feature: [export] allow to check multiple geographical layers in geographical aggregators BC: saved exports which activated this layers won't work any more. This is the query to find them: ```sql SELECT * FROM chill_main_saved_export WHERE options->'export'->'export'->'aggregators'->'accompanyingcourse_geographicalunitstat_aggregator'->>'enabled' = '1' ``` --- .../GeographicalUnitStatAggregator.php | 4 +++- .../PersonAggregators/GeographicalUnitAggregator.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 80781b823..6f10dbaa7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -98,7 +98,7 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface 'acp_geog_units' ); - $qb->andWhere($qb->expr()->eq('acp_geog_units.layer', ':acp_geog_unit_layer')); + $qb->andWhere($qb->expr()->in('acp_geog_units.layer', ':acp_geog_unit_layer')); $qb->setParameter('acp_geog_unit_layer', $data['level']); @@ -131,6 +131,8 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface 'choice_label' => function (GeographicalUnitLayer $item) { return $this->translatableStringHelper->localize($item->getName()); }, + 'multiple' => true, + 'expanded' => true, ]); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index 6193f3c61..9d34edfca 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -103,6 +103,8 @@ class GeographicalUnitAggregator implements AggregatorInterface 'choice_label' => function (GeographicalUnitLayer $item) { return $this->translatableStringHelper->localize($item->getName()); }, + 'multiple' => true, + 'expanded' => true, ]); }