diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php deleted file mode 100644 index 476c7ea0a..000000000 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ProfessionalSitutaionAggregator.php +++ /dev/null @@ -1,90 +0,0 @@ -professionalSituationRepository = $professionalSituationRepository; - $this->translatableStringHelper = $translatableStringHelper; - } - - public function addRole() - { - return null; - } - - public function alterQuery(QueryBuilder $qb, $data) - { - $qb->resetDQLPart('from'); - $qb->from('App:VendeePerson', 'vp'); - $qb->join('vp.person', 'person'); - $qb->join('person.center', 'center'); - - $qb->join('vp.situationProfessionelle', 'sp'); - $qb->addSelect('sp.id as professional_situation_aggregator'); - - $groupBy = $qb->getDQLPart('groupBy'); - - if (!empty($groupBy)) { - $qb->addGroupBy('professional_situation_aggregator'); - } else { - $qb->groupBy('professional_situation_aggregator'); - } - } - - public function applyOn() - { - return Declarations::PERSON_TYPE; - } - - public function buildForm(FormBuilderInterface $builder) - { - } - - public function getLabels($key, array $values, $data) - { - return function ($value): string { - if ('_header' === $value) { - return 'Professional situation'; - } - - $g = $this->professionalSituationRepository->find($value); - - return $this->translatableStringHelper->localize($g->getName());; - }; - } - - public function getQueryKeys($data) - { - return ['professional_situation_aggregator']; - } - - public function getTitle() - { - return 'Group people by their professional situation'; - } -} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php deleted file mode 100644 index 0e85232bf..000000000 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/EntrustedChildFilter.php +++ /dev/null @@ -1,66 +0,0 @@ -resetDQLPart('from'); - $qb->from('App:VendeePersonMineur', 'vpm'); - - $qb->join('vpm.person', 'person'); - $qb->join('person.center', 'center'); - - $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->eq('vpm.enfantConfie', 'true'); - - if ($where instanceof Andx) { - $where->add($clause); - } else { - $where = $qb->expr()->andX($clause); - } - - $qb->add('where', $where); - } - - public function applyOn() - { - return Declarations::PERSON_TYPE; - } - - public function buildForm(FormBuilderInterface $builder) - { - // No form needed - } - - public function describeAction($data, $format = 'string') - { - return ['Filtered by entrusted child status']; - } - - public function getTitle() - { - return 'Filter by entrusted child status'; - } -} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NomadicFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NomadicFilter.php deleted file mode 100644 index 33cac6522..000000000 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NomadicFilter.php +++ /dev/null @@ -1,64 +0,0 @@ -resetDQLPart('from'); - $qb->from('App:VendeePerson', 'vp'); - - $qb->join('vp.person', 'person'); - $qb->join('person.center', 'center'); - - $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->eq('vp.gensDuVoyage', 'true'); - - if ($where instanceof Andx) { - $where->add($clause); - } else { - $where = $qb->expr()->andX($clause); - } - - $qb->add('where', $where); - } - - public function applyOn() - { - return Declarations::PERSON_TYPE; - } - - public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) - { - // No form needed - } - - public function describeAction($data, $format = 'string') - { - return ['Filtered by nomadic status']; - } - - public function getTitle() - { - return 'Filter by nomadic status'; - } -} diff --git a/src/Bundle/ChillPersonBundle/config/services/exports_person.yaml b/src/Bundle/ChillPersonBundle/config/services/exports_person.yaml index c8bd9d76a..d3bb49b6f 100644 --- a/src/Bundle/ChillPersonBundle/config/services/exports_person.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/exports_person.yaml @@ -68,20 +68,6 @@ services: autoconfigure: true tags: - { name: chill.export_filter, alias: person_residential_address_at_user_filter } - - chill.person.export.filter_entrusted_child: - class: Chill\PersonBundle\Export\Filter\PersonFilters\EntrustedChildFilter - autowire: true - autoconfigure: true - tags: - - { name: chill.export_filter, alias: person_entrusted_child_filter } - - chill.person.export.filter_nomadic: - class: Chill\PersonBundle\Export\Filter\PersonFilters\NomadicFilter - autowire: true - autoconfigure: true - tags: - - { name: chill.export_filter, alias: person_nomadic_filter } ## Aggregators chill.person.export.aggregator_nationality: @@ -118,10 +104,3 @@ services: autoconfigure: true tags: - { name: chill.export_aggregator, alias: person_marital_status_aggregator } - - # chill.person.export.aggregator_professional_situation: - # class: Chill\PersonBundle\Export\Aggregator\PersonAggregators\ProfessionalSituationAggregator - # autowire: true - # autoconfigure: true - # tags: - # - { name: chill.export_aggregator, alias: person_professional_situation_aggregator }