diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php new file mode 100644 index 000000000..ae7492724 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php @@ -0,0 +1,60 @@ +addSelect('AS _aggregator') + ->addGroupBy('_aggregator'); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + // No form needed + } + + public function getLabels($key, array $values, $data) + { + return function ($value): string { + if ('_header' === $value) { + return ''; + } + }; + } + + public function getQueryKeys($data): array + { + return ['_aggregator']; + } + + public function getTitle(): string + { + return 'Group acp by activity number'; + } +} diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php new file mode 100644 index 000000000..bde6e7f06 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -0,0 +1,60 @@ +addSelect('AS _aggregator') + ->addGroupBy('_aggregator'); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + // No form needed + } + + public function getLabels($key, array $values, $data) + { + return function ($value): string { + if ('_header' === $value) { + return ''; + } + }; + } + + public function getQueryKeys($data): array + { + return ['_aggregator']; + } + + public function getTitle(): string + { + return 'Group activity by sentreceived'; + } +} diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php new file mode 100644 index 000000000..53abd2550 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter acp which has no activity'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillActivityBundle/config/services/export.yaml b/src/Bundle/ChillActivityBundle/config/services/export.yaml index 224075e6f..57153a193 100644 --- a/src/Bundle/ChillActivityBundle/config/services/export.yaml +++ b/src/Bundle/ChillActivityBundle/config/services/export.yaml @@ -120,6 +120,10 @@ services: tags: - { name: chill.export_filter, alias: 'activity_usersscope_filter' } + Chill\ActivityBundle\Export\Filter\ACPFilters\HasNoActivityFilter: + tags: + - { name: chill.export_filter, alias: 'accompanyingcourse_has_no_activity_filter' } + ## Aggregators Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator: tags: @@ -179,3 +183,11 @@ services: Chill\ActivityBundle\Export\Aggregator\ActivityUsersJobAggregator: tags: - { name: chill.export_aggregator, alias: activity_users_job_aggregator } + + Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByActivityNumberAggregator: + tags: + - { name: chill.export_aggregator, alias: accompanyingcourse_by_activity_number_aggregator } + + Chill\ActivityBundle\Export\Aggregator\SentReceivedAggregator: + tags: + - { name: chill.export_aggregator, alias: activity_sentreceived_aggregator } diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 6873b3736..d3ac822cb 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -276,6 +276,10 @@ Creators: Créateurs Filter activity by userscope: Filtrer les activités par service du créateur 'Filtered activity by userscope: only %scopes%': "Filtré par service du créateur: uniquement %scopes%" Accepted userscope: Services + +Filter acp which has no activity: Filtrer les parcours qui n’ont pas d’activité +Group acp by activity number: Grouper les parcours par nombre d’activité +Group activity by sentreceived: Grouper les activités par envoyé / reçu #aggregators Activity type: Type d'activité diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php new file mode 100644 index 000000000..c3f94b947 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php @@ -0,0 +1,60 @@ +addSelect('AS _aggregator') + ->addGroupBy('_aggregator'); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + // No form needed + } + + public function getLabels($key, array $values, $data) + { + return function ($value): string { + if ('_header' === $value) { + return ''; + } + }; + } + + public function getQueryKeys($data): array + { + return ['_aggregator']; + } + + public function getTitle(): string + { + return 'Group by number of actions'; + } +} diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php new file mode 100644 index 000000000..0eb98b0d4 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -0,0 +1,60 @@ +addSelect('AS _aggregator') + ->addGroupBy('_aggregator'); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + // No form needed + } + + public function getLabels($key, array $values, $data) + { + return function ($value): string { + if ('_header' === $value) { + return ''; + } + }; + } + + public function getQueryKeys($data): array + { + return ['_aggregator']; + } + + public function getTitle(): string + { + return 'Group by creator job'; + } +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php new file mode 100644 index 000000000..7dd78d0b4 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter by creator'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php new file mode 100644 index 000000000..021d2227c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter by creator job'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php new file mode 100644 index 000000000..c6271b555 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter by which has no action'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php new file mode 100644 index 000000000..f6ec58104 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter by which has no referrer'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php new file mode 100644 index 000000000..18a6c3918 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -0,0 +1,55 @@ +andWhere( + $qb->expr()->in('', ':') + ) + ->setParameter('', $data[]); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add(); + } + + public function describeAction($data, $format = 'string'): array + { + return ['', [ + ]]; + } + + public function getTitle(): string + { + return 'Filter by temporary location'; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_course.yaml b/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_course.yaml index 04d5d8371..71eecf4ff 100644 --- a/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_course.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_course.yaml @@ -103,6 +103,32 @@ services: tags: - { name: chill.export_filter, alias: accompanyingcourse_openbetweendates_filter } + chill.person.export.filter_has_temporary_location: + class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\HasTemporaryLocationFilter + tags: + - { name: chill.export_filter, alias: accompanyingcourse_has_temporary_location_filter } + + chill.person.export.filter_has_no_referrer: + class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\HasNoReferrerFilter + tags: + - { name: chill.export_filter, alias: accompanyingcourse_has_no_referrer_filter } + + chill.person.export.filter_has_no_action: + class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\HasNoActionFilter + tags: + - { name: chill.export_filter, alias: accompanyingcourse_has_no_action_filter } + + chill.person.export.filter_creator: + class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\CreatorFilter + tags: + - { name: chill.export_filter, alias: accompanyingcourse_creator_filter } + + chill.person.export.filter_creator_job: + class: Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\CreatorJobFilter + tags: + - { name: chill.export_filter, alias: accompanyingcourse_creator_job_filter } + + ## Aggregators chill.person.export.aggregator_referrer_scope: class: Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ScopeAggregator @@ -191,3 +217,11 @@ services: Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ByHouseholdCompositionAggregator: tags: - { name: chill.export_aggregator, alias: accompanyingcourse_by_household_compo_aggregator } + + Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ByActionNumberAggregator: + tags: + - { name: chill.export_aggregator, alias: accompanyingcourse_by_action_number_aggregator } + + Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\CreatorJobAggregator: + tags: + - { name: chill.export_aggregator, alias: accompanyingcourse_creator_job_aggregator } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index f3fd6c430..e39602dd3 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -552,6 +552,14 @@ Date from: Date de début Date to: Date de fin "Filtered by opening dates: between %datefrom% and %dateto%": "Filtrer les parcours ouverts entre deux dates: entre le %datefrom% et le %dateto%" +Filter by temporary location: Filtrer les parcours avec une localisation temporaire +Filter by which has no referrer: Filtrer les parcours sans référent +Filter by which has no action: Filtrer les parcours qui n’ont pas d’actions +Group by number of actions: Grouper les parcours par nombre d’actions +Filter by creator: Filtrer les parcours par créateur +Filter by creator job: Filtrer les parcours par métier du créateur +Group by creator job: Grouper les parcours par métier du créateur + ## social actions filters/aggr Filter by treating agent scope: Filtrer les actions par service de l'agent traitant "Filtered by treating agent scope: only %scopes%": "Filtré par service de l'agent traitant: uniquement %scopes%"