]> Raphaël G. Git Repositories - airbundle/commitdiff
Shorten air bundle route alias
authorRaphaël Gertz <git@rapsys.eu>
Fri, 8 Mar 2024 00:33:26 +0000 (01:33 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Fri, 8 Mar 2024 00:33:26 +0000 (01:33 +0100)
Controller/AbstractController.php
Controller/CalendarController.php
Controller/LocationController.php
Controller/SessionController.php

index d13c675fac56f26bc802614eaf4b205853e82550..73e84f63993fa7e27567493da5ebe4d1bab067fd 100644 (file)
@@ -295,7 +295,7 @@ abstract class AbstractController extends BaseAbstractController implements Serv
                                //Create ApplicationType form
                                $application = $this->factory->create('Rapsys\AirBundle\Form\ApplicationType', null, [
                                        //Set the action
                                //Create ApplicationType form
                                $application = $this->factory->create('Rapsys\AirBundle\Form\ApplicationType', null, [
                                        //Set the action
-                                       'action' => $this->generateUrl('rapsys_air_application_add'),
+                                       'action' => $this->generateUrl('rapsysair_application_add'),
                                        //Set the form attribute
                                        'attr' => [ 'class' => 'col' ],
                                        //Set dance choices
                                        //Set the form attribute
                                        'attr' => [ 'class' => 'col' ],
                                        //Set dance choices
@@ -452,7 +452,7 @@ abstract class AbstractController extends BaseAbstractController implements Serv
                //With empty locations link
                if (empty($parameters['locations_link'])) {
                        //Set locations link
                //With empty locations link
                if (empty($parameters['locations_link'])) {
                        //Set locations link
-                       $parameters['locations_link'] = $this->router->generate('rapsys_air_location');
+                       $parameters['locations_link'] = $this->router->generate('rapsysair_location');
                }
 
                //With empty locations title
                }
 
                //With empty locations title
index 3e6f65d973a59da799d33d9e6f51baa40b4fa73a..d4a9bc7d3acc3dcb3909633d6aee39e1d0d80392 100644 (file)
@@ -43,7 +43,7 @@ class CalendarController extends DefaultController {
                //Create the form according to the FormType created previously.
                //And give the proper parameters
                $form = $this->createForm('Rapsys\AirBundle\Form\CalendarType', ['calendar' => $this->config['calendar']['calendar'], 'prefix' => $this->config['calendar']['prefix']], [
                //Create the form according to the FormType created previously.
                //And give the proper parameters
                $form = $this->createForm('Rapsys\AirBundle\Form\CalendarType', ['calendar' => $this->config['calendar']['calendar'], 'prefix' => $this->config['calendar']['prefix']], [
-                       'action' => $this->generateUrl('rapsys_air_calendar'),
+                       'action' => $this->generateUrl('rapsysair_calendar'),
                        'method' => 'POST'
                ]);
 
                        'method' => 'POST'
                ]);
 
@@ -70,7 +70,7 @@ class CalendarController extends DefaultController {
                                                'application_name' => $data['project'],
                                                'client_id' => $data['client'],
                                                'client_secret' => $data['secret'],
                                                'application_name' => $data['project'],
                                                'client_id' => $data['client'],
                                                'client_secret' => $data['secret'],
-                                               'redirect_uri' => $redirect = $this->generateUrl('rapsys_air_calendar_callback', [], UrlGeneratorInterface::ABSOLUTE_URL),
+                                               'redirect_uri' => $redirect = $this->generateUrl('rapsysair_calendar_callback', [], UrlGeneratorInterface::ABSOLUTE_URL),
                                                'scopes' => [Calendar::CALENDAR, Calendar::CALENDAR_EVENTS],
                                                'access_type' => 'offline',
                                                'approval_prompt' => 'force'
                                                'scopes' => [Calendar::CALENDAR, Calendar::CALENDAR_EVENTS],
                                                'access_type' => 'offline',
                                                'approval_prompt' => 'force'
@@ -93,7 +93,7 @@ class CalendarController extends DefaultController {
 #                              $googleClient->addScope(Calendar::CALENDAR_EVENTS);
 #
 #                              //Set redirect uri
 #                              $googleClient->addScope(Calendar::CALENDAR_EVENTS);
 #
 #                              //Set redirect uri
-#                              $googleClient->setRedirectUri($redirect = $this->generateUrl('rapsys_air_calendar_callback', [], UrlGeneratorInterface::ABSOLUTE_URL));
+#                              $googleClient->setRedirectUri($redirect = $this->generateUrl('rapsysair_calendar_callback', [], UrlGeneratorInterface::ABSOLUTE_URL));
 #
 #                              //Set offline access
 #                              $googleClient->setAccessType('offline');
 #
 #                              //Set offline access
 #                              $googleClient->setAccessType('offline');
index 51f1b0b059068f859132458aa2d1016e2b4da4ca..46d81019e281bc2238323327f588028936252389 100644 (file)
@@ -329,7 +329,7 @@ class LocationController extends DefaultController {
                                        $this->addFlash('notice', $this->translator->trans('Location %id% updated', ['%id%' => $location['id']]));
 
                                        //Redirect to cleanup the form
                                        $this->addFlash('notice', $this->translator->trans('Location %id% updated', ['%id%' => $location['id']]));
 
                                        //Redirect to cleanup the form
-                                       return $this->redirectToRoute('rapsys_air_location', ['location' => $location['id']]);
+                                       return $this->redirectToRoute('rapsysair_location', ['location' => $location['id']]);
                                }
 
                                //Add form to context
                                }
 
                                //Add form to context
@@ -366,7 +366,7 @@ class LocationController extends DefaultController {
                                $this->addFlash('notice', $this->translator->trans('Location created'));
 
                                //Redirect to cleanup the form
                                $this->addFlash('notice', $this->translator->trans('Location created'));
 
                                //Redirect to cleanup the form
-                               return $this->redirectToRoute('rapsys_air_location', ['location' => $data->getId()]);
+                               return $this->redirectToRoute('rapsysair_location', ['location' => $data->getId()]);
                        }
 
                        //Add form to context
                        }
 
                        //Add form to context
@@ -400,7 +400,7 @@ class LocationController extends DefaultController {
                //With invalid slug
                if ($location !== $this->context['location']['slug']) {
                        //Redirect on correctly spelled location
                //With invalid slug
                if ($location !== $this->context['location']['slug']) {
                        //Redirect on correctly spelled location
-                       return $this->redirectToRoute('rapsys_air_location_view', ['id' => $this->context['location']['id'], 'location' => $this->context['location']['slug']], Response::HTTP_MOVED_PERMANENTLY);
+                       return $this->redirectToRoute('rapsysair_location_view', ['id' => $this->context['location']['id'], 'location' => $this->context['location']['slug']], Response::HTTP_MOVED_PERMANENTLY);
                }
 
                //Fetch calendar
                }
 
                //Fetch calendar
@@ -426,7 +426,7 @@ class LocationController extends DefaultController {
 
                //Set modified
                //XXX: dance modified is already computed inside calendar modified
 
                //Set modified
                //XXX: dance modified is already computed inside calendar modified
-               $this->modified = max(array_merge([$this->context['location']['updated']], array_map(function ($v) { return $v['modified']; }, array_merge($this->context['calendar'], $this->context['locations']))));
+               $this->modified = max(array_merge([$this->context['location']['modified']], array_map(function ($v) { return $v['modified']; }, array_merge($this->context['calendar'], $this->context['locations']))));
 
                //Create response
                $response = new Response();
 
                //Create response
                $response = new Response();
index c755650ddd58f2f84f78e69add4935739707d820..b25b19a644d929abb7ecf2eeb9119fa1ecfc3407 100644 (file)
@@ -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)
                        ];
                }
@@ -443,7 +443,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 +744,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