From: Raphaël Gertz Date: Fri, 8 Mar 2024 00:33:26 +0000 (+0100) Subject: Shorten air bundle route alias X-Git-Tag: 0.4.0~18 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/b55b7f6127d518d2894508ba1837b71364c1768b?hp=ca4cd083c302be4c5a1b50de9d3dcd70cf20b1d8 Shorten air bundle route alias --- diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index d13c675..73e84f6 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -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 - 'action' => $this->generateUrl('rapsys_air_application_add'), + 'action' => $this->generateUrl('rapsysair_application_add'), //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 - $parameters['locations_link'] = $this->router->generate('rapsys_air_location'); + $parameters['locations_link'] = $this->router->generate('rapsysair_location'); } //With empty locations title diff --git a/Controller/CalendarController.php b/Controller/CalendarController.php index 3e6f65d..d4a9bc7 100644 --- a/Controller/CalendarController.php +++ b/Controller/CalendarController.php @@ -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']], [ - 'action' => $this->generateUrl('rapsys_air_calendar'), + 'action' => $this->generateUrl('rapsysair_calendar'), 'method' => 'POST' ]); @@ -70,7 +70,7 @@ class CalendarController extends DefaultController { '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' @@ -93,7 +93,7 @@ class CalendarController extends DefaultController { # $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'); diff --git a/Controller/LocationController.php b/Controller/LocationController.php index 51f1b0b..46d8101 100644 --- a/Controller/LocationController.php +++ b/Controller/LocationController.php @@ -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 - return $this->redirectToRoute('rapsys_air_location', ['location' => $location['id']]); + return $this->redirectToRoute('rapsysair_location', ['location' => $location['id']]); } //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 - return $this->redirectToRoute('rapsys_air_location', ['location' => $data->getId()]); + return $this->redirectToRoute('rapsysair_location', ['location' => $data->getId()]); } //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 - 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 @@ -426,7 +426,7 @@ class LocationController extends DefaultController { //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(); diff --git a/Controller/SessionController.php b/Controller/SessionController.php index c755650..b25b19a 100644 --- a/Controller/SessionController.php +++ b/Controller/SessionController.php @@ -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'], - #'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) ]; } @@ -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 - '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 @@ -744,7 +744,7 @@ class SessionController extends AbstractController { $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