]> Raphaël G. Git Repositories - airbundle/blobdiff - Controller/SessionController.php
Version 0.6.1
[airbundle] / Controller / SessionController.php
index c755650ddd58f2f84f78e69add4935739707d820..555206552f91eca29ebb0e6a9bff7aff6fa26631 100644 (file)
@@ -33,7 +33,7 @@ class SessionController extends AbstractController {
        /**
         * List all sessions
         *
        /**
         * List all sessions
         *
-        * @desc Display all sessions with an application or login form
+        * Display all sessions with an application or login form
         *
         * @param Request $request The request instance
         *
         *
         * @param Request $request The request instance
         *
@@ -151,7 +151,7 @@ class SessionController extends AbstractController {
        /**
         * List all sessions for tango argentin
         *
        /**
         * List all sessions for tango argentin
         *
-        * @desc Display all sessions in tango argentin json format
+        * Display all sessions in tango argentin json format
         *
         * @todo Drop it if unused by tangoargentin ???
         *
         *
         * @todo Drop it if unused by tangoargentin ???
         *
@@ -192,7 +192,7 @@ class SessionController extends AbstractController {
                                'status' => in_array('canceled', $session['class'])?'annulé':'confirmé',
                                'modified' => $session['modified']->format(\DateTime::ISO8601),
                                #'organizer' => $session['application']['user']['title'],
                                'status' => in_array('canceled', $session['class'])?'annulé':'confirmé',
                                'modified' => $session['modified']->format(\DateTime::ISO8601),
                                #'organizer' => $session['application']['user']['title'],
-                               #'source' => $this->router->generate('rapsys_air_session_view', ['id' => $sessionId, 'location' => $this->translator->trans($session['l_title'])], UrlGeneratorInterface::ABSOLUTE_URL)
+                               #'source' => $this->router->generate('rapsysair_session_view', ['id' => $sessionId, 'location' => $this->translator->trans($session['l_title'])], UrlGeneratorInterface::ABSOLUTE_URL)
                                'source' => $this->router->generate($route, $routeParams, UrlGeneratorInterface::ABSOLUTE_URL)
                        ];
                }
                                'source' => $this->router->generate($route, $routeParams, UrlGeneratorInterface::ABSOLUTE_URL)
                        ];
                }
@@ -328,10 +328,21 @@ class SessionController extends AbstractController {
                }
 
                //Add map
                }
 
                //Add map
-               $this->context['map'] = $this->map->getMap($this->context['session']['location']['map'], $this->modified->getTimestamp(), $this->context['session']['location']['latitude'], $this->context['session']['location']['longitude']);
+               #$this->context['map'] = $this->map->getMap($this->context['session']['location']['map'], $this->modified->getTimestamp(), $this->context['session']['location']['latitude'], $this->context['session']['location']['longitude']);
+               $this->context['map'] = $this->image->getMap($this->context['session']['location']['latitude'], $this->context['session']['location']['longitude']) + ['caption' => $this->context['session']['location']['map']];
+
+               //Set coordinates
+               $coordinates = [];
+
+               //Iterate on each locations
+               foreach($this->context['locations'] as $location) {
+                       //Add coordinates
+                       $coordinates[] = [ $location['latitude'], $location['longitude'] ];
+               }
 
                //Add multi map
 
                //Add multi map
-               $this->context['multimap'] = $this->map->getMultiMap($this->context['session']['location']['multimap'], $this->modified->getTimestamp(), $this->context['locations']);
+               #$this->context['multimap'] = $this->map->getMultiMap($this->context['session']['location']['multimap'], $this->modified->getTimestamp(), $this->context['locations']);
+               $this->context['multimap'] = $this->image->getMulti($coordinates) + ['caption' => $this->context['session']['location']['multimap']];
 
                //Set canonical
                $this->context['canonical'] = $this->context['session']['canonical'];
 
                //Set canonical
                $this->context['canonical'] = $this->context['session']['canonical'];
@@ -410,7 +421,7 @@ class SessionController extends AbstractController {
                                ],
                                $this->context['session']['location']['at'] => [
                                        'align' => 'right',
                                ],
                                $this->context['session']['location']['at'] => [
                                        'align' => 'right',
-                                       'font' => 'labelleaurore',
+                                       'font' => 'irishgrover',
                                        'size' => 75
                                ]
                        ],
                                        'size' => 75
                                ]
                        ],
@@ -443,7 +454,7 @@ class SessionController extends AbstractController {
                        //TODO: move to named form ???
                        $sessionForm = $this->factory->create('Rapsys\AirBundle\Form\SessionType', null, [
                                //Set the action
                        //TODO: move to named form ???
                        $sessionForm = $this->factory->create('Rapsys\AirBundle\Form\SessionType', null, [
                                //Set the action
-                               'action' => $this->generateUrl('rapsys_air_session_view', ['id' => $id, 'location' => $this->context['session']['location']['slug'], 'dance' => $this->context['session']['application']['dance']['slug']??null, 'user' => $this->context['session']['application']['user']['slug']??null]),
+                               'action' => $this->generateUrl('rapsysair_session_view', ['id' => $id, 'location' => $this->context['session']['location']['slug'], 'dance' => $this->context['session']['application']['dance']['slug']??null, 'user' => $this->context['session']['application']['user']['slug']??null]),
                                //Set the form attribute
                                'attr' => [ 'class' => 'col' ],
                                //Set admin
                                //Set the form attribute
                                'attr' => [ 'class' => 'col' ],
                                //Set admin
@@ -744,7 +755,7 @@ class SessionController extends AbstractController {
                                $this->manager->flush();
 
                                //Redirect to cleanup the form
                                $this->manager->flush();
 
                                //Redirect to cleanup the form
-                               return $this->redirectToRoute('rapsys_air_session_view', ['id' => $id, 'location' => $this->context['session']['location']['slug'], 'dance' => $this->context['session']['application']['dance']['slug']??null, 'user' => $this->context['session']['application']['user']['slug']??null]);
+                               return $this->redirectToRoute('rapsysair_session_view', ['id' => $id, 'location' => $this->context['session']['location']['slug'], 'dance' => $this->context['session']['application']['dance']['slug']??null, 'user' => $this->context['session']['application']['user']['slug']??null]);
                        }
 
                        //Add form to context
                        }
 
                        //Add form to context