From: Raphaƫl Gertz Date: Sun, 29 Nov 2020 06:11:25 +0000 (+0100) Subject: Add translated location fetch X-Git-Tag: 0.1.4~15 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/248a1dc7d01e44d86252e058f124d3399a46967e?hp=ac22a144e7b89ff5334bb5e5a1894738affbac65 Add translated location fetch Display only attributed session when not authenticated --- diff --git a/Controller/LocationController.php b/Controller/LocationController.php index bf5f62d..0f47a99 100644 --- a/Controller/LocationController.php +++ b/Controller/LocationController.php @@ -78,9 +78,13 @@ class LocationController extends DefaultController { ); //Fetch calendar - $calendar = $doctrine->getRepository(Session::class)->fetchCalendarByDatePeriod($this->translator, $period, $id, $request->get('session')); + $calendar = $doctrine->getRepository(Session::class)->fetchCalendarByDatePeriod($this->translator, $period, $id, $request->get('session'), !$this->isGranted('IS_AUTHENTICATED_REMEMBERED')); + + //Fetch locations + //XXX: we want to display all active locations anyway + $locations = $doctrine->getRepository(Location::class)->fetchTranslatedLocationByDatePeriod($this->translator, $period/*, !$this->isGranted('IS_AUTHENTICATED_REMEMBERED')*/); //Render the view - return $this->render('@RapsysAir/location/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar]+$context+$this->context); + return $this->render('@RapsysAir/location/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$context+$this->context); } }