]> Raphaël G. Git Repositories - airbundle/commitdiff
Remove disputed form
authorRaphaël Gertz <git@rapsys.eu>
Thu, 1 Feb 2024 04:00:02 +0000 (05:00 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 1 Feb 2024 04:00:02 +0000 (05:00 +0100)
Controller/DefaultController.php
Resources/config/routes/rapsys_air.yaml
Resources/translations/messages.en_gb.yaml
Resources/translations/messages.fr_fr.yaml

index cfe5f58b73277da138cb78103ba9ca8889ec24ac..0cdea2e11d6616066f4da95fc148a7e4b77ae2db 100644 (file)
@@ -28,7 +28,6 @@ use Rapsys\AirBundle\Entity\Location;
 use Rapsys\AirBundle\Entity\Session;
 use Rapsys\AirBundle\Entity\Snippet;
 use Rapsys\AirBundle\Entity\User;
-use Rapsys\AirBundle\Pdf\DisputePdf;
 
 /**
  * {@inheritdoc}
@@ -163,127 +162,6 @@ class DefaultController extends AbstractController {
                return $this->render('@RapsysAir/form/contact.html.twig', ['form' => $form->createView(), 'sent' => $request->query->get('sent', 0)]+$this->context);
        }
 
-       /**
-        * The dispute page
-        *
-        * @desc Generate a dispute document
-        *
-        * @param Request $request The request instance
-        *
-        * @return Response The rendered view or redirection
-        */
-       public function dispute(Request $request): Response {
-               //Prevent non-guest to access here
-               $this->denyAccessUnlessGranted('ROLE_USER', null, $this->translator->trans('Unable to access this page without role %role%!', ['%role%' => $this->translator->trans('User')]));
-
-               //Set page
-               $this->context['title'] = $this->translator->trans('Dispute');
-
-               //Set description
-               $this->context['description'] = $this->translator->trans('Libre Air dispute');
-
-               //Set keywords
-               $this->context['keywords'] = [
-                       $this->translator->trans('dispute'),
-                       $this->translator->trans('Libre Air'),
-                       $this->translator->trans('outdoor'),
-                       $this->translator->trans('Argentine Tango'),
-                       $this->translator->trans('calendar')
-               ];
-
-               //Create the form according to the FormType created previously.
-               //And give the proper parameters
-               $form = $this->createForm('Rapsys\AirBundle\Form\DisputeType', ['court' => 'Paris', 'abstract' => 'Pour constater cette prétendue infraction, les agents verbalisateurs ont pénétré dans un jardin privatif, sans visibilité depuis la voie publique, situé derrière un batiment privé, pour ce faire ils ont franchi au moins un grillage de chantier ou des potteaux métalliques séparant le terrain privé de la voie publique de l\'autre côté du batiment.'], [
-                       'action' => $this->generateUrl('rapsys_air_dispute'),
-                       'method' => 'POST'
-               ]);
-
-               if ($request->isMethod('POST')) {
-                       // Refill the fields in case the form is not valid.
-                       $form->handleRequest($request);
-
-                       if ($form->isValid()) {
-                               //Get data
-                               $data = $form->getData();
-
-                               //Gathering offense
-                               if (!empty($data['offense']) && $data['offense'] == 'gathering') {
-                                       //Add gathering
-                                       $output = DisputePdf::genGathering($data['court'], $data['notice'], $data['agent'], $data['service'], $data['abstract'], $this->translator->trans($this->getUser()->getCivility()->getTitle()), $this->getUser()->getForename(), $this->getUser()->getSurname());
-                               //Traffic offense
-                               } elseif (!empty($data['offense'] && $data['offense'] == 'traffic')) {
-                                       //Add traffic
-                                       $output = DisputePdf::genTraffic($data['court'], $data['notice'], $data['agent'], $data['service'], $data['abstract'], $this->translator->trans($this->getUser()->getCivility()->getTitle()), $this->getUser()->getForename(), $this->getUser()->getSurname());
-                               //Unsupported offense
-                               } else {
-                                       header('Content-Type: text/plain');
-                                       die('TODO');
-                                       exit;
-                               }
-
-                               //Send common headers
-                               header('Content-Type: application/pdf');
-
-                               //Send remaining headers
-                               header('Cache-Control: private, max-age=0, must-revalidate');
-                               header('Pragma: public');
-
-                               //Send content-length
-                               header('Content-Length: '.strlen($output));
-
-                               //Display the pdf
-                               echo $output;
-
-                               //Die for now
-                               exit;
-
-#                              //Create message
-#                              $message = (new TemplatedEmail())
-#                                      //Set sender
-#                                      ->from(new Address($data['mail'], $data['name']))
-#                                      //Set recipient
-#                                      //XXX: remove the debug set in vendor/symfony/mime/Address.php +46
-#                                      ->to(new Address($this->config['contact']['mail'], $this->config['contact']['title']))
-#                                      //Set subject
-#                                      ->subject($data['subject'])
-#
-#                                      //Set path to twig templates
-#                                      ->htmlTemplate('@RapsysAir/mail/contact.html.twig')
-#                                      ->textTemplate('@RapsysAir/mail/contact.text.twig')
-#
-#                                      //Set context
-#                                      ->context(
-#                                              [
-#                                                      'subject' => $data['subject'],
-#                                                      'message' => strip_tags($data['message']),
-#                                              ]+$this->context
-#                                      );
-#
-#                              //Try sending message
-#                              //XXX: mail delivery may silently fail
-#                              try {
-#                                      //Send message
-#                                      $this->mailer->send($message);
-#
-#                                      //Redirect on the same route with sent=1 to cleanup form
-#                                      return $this->redirectToRoute($request->get('_route'), ['sent' => 1]+$request->get('_route_params'));
-#                              //Catch obvious transport exception
-#                              } catch(TransportExceptionInterface $e) {
-#                                      if ($message = $e->getMessage()) {
-#                                              //Add error message mail unreachable
-#                                              $form->get('mail')->addError(new FormError($this->translator->trans('Unable to contact: %mail%: %message%', ['%mail%' => $this->config['contact']['mail'], '%message%' => $this->translator->trans($message)])));
-#                                      } else {
-#                                              //Add error message mail unreachable
-#                                              $form->get('mail')->addError(new FormError($this->translator->trans('Unable to contact: %mail%', ['%mail%' => $this->config['contact']['mail']])));
-#                                      }
-#                              }
-                       }
-               }
-
-               //Render template
-               return $this->render('@RapsysAir/default/dispute.html.twig', ['form' => $form->createView(), 'sent' => $request->query->get('sent', 0)]+$this->context);
-       }
-
        /**
         * The index page
         *
index ca01a8c76afe0ec759106dbd7197569079870791..ec209fdcdd09d2e97164ce3cf5e39775539193dc 100644 (file)
@@ -93,13 +93,6 @@ rapsys_air_terms_of_service:
     controller: Rapsys\AirBundle\Controller\DefaultController::termsOfService
     methods: GET
 
-rapsys_air_dispute:
-    path:
-        en_gb: '/en/dispute'
-        fr_fr: '/contestation'
-    controller: Rapsys\AirBundle\Controller\DefaultController::dispute
-    methods: GET|POST
-
 rapsys_air_location:
     path:
         en_gb: '/en/location'
index 79442a99c07ef1e36e9aeae7238f45a25517cac3..6d0010979863c5a053308e96500e3c569cf56bfa 100644 (file)
 'Date': 'Date'
 'Delete': 'Delete'
 'Description': 'Description'
-'dispute': 'dispute'
-'Dispute': 'Dispute'
 'Docks': 'Docks'
 'Donate': 'Donate'
 'Donate on %title% to help us fund our mission.': 'Donate on %title% to help us fund our mission.'
 'Libre Air cities miniature': 'Libre Air cities miniature'
 'Libre Air cities sector map': 'Libre Air cities sector map'
 'Libre Air city list': 'Libre Air city list'
-'Libre Air dispute': 'Libre Air dispute'
 'Libre Air frequently asked questions': 'Libre Air frequently asked questions'
 'Libre Air is an initiative to have a powerful and shared calendar for outdoor Argentine Tango sessions.': 'Libre Air is an initiative to have a powerful and shared calendar for outdoor Argentine Tango sessions.'
 'Libre Air': 'Libre Air'
index 39200ad849edf5b761937ac1ec164fe7ca51d78f..7f0dd14d3848cd700fc67b9f6a49fac3626b835a 100644 (file)
 'Date': 'Date'
 'Delete': 'Supprimer'
 'Description': 'Description'
-'dispute': 'contestation'
-'Dispute': 'Contestation'
 'Docks': 'Quais'
 'Donate': 'Contribuer'
 'Donate on %title% to help us fund our mission.': 'Faites un don sur %title% pour nous aider à financer notre activité.'
 'Libre Air cities sector map': 'Carte du secteur des villes d''Air Libre'
 'Libre Air cities': 'Villes d''Air Libre'
 'Libre Air city list': 'Liste des villes d''Air Libre'
-'Libre Air dispute': 'Contestation Air Libre'
 'Libre Air frequently asked questions': 'Foire aux questions d''Air Libre'
 'Libre Air is an initiative to have a powerful and shared calendar for outdoor Argentine Tango sessions.': 'Air Libre est une initiative pour avoir un calendrier puissant et partagé pour les sessions de Tango Argentin en plein air.'
 'Libre Air location list %city%': 'Liste des emplacements d''Air Libre %city%'