From 558e8fc52bb6403cdeea8b45c9767a6678ca8905 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sun, 29 Nov 2020 07:07:05 +0100 Subject: [PATCH 1/1] Add translated location fetch --- Controller/UserController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Controller/UserController.php b/Controller/UserController.php index 223b463..37ee540 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -6,6 +6,7 @@ use Symfony\Component\HttpFoundation\Request; use Rapsys\AirBundle\Entity\Slot; use Rapsys\AirBundle\Entity\Session; +use Rapsys\AirBundle\Entity\Location; use Rapsys\AirBundle\Entity\User; class UserController extends DefaultController { @@ -82,7 +83,11 @@ class UserController extends DefaultController { //TODO: highlight with current session route parameter $calendar = $doctrine->getRepository(Session::class)->fetchUserCalendarByDatePeriod($this->translator, $period, $id, $request->get('session')); + //Fetch locations + //XXX: we want to display all active locations anyway + $locations = $doctrine->getRepository(Location::class)->fetchTranslatedUserLocationByDatePeriod($this->translator, $period, $id); + //Render the view - return $this->render('@RapsysAir/user/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar]+$context+$this->context); + return $this->render('@RapsysAir/user/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$context+$this->context); } } -- 2.41.1