diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index efd8c93af..3e5889cb0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -56,34 +56,36 @@ class SocialWorkTypeFilter implements FilterInterface 'expanded' => true ]); + /* $refreshGoals = function (FormInterface $form, SocialAction $actionType = null) { $goals = null === $actionType ? [] : $actionType->getGoals(); $form->add('goal', ChoiceType::class, [ - 'placeholder' => '', - 'choices' => $goals, - 'choice_label' => function (Goal $g) { - return $this->translatableStringHelper->localize($g->getTitle()); - }, - ]); + 'placeholder' => '', + 'choices' => $goals, + 'choice_label' => function (Goal $g) { + return $this->translatableStringHelper->localize($g->getTitle()); + }, + ]); }; $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($refreshGoals) { - $data = $event->getData(); - dump($data); + $data = $event->getData(); + dump($data); - $refreshGoals($event->getForm(), $data); - }); + $refreshGoals($event->getForm(), $data); + }); -/* $builder->get('actionType')->addEventListener( + $builder->get('actionType')->addEventListener( FormEvents::POST_SUBMIT, function (FormEvent $event) use ($refreshGoals) { $actionType = $event->getForm()->getData(); dump($actionType); $refreshGoals($event->getForm()->getParent(), $actionType); } - );*/ + ); + */ } public function getTitle(): string