diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/index.js b/src/Bundle/ChillMainBundle/Resources/public/chill/index.js index dda7b7e67..d60ebdff8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/index.js @@ -46,7 +46,6 @@ require('../lib/collection/index.js'); require('../lib/breadcrumb/index.js'); require('../lib/download-report/index.js'); require('../lib/select_interactive_loading/index.js'); -require('../lib/export-list/index.js'); //require('../lib/show_hide/index.js'); //require('../lib/tabs/index.js'); diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index d7037c1d2..e2e2fbc97 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -95,6 +95,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac $loader->load('services/doctrineEventListener.yaml'); $loader->load('services/accompanyingPeriodConsistency.yaml'); + // if ($container->getParameter('chill_person.accompanying_period') !== 'hidden') { $loader->load('services/exports_accompanying_period.yaml'); } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php index 69ab19a55..b7b57d3cd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php @@ -93,9 +93,6 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface $qb->select('COUNT(acp.id) AS export_result') ->from('ChillPersonBundle:AccompanyingPeriod', 'acp') - ->where($expr->neq( - 'acp.step', $expr->literal('DRAFT') - )) ; return $qb; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php index 639fa56a4..8747c288a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php @@ -131,9 +131,6 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn ELSE :force_closingDate END ) - acp.openingDate ) AS export_result') - ->where($expr->neq( - 'acp.step', $expr->literal('DRAFT') - )) ->setParameter('force_closingDate', $force_closingdate) ; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/ClosingMotiveFilter.php new file mode 100644 index 000000000..7ff78d41b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/ClosingMotiveFilter.php @@ -0,0 +1,100 @@ +translatableStringHelper = $translatableStringHelper; + } + + /** + * @inheritDoc + */ + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_closingmotives', EntityType::class, [ + 'class' => ClosingMotive::class, + 'choice_label' => function (ClosingMotive $cm) { + return $this->translatableStringHelper->localize($cm->getName()); + }, + 'multiple' => true, + 'expanded' => true, + ]); + } + + /** + * @inheritDoc + */ + public function getTitle(): string + { + return 'Filter by closing motive'; + } + + /** + * @inheritDoc + */ + public function describeAction($data, $format = 'string'): array + { + $motives = []; + + foreach ($data['accepted_closingmotives'] as $k => $v) { + $motives[] = $this->translatableStringHelper->localize($v->getName()); + } + + return [ + 'Filtered by closingmotive: only %closingmotives%', [ + '%closingmotives%' => implode(', ou ', $motives) + ]]; + } + + /** + * @inheritDoc + */ + public function addRole() + { + return null; + } + + /** + * @inheritDoc + */ + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('acp.closingMotive', ':closingmotive'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('closingmotive', $data['accepted_closingmotives']); + } + + /** + * @inheritDoc + */ + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/ConfidentialFilter.php new file mode 100644 index 000000000..7e043c131 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/ConfidentialFilter.php @@ -0,0 +1,87 @@ + false, + 'is confidential' => true, + ]; + + private CONST DEFAULT_CHOICE = false; + + private TranslatorInterface $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_confidentials', ChoiceType::class, [ + 'choices' => self::CHOICES, + 'multiple' => false, + 'expanded' => true, + 'empty_data' => self::DEFAULT_CHOICE, + 'data' => self::DEFAULT_CHOICE, + ]); + } + + public function getTitle(): string + { + return 'Filter by confidential'; + } + + public function describeAction($data, $format = 'string'): array + { + dump($data, self::CHOICES); + + foreach (self::CHOICES as $k => $v) { + if ($v === $data['accepted_confidentials']) { + $choice = $k; + } + } + + return [ + 'Filtered by confidential: only %confidential%', [ + '%confidential%' => $this->translator->trans($choice) + ] + ]; + } + + public function addRole() + { + return null; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->eq('acp.confidential', ':confidential'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('confidential', $data['accepted_confidentials']); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EmergencyFilter.php new file mode 100644 index 000000000..f09d117f4 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EmergencyFilter.php @@ -0,0 +1,85 @@ + false, + 'is emergency' => true, + ]; + + private CONST DEFAULT_CHOICE = false; + + private TranslatorInterface $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_emergencies', ChoiceType::class, [ + 'choices' => self::CHOICES, + 'multiple' => false, + 'expanded' => true, + 'empty_data' => self::DEFAULT_CHOICE, + 'data' => self::DEFAULT_CHOICE, + ]); + } + + public function getTitle(): string + { + return 'Filter by emergency'; + } + + public function describeAction($data, $format = 'string'): array + { + foreach (self::CHOICES as $k => $v) { + if ($v === $data['accepted_emergencies']) { + $choice = $k; + } + } + + return [ + 'Filtered by emergency: only %emergency%', [ + '%emergency%' => $this->translator->trans($choice) + ] + ]; + } + + public function addRole() + { + return null; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->eq('acp.emergency', ':emergency'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('emergency', $data['accepted_emergencies']); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/IntensityFilter.php new file mode 100644 index 000000000..b55e7f399 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/IntensityFilter.php @@ -0,0 +1,85 @@ + 'occasional', + 'is regular' => 'regular', + ]; + + private CONST DEFAULT_CHOICE = 'occasional'; + + private TranslatorInterface $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_intensities', ChoiceType::class, [ + 'choices' => self::CHOICES, + 'multiple' => false, + 'expanded' => true, + 'empty_data' => self::DEFAULT_CHOICE, + 'data' => self::DEFAULT_CHOICE, + ]); + } + + public function getTitle(): string + { + return 'Filter by intensity'; + } + + public function describeAction($data, $format = 'string'): array + { + foreach (self::CHOICES as $k => $v) { + if ($v === $data['accepted_intensities']) { + $choice = $k; + } + } + + return [ + 'Filtered by intensity: only %intensity%', [ + '%intensity%' => $this->translator->trans($choice) + ] + ]; + } + + public function addRole() + { + return null; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->eq('acp.intensity', ':intensity'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('intensity', $data['accepted_intensities']); + } + + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/OriginFilter.php new file mode 100644 index 000000000..936767009 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/OriginFilter.php @@ -0,0 +1,100 @@ +translatableStringHelper = $translatableStringHelper; + } + + /** + * @inheritDoc + */ + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_origins', EntityType::class, [ + 'class' => Origin::class, + 'choice_label' => function (Origin $o) { + return $this->translatableStringHelper->localize($o->getLabel()); + }, + 'multiple' => true, + 'expanded' => true + ]); + } + + /** + * @inheritDoc + */ + public function getTitle(): string + { + return 'Filter by origin'; + } + + /** + * @inheritDoc + */ + public function describeAction($data, $format = 'string'): array + { + $origins = []; + + foreach ($data['accepted_origins'] as $v) { + $origins[] = $this->translatableStringHelper->localize($v->getLabel()); + } + + return ['Filtered by origins: only %origins%', [ + '%origins%' => implode(', ou ', $origins) + ]]; + } + + /** + * @inheritDoc + */ + public function addRole() + { + return null; + } + + /** + * @inheritDoc + */ + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('acp.origin', ':origin'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('origin', $data['accepted_origins']); + } + + /** + * @inheritDoc + */ + public function applyOn(): string + { + return Declarations::ACP_TYPE; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialIssueFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialIssueFilter.php new file mode 100644 index 000000000..092982d41 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialIssueFilter.php @@ -0,0 +1,144 @@ +translator = $translator; + $this->translatableStringHelper = $translatableStringHelper; + $this->socialIssueRender = $socialIssueRender; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_socialissues', EntityType::class, [ + 'class' => SocialIssue::class, + 'choice_label' => function ($socialIssue) { + return $this->socialIssueRender->renderString($socialIssue, []); + }, + 'multiple' => true, + 'expanded' => true, + ]); + } + + public function getTitle() + { + return 'Filter by social issue'; + } + + public function describeAction($data, $format = 'string') + { + $issues = []; + + $socialissues = $this->addParentIssues($data['accepted_socialissues']); + + foreach ($socialissues as $i) { + if ('null' === $i) { + $issues[] = $this->translator->trans('Not given'); + } else { + $issues[] = $this->socialIssueRender->renderString($i, []); + } + } + + return [ + 'Filtered by socialissues: only %socialissues%', [ + '%socialissues%' => implode(', ou ', $issues) + ]]; + } + + public function addRole() + { + return null; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + $qb->join('acp.socialIssues', 'si'); + + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('si.id', ':socialissues'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('socialissues', + $this->addParentIssues($data['accepted_socialissues']) + ); + } + + /** + * "Le filtre retiendra les parcours qui comportent cette problématique, + * ou une problématique parente à celles choisies." + * + * Add parent of each socialissue selected, and remove duplicates + * + * @param $accepted_issues + * @return array + */ + private function addParentIssues($accepted_issues): array + { + $array = []; + foreach ($accepted_issues as $i) + { + /** @var SocialIssue $i */ + if ($i->hasParent()) { + $array[] = $i->getParent(); + } + $array[] = $i; + } + return $this->removeDuplicate($array); + } + + private function removeDuplicate(array $array): array + { + $ids = array_map(function ($item) { + return $item->getId(); + }, $array); + + $unique_ids = array_unique($ids); + + return array_values( + array_intersect_key($array, $unique_ids)); + } + + public function applyOn() + { + return Declarations::ACP_TYPE; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php new file mode 100644 index 000000000..e3fbc19d5 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Export/Filter/StepFilter.php @@ -0,0 +1,88 @@ + AccompanyingPeriod::STEP_DRAFT, + 'Confirmed' => AccompanyingPeriod::STEP_CONFIRMED, + 'Closed' => AccompanyingPeriod::STEP_CLOSED, + ]; + + private const DEFAULT_CHOICE = AccompanyingPeriod::STEP_CONFIRMED; + + /** + * @var TranslatorInterface + */ + protected $translator; + + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('accepted_steps', ChoiceType::class, [ + 'choices' => self::STEPS, + 'multiple' => false, + 'expanded' => true, + 'empty_data' => self::DEFAULT_CHOICE, + 'data' => self::DEFAULT_CHOICE, + ]); + } + + public function getTitle() + { + return 'Filter by step'; + } + + public function describeAction($data, $format = 'string') + { + $step = array_flip(self::STEPS)[$data['accepted_steps']]; + + return ["Filtered by steps: only %step%", [ + '%step%' => $this->translator->trans($step) + ]]; + } + + public function addRole() + { + return null; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->eq('acp.step', ':step'); + + if ($where instanceof Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('step', $data['accepted_steps']); + } + + public function applyOn() + { + return Declarations::ACP_TYPE; + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/UserJobFilter.php index 6e2c7d19f..d641d9a74 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/UserJobFilter.php @@ -22,6 +22,7 @@ use Doctrine\ORM\Query\Expr\Andx; use Doctrine\ORM\QueryBuilder; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Security\Core\Security; use Symfony\Contracts\Translation\TranslatorInterface; class UserJobFilter implements FilterInterface @@ -31,6 +32,8 @@ class UserJobFilter implements FilterInterface */ protected $translator; + private Security $security; + /** * @var TranslatableStringHelper */ @@ -38,16 +41,23 @@ class UserJobFilter implements FilterInterface public function __construct( TranslatorInterface $translator, - TranslatableStringHelper $translatableStringHelper + TranslatableStringHelper $translatableStringHelper, + Security $security ) { $this->translator = $translator; $this->translatableStringHelper = $translatableStringHelper; + $this->security = $security; } public function describeAction($data, $format = 'string') { - // to complete.. - return ['Filtered by user jobs']; + return [ + 'Filtered by user job: only %job%', [ + '%job%' => $this->translatableStringHelper->localize( + $this->getUserJob()->getLabel() + ) + ], + ]; } public function addRole() @@ -57,13 +67,8 @@ class UserJobFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { - $qb - ->join('acp.user', 'u') - ->join('u.userJob', 'j') - ; - $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->in('u.userJob', ':userjob'); + $clause = $qb->expr()->eq('acp.job', ':userjob'); if ($where instanceof Andx) { $where->add($clause); @@ -72,8 +77,7 @@ class UserJobFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('userjob', $data['accepted_userjob']); - + $qb->setParameter('userjob', $this->getUserJob()); } public function applyOn() @@ -83,20 +87,18 @@ class UserJobFilter implements FilterInterface public function buildForm(FormBuilderInterface $builder) { - $builder - ->add('accepted_userjob', EntityType::class, [ - 'class' => UserJob::class, - 'choice_label' => function(UserJob $j) { - return $this->translatableStringHelper->localize($j->getLabel()); - }, - 'multiple' => true, - 'expanded' => true, - ]) - ; } public function getTitle() { return 'Filter by user job'; } + + private function getUserJob():UserJob + { + /** @var User $user */ + $user = $this->security->getUser(); + + return $user->getUserJob(); + } } \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/UserScopeFilter.php index 58aaf1b67..bc7a1b9d3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/UserScopeFilter.php @@ -21,6 +21,7 @@ use Doctrine\ORM\Query\Expr\Andx; use Doctrine\ORM\QueryBuilder; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Security\Core\Security; use Symfony\Contracts\Translation\TranslatorInterface; class UserScopeFilter implements FilterInterface @@ -30,6 +31,8 @@ class UserScopeFilter implements FilterInterface */ protected $translator; + private Security $security; + /** * @var TranslatableStringHelper */ @@ -37,16 +40,23 @@ class UserScopeFilter implements FilterInterface public function __construct( TranslatorInterface $translator, - TranslatableStringHelper $translatableStringHelper + TranslatableStringHelper $translatableStringHelper, + Security $security ) { $this->translator = $translator; $this->translatableStringHelper = $translatableStringHelper; + $this->security = $security; } public function describeAction($data, $format = 'string') { - // to complete.. - return ['Filtered by user scopes']; + return [ + 'Filtered by user main scope: only %scope%', [ + '%scope%' => $this->translatableStringHelper->localize( + $this->getUserMainScope()->getName() + ) + ] + ]; } public function addRole() @@ -56,13 +66,10 @@ class UserScopeFilter implements FilterInterface public function alterQuery(QueryBuilder $qb, $data) { - $qb - ->join('acp.user', 'u') - ->join('u.mainScope', 's') - ; + $qb->join('acp.scopes', 's'); $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->in('u.mainScope', ':userscope'); + $clause = $qb->expr()->eq('s.id', ':userscope'); if ($where instanceof Andx) { $where->add($clause); @@ -71,7 +78,7 @@ class UserScopeFilter implements FilterInterface } $qb->add('where', $where); - $qb->setParameter('userscope', $data['accepted_userscope']); + $qb->setParameter('userscope', $this->getUserMainScope()); } @@ -82,20 +89,18 @@ class UserScopeFilter implements FilterInterface public function buildForm(FormBuilderInterface $builder) { - $builder - ->add('accepted_userscope', EntityType::class, [ - 'class' => Scope::class, - 'choice_label' => function(Scope $s) { - return $this->translatableStringHelper->localize($s->getName()); - }, - 'multiple' => true, - 'expanded' => true, - ]) - ; } public function getTitle() { return 'Filter by user scope'; } + + private function getUserMainScope():Scope + { + /** @var User $user */ + $user = $this->security->getUser(); + + return $user->getMainScope(); + } } \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php new file mode 100644 index 000000000..ed520e90b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php @@ -0,0 +1,63 @@ +filter = self::$container->get('chill.person.export.filter_socialissue'); + } catch (ServiceNotFoundException $e) { + $this->markTestSkipped('Filter service is not found'); + } + } + + public function getFilter() + { + return $this->filter; + } + + public function getFormData() + { + return [ + ['accepted_socialissue' => [ + + ]], + ['accepted_socialissue' => [ + + ]], + ['accepted_socialissue' => [ + + ]], + ]; + } + + public function getQueryBuilders() + { + // TODO: Implement getQueryBuilders() method. + } + +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/config/services/exports.yaml b/src/Bundle/ChillPersonBundle/config/services/exports.yaml index 4780a9aad..a946905c9 100644 --- a/src/Bundle/ChillPersonBundle/config/services/exports.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/exports.yaml @@ -1,4 +1,5 @@ services: + chill.person.export.count_person: class: Chill\PersonBundle\Export\Export\CountPerson arguments: @@ -25,20 +26,6 @@ services: - '%chill_main.notifications%' tags: - { name: chill.export, alias: list_person_duplicate } - - chill.person.export.count_accompanyingcourse: - class: Chill\PersonBundle\Export\Export\CountAccompanyingCourse - arguments: - - "@doctrine.orm.entity_manager" - tags: - - { name: chill.export, alias: count_accompanyingcourse } - - chill.person.export.avg_accompanyingcourse_duration: - class: Chill\PersonBundle\Export\Export\StatAccompanyingCourseDuration - arguments: - - '@Chill\PersonBundle\Repository\AccompanyingPeriodRepository' - tags: - - { name: chill.export, alias: avg_accompanyingcourse_duration } chill.person.export.count_social_actions: class: Chill\PersonBundle\Export\Export\CountSocialActions @@ -65,22 +52,6 @@ services: autoconfigure: true tags: - { name: chill.export_filter, alias: person_nationality_filter } - - chill.person.export.filter_userscope: - class: Chill\PersonBundle\Export\Filter\UserScopeFilter - arguments: - $translator: '@translator' - $translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper' - tags: - - { name: chill.export_filter, alias: accompanyingcourse_userscope_filter } - - chill.person.export.filter_userjob: - class: Chill\PersonBundle\Export\Filter\UserJobFilter - arguments: - $translator: '@translator' - $translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper' - tags: - - { name: chill.export_filter, alias: accompanyingcourse_userjob_filter } chill.person.export.aggregator_nationality: class: Chill\PersonBundle\Export\Aggregator\NationalityAggregator diff --git a/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_period.yaml b/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_period.yaml index 6126af6d6..72fa1ad80 100644 --- a/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_period.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/exports_accompanying_period.yaml @@ -1,4 +1,6 @@ -services: +services: + + ## chill.person.export.filter_accompanying_period: class: Chill\PersonBundle\Export\Filter\AccompanyingPeriodFilter tags: @@ -13,3 +15,84 @@ services: class: Chill\PersonBundle\Export\Filter\AccompanyingPeriodClosingFilter tags: - { name: chill.export_filter, alias: person_acc_pe_cl_filter } + + ## Indicators + chill.person.export.count_accompanyingcourse: + class: Chill\PersonBundle\Export\Export\CountAccompanyingCourse + autowire: true + autoconfigure: true + tags: + - { name: chill.export, alias: count_accompanyingcourse } + + chill.person.export.avg_accompanyingcourse_duration: + class: Chill\PersonBundle\Export\Export\StatAccompanyingCourseDuration + autowire: true + autoconfigure: true + tags: + - { name: chill.export, alias: avg_accompanyingcourse_duration } + + ## Filters + chill.person.export.filter_userscope: + class: Chill\PersonBundle\Export\Filter\UserScopeFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_userscope_filter } + + chill.person.export.filter_userjob: + class: Chill\PersonBundle\Export\Filter\UserJobFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_userjob_filter } + + chill.person.export.filter_socialissue: + class: Chill\PersonBundle\Export\Filter\SocialIssueFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_socialissue_filter } + + chill.person.export.filter_step: + class: Chill\PersonBundle\Export\Filter\StepFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_step_filter } + + chill.person.export.filter_origin: + class: Chill\PersonBundle\Export\Filter\OriginFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_origin_filter } + + chill.person.export.filter_closingmotive: + class: Chill\PersonBundle\Export\Filter\ClosingMotiveFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_closingmotive_filter } + + chill.person.export.filter_confidential: + class: Chill\PersonBundle\Export\Filter\ConfidentialFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_confidential_filter } + + chill.person.export.filter_emergency: + class: Chill\PersonBundle\Export\Filter\EmergencyFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_emergency_filter } + + chill.person.export.filter_intensity: + class: Chill\PersonBundle\Export\Filter\IntensityFilter + autowire: true + autoconfigure: true + tags: + - { name: chill.export_filter, alias: accompanyingcourse_intensity_filter } + + ## Aggregators \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 15ec509a8..616f02366 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -381,12 +381,47 @@ Having an accompanying period closed after this date: Ayant une période d'accom "Filtered by accompanying period: persons having an accompanying period closed between the %date_from% and %date_to%": "Filtrer par période d'accompagnement: ayant une période fermée entre le %date_from% et le %date_to%" Filter by user scope: Filtrer par service du référent -Accepted userscope: Services -Filtered by user scopes: Filtré par service du référent +"Filtered by user main scope: only %scope%": "Filtré par service du référent: uniquement %scope%" Filter by user job: Filtrer par métier du référent -Accepted userjob: Métiers -Filtered by user jobs: Filtré par métier du référent +"Filtered by user job: only %job%": "Filtré par métier du référent: uniquement %job%" + +Filter by social issue: Filtrer par problématiques sociales +Accepted socialissues: Problématiques sociales +"Filtered by socialissues: only %socialissues%": "Filtré par problématique sociale: uniquement %socialissues%" + +Filter by step: Filtrer par statut du parcours +Accepted steps: Statuts +"Filtered by steps: only %step%": "Filtré par statut du parcours: uniquement %step%" + +Filter by origin: Filtrer par origine du parcours +Accepted origins: Origines +"Filtered by origins: only %origins%": "Filtré par origine du parcours: uniquement %origins%" + +Filter by closing motive: Filtrer par motif de fermeture +Accepted closingmotives: Motifs de clôture +"Filtered by closingmotive: only %closingmotives%": "Filtré par motif de clôture: uniquement %closingmotives%" + +Filter by confidential: Filtrer par confidentialité +Accepted confidentials: '' +is confidential: le parcours est confidentiel +is not confidential: le parcours n'est pas confidentiel +"Filtered by confidential: only %confidential%": "Filtré par confidentialité: uniquement si %confidential%" + +Filter by emergency: Filtrer par urgence +Accepted emergencies: '' +is emergency: le parcours est urgent +is not emergency: le parcours n'est pas urgent +"Filtered by emergency: only %emergency%": "Filtré par urgence: uniquement si %emergency%" + +Filter by intensity: Filtrer par intensité +Accepted intensities: '' +is occasional: le parcours est ponctuel +is regular: le parcours est régulier +"Filtered by intensity: only %intensity%": "Filtré par intensité: uniquement si %intensity%" + + + ## aggregators Group people by nationality: Aggréger les personnes par nationalités @@ -540,9 +575,9 @@ occasional: ponctuel regular: régulier Confidential: confidentiel confidential: confidentiel -Draft: brouillon -Confirmed: en file active -Closed: Cloturé +Draft: Brouillon +Confirmed: En file active +Closed: Clôturé # Accompanying Course Accompanying Course: Parcours d'accompagnement