mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
disable/comment buildForm in SocialWorkType Filter
This commit is contained in:
parent
374ad43df6
commit
c4f0ad01d3
@ -56,34 +56,36 @@ class SocialWorkTypeFilter implements FilterInterface
|
|||||||
'expanded' => true
|
'expanded' => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/*
|
||||||
$refreshGoals = function (FormInterface $form, SocialAction $actionType = null) {
|
$refreshGoals = function (FormInterface $form, SocialAction $actionType = null) {
|
||||||
|
|
||||||
$goals = null === $actionType ? [] : $actionType->getGoals();
|
$goals = null === $actionType ? [] : $actionType->getGoals();
|
||||||
|
|
||||||
$form->add('goal', ChoiceType::class, [
|
$form->add('goal', ChoiceType::class, [
|
||||||
'placeholder' => '',
|
'placeholder' => '',
|
||||||
'choices' => $goals,
|
'choices' => $goals,
|
||||||
'choice_label' => function (Goal $g) {
|
'choice_label' => function (Goal $g) {
|
||||||
return $this->translatableStringHelper->localize($g->getTitle());
|
return $this->translatableStringHelper->localize($g->getTitle());
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($refreshGoals) {
|
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($refreshGoals) {
|
||||||
$data = $event->getData();
|
$data = $event->getData();
|
||||||
dump($data);
|
dump($data);
|
||||||
|
|
||||||
$refreshGoals($event->getForm(), $data);
|
$refreshGoals($event->getForm(), $data);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* $builder->get('actionType')->addEventListener(
|
$builder->get('actionType')->addEventListener(
|
||||||
FormEvents::POST_SUBMIT,
|
FormEvents::POST_SUBMIT,
|
||||||
function (FormEvent $event) use ($refreshGoals) {
|
function (FormEvent $event) use ($refreshGoals) {
|
||||||
$actionType = $event->getForm()->getData();
|
$actionType = $event->getForm()->getData();
|
||||||
dump($actionType);
|
dump($actionType);
|
||||||
$refreshGoals($event->getForm()->getParent(), $actionType);
|
$refreshGoals($event->getForm()->getParent(), $actionType);
|
||||||
}
|
}
|
||||||
);*/
|
);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user