diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 0f725c2b3..ae7cdfa59 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -105,18 +105,19 @@ final class ActivityController extends AbstractController [$person, $accompanyingPeriod] = $this->getEntity($request); - if ($accompanyingPeriod instanceof AccompanyingPeriod) { - $view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig'; - } elseif ($person instanceof Person) { - $view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig'; - } - $activity = $this->activityRepository->find($id); if (!$activity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) { + $view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig'; + $accompanyingPeriod = $activity->getAccompanyingPeriod(); + } else { + $view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig'; + } + // TODO // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity); @@ -176,18 +177,18 @@ final class ActivityController extends AbstractController [$person, $accompanyingPeriod] = $this->getEntity($request); - if ($accompanyingPeriod instanceof AccompanyingPeriod) { - $view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig'; - } elseif ($person instanceof Person) { - $view = 'ChillActivityBundle:Activity:editPerson.html.twig'; - } - $entity = $this->activityRepository->find($id); if (null === $entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) { + $view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig'; + $accompanyingPeriod = $entity->getAccompanyingPeriod(); + } else { + $view = 'ChillActivityBundle:Activity:editPerson.html.twig'; + } // TODO // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index e9782b8e1..a1fc44196 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -27,7 +27,7 @@
{{ 'Any social issues'|trans }}
+{{ 'No social issues associated'|trans }}
{% else %} {% for si in entity.socialIssues %}{{ si|chill_entity_render_box }}{% endfor %} {% endif %} @@ -38,7 +38,7 @@{{ 'Any social actions'|trans }}
+{{ 'No social actions associated'|trans }}
{% else %} {% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %} {% endif %} diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 959eee233..098a6f6df 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -43,6 +43,7 @@ Sent: Envoyer Received: Recevoir by: 'Par ' location: Lieu +Reasons: Sujets #forms