diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 4bde0e6f9..fe090962a 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -190,14 +190,15 @@ class CalendarController extends AbstractController throw $this->createNotFoundException('Template not found'); } - // $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']); - + $entity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']); + dump($entity_array); + return $this->render($view, [ 'user' => $user, 'accompanyingCourse' => $accompanyingPeriod, 'entity' => $entity, 'form' => $form->createView(), - //'activity_json' => $calendar_array + 'entity_json' => $entity_array ]); } diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js index 82d7799a1..1eff54f8a 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js @@ -17,19 +17,19 @@ const removeIdFromValue = (string, id) => { return str; }; -const activity = { - accompanyingPeriod: null, - persons: [], - thirdParties: [], - users: [], - //professionals: [], - //invites: [] -}; // TODO: get this object from window.activity ? +// const activity = { +// accompanyingPeriod: window.accompanyingPeriod, +// persons: [], +// thirdParties: [], +// users: [] +// }; // TODO: get this object from window.activity ? + +console.log(window.entity) const store = createStore({ strict: debug, state: { - activity: activity, + activity: window.entity, }, mutations: { diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/newAccompanyingCourse.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/newAccompanyingCourse.html.twig index 7d1d27d4c..76f4583ed 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/newAccompanyingCourse.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/newAccompanyingCourse.html.twig @@ -25,6 +25,7 @@ chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}'); }); + window.entity = {{ entity_json|json_encode|raw }}; {{ encore_entry_script_tags('vue_calendar') }} {% endblock %}