From: Raphaƫl Gertz Date: Sun, 29 Nov 2020 06:08:40 +0000 (+0100) Subject: Add translated location fetch X-Git-Tag: 0.1.4~16 X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/commitdiff_plain/ac22a144e7b89ff5334bb5e5a1894738affbac65?ds=inline;hp=558e8fc52bb6403cdeea8b45c9767a6678ca8905 Add translated location fetch Display only attributed session when not authenticated --- diff --git a/Controller/SessionController.php b/Controller/SessionController.php index 8db10c6..183ac97 100644 --- a/Controller/SessionController.php +++ b/Controller/SessionController.php @@ -75,10 +75,11 @@ class SessionController extends DefaultController { //Fetch calendar //TODO: highlight with current session route parameter - $calendar = $doctrine->getRepository(Session::class)->fetchCalendarByDatePeriod($this->translator, $period, null, $request->get('session')); + $calendar = $doctrine->getRepository(Session::class)->fetchCalendarByDatePeriod($this->translator, $period, null, $request->get('session'), !$this->isGranted('IS_AUTHENTICATED_REMEMBERED')); //Fetch locations - $locations = $doctrine->getRepository(Location::class)->fetchTranslatedLocationByDatePeriod($this->translator, $period); + //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/session/index.html.twig', ['title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$context+$this->context);