From 543d30acb9943c2c3c692be21fb0f472b0459378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 6 Jun 2022 17:11:43 +0200 Subject: [PATCH] display of calendar form --- .../Controller/CalendarController.php | 4 +- .../ChillCalendarBundle/Entity/Calendar.php | 5 +- .../Resources/public/vuejs/Calendar/App.vue | 53 ++++++++++++++----- .../Calendar/Components/CalendarActive.vue | 18 +++++-- .../public/vuejs/Calendar/store/getters.js | 3 -- .../public/vuejs/Calendar/store/index.js | 4 +- .../public/vuejs/Calendar/store/utils.js | 2 +- .../Resources/views/Calendar/edit.html.twig | 7 ++- .../editByAccompanyingCourse.html.twig | 4 -- .../newByAccompanyingCourse.html.twig | 4 -- .../public/vuejs/PickEntity/PickEntity.vue | 7 ++- .../public/vuejs/i18n/datetimeFormats.js | 5 ++ 12 files changed, 79 insertions(+), 37 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index da8aa687e..78f134935 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -168,7 +168,7 @@ class CalendarController extends AbstractController $params = $this->buildParamsToUrl($user, $accompanyingPeriod); - return $this->redirectToRoute('chill_calendar_calendar_list', $params); + return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params); } if ($form->isSubmitted() && !$form->isValid()) { @@ -403,7 +403,7 @@ class CalendarController extends AbstractController } if (null !== $accompanyingPeriod) { - $params['accompanying_period_id'] = $accompanyingPeriod->getId(); + $params['id'] = $accompanyingPeriod->getId(); } return $params; diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 89f1c25b7..99b0d6cc7 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -486,7 +486,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface } $this->calendarRange = $calendarRange; - $this->calendarRange->setCalendar($this); + + if ($this->calendarRange instanceof CalendarRange) { + $this->calendarRange->setCalendar($this); + } return $this; } diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue index dcf7f7450..2a3ea19de 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue @@ -1,17 +1,20 @@