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 @@ {{ 'Id'|trans }} {{ 'Title'|trans }} {{ 'Social actions'|trans }} + {{ 'goal.results'|trans }} {{ 'goal.desactivationDate'|trans }}   {% endblock %} @@ -21,6 +22,11 @@ {% endfor %} + {% for sa in entity.results %} + {{ sa.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} + + {% if entity.desactivationDate is not null %} {{ entity.desactivationDate|date('Y-m-d') }} {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/edit.html.twig index ffad69128..49d6635df 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/edit.html.twig @@ -9,7 +9,7 @@ {% block crud_content_form_rows %} {% for f in form %} - {% if f.vars.name == 'parent' %} + {% if f.vars.name == 'parent' or f.vars.name == 'issue' %} {{ form_row(f, { 'attr':{'disabled':'disabled'}}) }} {% else %} {{ form_row(f) }} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig index acfce6ee6..e2e21fca8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig @@ -6,6 +6,10 @@ {{ 'Id'|trans }} {{ 'Title'|trans }} {{ 'Parent'|trans }} + {{ 'Social issue'|trans }} + {{ 'Results'|trans }} + {{ 'Goals'|trans }} + {{ 'Evaluations'|trans }} {{ 'goal.desactivationDate'|trans }} {{ 'socialAction.defaultNotificationDelay'|trans }}   @@ -22,6 +26,26 @@ {% endif %} + {% for e in entity.issue %} + {{ e.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} + + + {% for e in entity.results %} + {{ e.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} + + + {% for e in entity.goals %} + {{ e.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} + + + {% for e in entity.evaluations %} + {{ e.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} + + {% if entity.desactivationDate is not null %} {{ entity.desactivationDate|date('Y-m-d') }} {% endif %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 0ec2d7275..e95960248 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -443,6 +443,7 @@ evaluation: goal: desactivationDate: Date de désactivation + results: Résultats socialAction: defaultNotificationDelay: Délai de notification par défaut