From 1c19d01b60f189c01a51a7082492d0ee4805c913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 5 Apr 2023 20:23:43 +0200 Subject: [PATCH] Fixed: [calendar doc] Add a return path to the calendar edit's form when the document has been generated Fix https://gitlab.com/Chill-Projet/chill-bundles/-/issues/81 --- .../ChillCalendarBundle/Controller/CalendarController.php | 6 +++++- .../views/CalendarDoc/new_accompanying_period.html.twig | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 199edf0c2..e97daae3f 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -207,6 +207,7 @@ class CalendarController extends AbstractController 'entityClassName' => Calendar::class, 'entityId' => $entity->getId(), 'template' => $template->getId(), + 'returnPath' => $request->getRequestUri(), ]); } } @@ -377,7 +378,9 @@ class CalendarController extends AbstractController $this->addFlash('success', $this->translator->trans('Success : calendar item created!')); if ($form->get('save_and_upload_doc')->isClicked()) { - return $this->redirectToRoute('chill_calendar_calendardoc_new', ['id' => $entity->getId()]); + return $this->redirectToRoute('chill_calendar_calendardoc_new', [ + 'id' => $entity->getId() + ]); } foreach ($templates as $template) { @@ -386,6 +389,7 @@ class CalendarController extends AbstractController 'entityClassName' => Calendar::class, 'entityId' => $entity->getId(), 'template' => $template->getId(), + 'returnPath' => $this->generateUrl('chill_calendar_calendar_edit', ['id' => $entity->getId()]), ]); } } diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/new_accompanying_period.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/new_accompanying_period.html.twig index d397a9132..54f196622 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/new_accompanying_period.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/new_accompanying_period.html.twig @@ -28,7 +28,7 @@