mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
admin: adapt social work form type and templates
This commit is contained in:
@@ -15,6 +15,7 @@ use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@@ -52,6 +53,15 @@ class GoalType extends AbstractType
|
||||
},
|
||||
])
|
||||
|
||||
->add('results', EntityType::class, [
|
||||
'class' => Result::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'choice_label' => function (Result $r) {
|
||||
return $this->translatableStringHelper->localize($r->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('desactivationDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => 'goal.desactivationDate',
|
||||
|
@@ -15,6 +15,9 @@ use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\DateIntervalType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
@@ -57,6 +60,34 @@ class SocialActionType extends AbstractType
|
||||
return $this->translatableStringHelper->localize($issue->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('results', EntityType::class, [
|
||||
'class' => Result::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'choice_label' => function (Result $r) {
|
||||
return $this->translatableStringHelper->localize($r->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('goals', EntityType::class, [
|
||||
'class' => Goal::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'choice_label' => function (Goal $g) {
|
||||
return $this->translatableStringHelper->localize($g->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('evaluations', EntityType::class, [
|
||||
'class' => Evaluation::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'choice_label' => function (Evaluation $e) {
|
||||
return $this->translatableStringHelper->localize($e->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('defaultNotificationDelay', DateIntervalType::class, [
|
||||
'label' => 'socialAction.defaultNotificationDelay',
|
||||
'required' => false,
|
||||
|
Reference in New Issue
Block a user