src/Controller/DefaultController.php line 27

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * docustack
  5.  *
  6.  * @copyright  Copyright (c) 2014-2022, 47GradNord - Agentur für Internetlösungen
  7.  * @author     Holger Neuner <neuner@47gradnord.de>
  8.  */
  9. namespace App\Controller;
  10. use App\Entity\DocumentationProject;
  11. use App\Entity\ProtocolProject;
  12. use App\Service\ProtocolPdfTemplateManager;
  13. use Symfony\Component\HttpFoundation\Request;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\Routing\Annotation\Route;
  16. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  17. class DefaultController extends AbstractAppController
  18. {
  19.     /**
  20.      * @Route("/", name="index", methods={"GET"} )
  21.      */
  22.     public function index(Request $requestAuthenticationUtils $authenticationUtils): Response
  23.     {
  24.         // get the login error if there is one
  25.         $error $authenticationUtils->getLastAuthenticationError();
  26.         // last username entered by the user
  27.         $lastUsername $authenticationUtils->getLastUsername();
  28.         return $this->render('security/login.html.twig', ['last_username' => $lastUsername'error' => $error]);
  29.     }
  30.     /**
  31.      * @Route("/printProjectResourceList/{id<\d+>}", name="app_printProjectResourceList", methods={"GET"} )
  32.      */
  33.     public function printProjectResourceList(Request $requestDocumentationProject $project): Response
  34.     {
  35.         return $this->render('app/documentation/projectview/print-projectresource-list-html.twig', [
  36.             'project' => $project,
  37.         ]);
  38.     }
  39.     /**
  40.      * @Route("/printProtocolResourceList/{id<\d+>}", name="app_printProtocolResourceList", methods={"GET"} )
  41.      */
  42.     public function printProtocolResourceList(Request $requestProtocolProject $protocolProjectProtocolPdfTemplateManager $pdfTemplateManager): Response
  43.     {
  44.         $pdfTemplateManager->setProtocolProject($protocolProject);
  45.         return $this->render('app/protocol/projectview/print-protocolresource-list.html.twig', [
  46.             'project' => $protocolProject,
  47.             'parts' => $pdfTemplateManager->createParts(true),
  48.             'prioritiesInUse' => $pdfTemplateManager->getPrioritiesInUse(),
  49.         ]);
  50.     }
  51. }