Deprecated: Constant E_STRICT is deprecated in /home/normanv/www/annuairepro/vendor/symfony/error-handler/ErrorHandler.php on line 58
Deprecated: Constant E_STRICT is deprecated in /home/normanv/www/annuairepro/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler
<?php
namespace App\Controller;
use App\Entity\PrestataireLogistique;
use App\Entity\PrestataireTechnique;
use App\Entity\ProductionCineAudio;
use App\Entity\ProductionCom;
use App\Entity\User;
use App\Form\FicheType;
use App\Form\SearchCatalogueType;
use App\Repository\PrestataireLogistiqueRepository;
use App\Repository\PrestataireTechniqueRepository;
use App\Repository\ProductionCineAudioRepository;
use App\Repository\ProductionComRepository;
use App\Repository\UserRepository;
use App\Service\GenerePdf;
use App\Service\GenerePdfActivites;
use App\Service\GenerePdfListe;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
class CatalogueController extends AbstractController
{
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
/**
* @Route("/catalogue", name="catalogue_index")
*/
public function index(Request $request)
{
$users = $this->entityManager->getRepository(User::class)->findPublie();
$prestatairestechniques = $this->entityManager->getRepository(PrestataireTechnique::class)->findPublie();
$prestatairesservices = $this->entityManager->getRepository(PrestataireLogistique::class)->findPublie();
$productionscineaudio = $this->entityManager->getRepository(ProductionCineAudio::class)->findPublie();
$productionscom = $this->entityManager->getRepository(ProductionCom::class)->findPublie();
$form = $this->createForm(SearchCatalogueType::class, $users);
$form->handleRequest($request);
return $this->render('catalogue/catalogue.html.twig', [
'form' => $form->createView(),
'users' => $users,
'prestatairestechniques' => $prestatairestechniques,
'prestatairesservices' => $prestatairesservices,
'productionscineaudio' => $productionscineaudio,
'productionscom' => $productionscom,
]);
}
/**
* @Route("/catalogue/fiche/{id}/{type}", name="catalogue_fiche")
*/
public function fiche($id, $type, Request $request)
{
$user = $this->entityManager->getRepository(User::class)->findOneById($id);
$form = $this->createForm(FicheType::class, $user);
$form->handleRequest($request);
return $this->render('catalogue/fiche.html.twig', [
'form' => $form->createView(),
'user' => $user,
'type' => $type,
]);
}
/**
* @Route("/catalogue/pdf/{id}/{type}", name="catalogue_pdf")
*/
public function pdf($id, $type, GenerePdf $generePdf)
{
$user = $this->entityManager->getRepository(User::class)->findOneById($id);
$date = new \DateTime();
$generePdf->getPdf($user,$type);
return $this->render('catalogue/pdf.html.twig', [
'user' => $user,
'type' => $type,
'date' => $date
]);
}
/**
* @Route("/catalogue/pdf-liste/{type}/{tab_users_ids}/", name="catalogue_pdf_liste")
*/
public function pdf_liste_structure($type, $tab_users_ids, GenerePdfListe $generePdfListe, GenerePdfActivites $generePdfActivites)
{
$generePdfListe->getPdfListeNew($type, $tab_users_ids, $generePdfActivites);
return false;
}
}