diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index f1005d696..45a43897d 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -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', diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php index c476a899f..f6d93bc42 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -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, diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig index 31db795be..20f944595 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig @@ -6,6 +6,7 @@