Loading module/Evenementiel/config/merged/Inscription.config.php +29 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,8 @@ return [ 'action' => [ 'auto-inscription', 'inscription-en-cours', 'inscription-historique', 'generer-historique', 'inscription-groupe', ], 'privileges' => [ Loading Loading @@ -318,6 +320,26 @@ return [ ], ], ], 'inscription-historique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/inscription-historique', 'defaults' => [ /** @see InscriptionController::inscriptionHistoriqueAction() */ 'action' => 'inscription-historique', ], ], ], 'generer-historique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/generer-historique', 'defaults' => [ /** @see InscriptionController::genererHistoriqueAction() */ 'action' => 'generer-historique', ], ], ], 'desinscription' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -373,6 +395,13 @@ return [ 'order' => 100, 'icon' => 'fas fa-angle-right', ], 'inscriptions-historique' => [ 'label' => "Mes évènements suivis", 'route' => 'evenementiel/inscription/inscription-historique', 'resource' => PrivilegeController::getResourceId(InscriptionController::class, 'inscription-historique'), 'order' => 200, 'icon' => 'fas fa-angle-right', ], ], ], 'evenementiel' => [ Loading module/Evenementiel/src/Controller/InscriptionController.php +50 −0 Original line number Diff line number Diff line Loading @@ -8,9 +8,12 @@ use Evenementiel\Entity\Db\Participant; use Evenementiel\Provider\Etat\EvenementEtats; use Evenementiel\Provider\Role\RolesProvider as EvenementielRolesProvider; use Evenementiel\Provider\Template\TemplatesMail; use Evenementiel\Provider\Template\TemplatesPdf; use Evenementiel\Service\Evenement\EvenementServiceAwareTrait; use Evenementiel\Service\Macro\MacroServiceAwareTrait; use Evenementiel\Service\Notification\NotificationServiceAwareTrait; use Evenementiel\Service\Participant\ParticipantServiceAwareTrait; use Evenementiel\Service\Url\UrlServiceAwareTrait; use Laminas\Mvc\Controller\AbstractActionController; use Laminas\Mvc\Plugin\FlashMessenger\FlashMessenger; use Laminas\View\Model\ViewModel; Loading @@ -36,9 +39,24 @@ class InscriptionController extends AbstractActionController use EtudiantServiceAwareTrait; use UserServiceAwareTrait; use EvenementServiceAwareTrait; use MacroServiceAwareTrait; use NotificationServiceAwareTrait; use RenduServiceAwareTrait; use UrlServiceAwareTrait; private ?PhpRenderer $renderer = null; public function setRenderer(PhpRenderer $renderer): void { $this->renderer = $renderer; } private ?array $etablissementInfos = null; public function addValeur(string $clef, ?string $valeur): void { $this->etablissementInfos[$clef] = $valeur; } /** * Afficher la liste des entités Loading Loading @@ -581,6 +599,38 @@ class InscriptionController extends AbstractActionController ]); } public function inscriptionHistoriqueAction(): ViewModel { return new ViewModel([ 'participant' => $this->getParticipantService()->getParticipantUsager(), ]); } /** * @throws MpdfException */ public function genererHistoriqueAction(): ?string { $participant = $this->getParticipantService()->getParticipantUsager(); $vars = [ 'participant' => $participant, 'MacroService' => $this->getMacroService(), 'UrlService' => $this->getUrlService(), ]; $rendu = $this->getRenduService()->generateRenduByTemplateCode(TemplatesPdf::EVENEMENT_HISTORIQUE, $vars); $exporter = new PdfExporter(); $exporter->setRenderer($this->renderer); $exporter->getMpdf()->SetTitle($rendu->getSujet()); $exporter->getMpdf()->SetMargins(0, 0, 50); $exporter->setHeaderScript('/document/pdf/entete-logo-ccc', null, $this->etablissementInfos); $exporter->setFooterScript('/document/pdf/pied-vide'); $exporter->addBodyHtml($rendu->getCorps()); return $exporter->export($rendu->getSujet()); } /** VALIDATION DES INSCRIPTIONS ********************************************************************************* */ // public function validerAction(): ViewModel // { Loading module/Evenementiel/src/Controller/InscriptionControllerFactory.php +19 −0 Original line number Diff line number Diff line Loading @@ -3,17 +3,23 @@ namespace Evenementiel\Controller; use Etudiant\Service\Etudiant\EtudiantService; use Evenementiel\Provider\Parametre\EtablissementParametres; use Evenementiel\Form\Inscription\InscriptionParticipantForm; use Evenementiel\Form\Inscription\InscriptionGroupeForm; use Evenementiel\Service\Evenement\EvenementService; use Evenementiel\Service\Inscription\InscriptionService; use Evenementiel\Service\Macro\MacroService; use Evenementiel\Service\Notification\NotificationService; use Evenementiel\Service\Participant\ParticipantService; use Evenementiel\Service\Url\UrlService; use Laminas\View\Renderer\PhpRenderer; use Psr\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use UnicaenEtat\Service\EtatInstance\EtatInstanceService; use UnicaenEtat\Service\EtatType\EtatTypeService; use UnicaenParametre\Service\Parametre\ParametreService; use UnicaenRenderer\Service\Rendu\RenduService; use UnicaenUtilisateur\Service\User\UserService; class InscriptionControllerFactory Loading Loading @@ -42,20 +48,33 @@ class InscriptionControllerFactory $inscriptionGroupeForm = $container->get("FormElementManager")->get(InscriptionGroupeForm::class); $etatInstanceService = $container->get(EtatInstanceService::class); $etatTypeService = $container->get(EtatTypeService::class); $macroService = $container->get(MacroService::class); $participantService = $container->get(ParticipantService::class); $parametreService = $container->get(ParametreService::class); $renduService = $container->get(RenduService::class); $etudiantService = $container->get(EtudiantService::class); $urlService = $container->get(UrlService::class); $userService = $container->get(UserService::class); $evenementService = $container->get(EvenementService::class); $notificationService = $container->get(NotificationService::class); $controller = new InscriptionController(); /** @var PhpRenderer $renderer */ $renderer = $container->get('ViewRenderer'); $controller->setRenderer($renderer); $controller->addValeur('image', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::LOGO)); $controller->addValeur('libelle', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::LIBELLE)); $controller->addValeur('souslibelle', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::SOUSLIBELLE)); $controller->setInscriptionService($inscriptionService); $controller->setInscriptionParticipantForm($inscriptionForm); $controller->setInscriptionGroupeForm($inscriptionGroupeForm); $controller->setEtatInstanceService($etatInstanceService); $controller->setEtatTypeService($etatTypeService); $controller->setMacroService($macroService); $controller->setParticipantService($participantService); $controller->setRenduService($renduService); $controller->setEtudiantService($etudiantService); $controller->setUrlService($urlService); $controller->setUserService($userService); $controller->setEvenementService($evenementService); $controller->setNotificationService($notificationService); Loading module/Evenementiel/src/Entity/Db/Participant.php +49 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Evenementiel\Entity\Db; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Etudiant\Entity\Db\Etudiant; use Evenementiel\Provider\Etat\EvenementEtats; use Personnel\Entity\Db\Personnel; use UnicaenUtilisateur\Entity\Db\HistoriqueAwareInterface; use UnicaenUtilisateur\Entity\Db\HistoriqueAwareTrait; Loading Loading @@ -180,4 +181,52 @@ class Participant implements HistoriqueAwareInterface return [self::ETUDIANT, self::PERSONNEL, self::EXTERNE]; } public function generateHistoriqueListe(): string { /** @var Inscription[] $inscriptions */ $inscriptions = array_filter($this->getInscriptions(), function (Inscription $inscription) { $evenement = $inscription->getEvenement(); return $inscription->estNonHistorise() && $evenement !== null && $inscription->getNombrePlacesPointees() > 0 && $evenement->isEtatActif(EvenementEtats::ETAT_CLOTURE_INSTANCE); }); usort($inscriptions, function (Inscription $inscription1, Inscription $inscription2) { $dateDebut1 = $inscription1->getEvenement()->getJourDebut(); $dateDebut2 = $inscription2->getEvenement()->getJourDebut(); if ($dateDebut1 === $dateDebut2) { return 0; } if ($dateDebut1 === null) { return 1; } if ($dateDebut2 === null) { return -1; } return $dateDebut1 <=> $dateDebut2; }); $texte = ""; foreach ($inscriptions as $inscription) { $evenement = $inscription->getEvenement(); $texte .= "<div>"; $texte .= $evenement->getLibelle() . " (" . $evenement->getDateEtHoraire() . ") <br>"; $texte .= "Places pointées : " . $inscription->getNombrePlacesPointees() . "<br>"; if (!$inscription->estGroupe()) { $places = $inscription->getArrayDenominationPlaces(); if (!empty($places)) { $texte .= "Places nominatives : " . implode(', ', $places) . "<br>"; } } $texte .= "</div>"; } return $texte; } } module/Evenementiel/src/Provider/Template/TemplatesPdf.php +1 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,5 @@ namespace Evenementiel\Provider\Template; class TemplatesPdf { const EVENEMENT_BILLETS = 'EVENEMENT_BILLETS'; const EVENEMENT_HISTORIQUE = 'EVENEMENT_HISTORIQUE'; } No newline at end of file Loading
module/Evenementiel/config/merged/Inscription.config.php +29 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,8 @@ return [ 'action' => [ 'auto-inscription', 'inscription-en-cours', 'inscription-historique', 'generer-historique', 'inscription-groupe', ], 'privileges' => [ Loading Loading @@ -318,6 +320,26 @@ return [ ], ], ], 'inscription-historique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/inscription-historique', 'defaults' => [ /** @see InscriptionController::inscriptionHistoriqueAction() */ 'action' => 'inscription-historique', ], ], ], 'generer-historique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/generer-historique', 'defaults' => [ /** @see InscriptionController::genererHistoriqueAction() */ 'action' => 'generer-historique', ], ], ], 'desinscription' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -373,6 +395,13 @@ return [ 'order' => 100, 'icon' => 'fas fa-angle-right', ], 'inscriptions-historique' => [ 'label' => "Mes évènements suivis", 'route' => 'evenementiel/inscription/inscription-historique', 'resource' => PrivilegeController::getResourceId(InscriptionController::class, 'inscription-historique'), 'order' => 200, 'icon' => 'fas fa-angle-right', ], ], ], 'evenementiel' => [ Loading
module/Evenementiel/src/Controller/InscriptionController.php +50 −0 Original line number Diff line number Diff line Loading @@ -8,9 +8,12 @@ use Evenementiel\Entity\Db\Participant; use Evenementiel\Provider\Etat\EvenementEtats; use Evenementiel\Provider\Role\RolesProvider as EvenementielRolesProvider; use Evenementiel\Provider\Template\TemplatesMail; use Evenementiel\Provider\Template\TemplatesPdf; use Evenementiel\Service\Evenement\EvenementServiceAwareTrait; use Evenementiel\Service\Macro\MacroServiceAwareTrait; use Evenementiel\Service\Notification\NotificationServiceAwareTrait; use Evenementiel\Service\Participant\ParticipantServiceAwareTrait; use Evenementiel\Service\Url\UrlServiceAwareTrait; use Laminas\Mvc\Controller\AbstractActionController; use Laminas\Mvc\Plugin\FlashMessenger\FlashMessenger; use Laminas\View\Model\ViewModel; Loading @@ -36,9 +39,24 @@ class InscriptionController extends AbstractActionController use EtudiantServiceAwareTrait; use UserServiceAwareTrait; use EvenementServiceAwareTrait; use MacroServiceAwareTrait; use NotificationServiceAwareTrait; use RenduServiceAwareTrait; use UrlServiceAwareTrait; private ?PhpRenderer $renderer = null; public function setRenderer(PhpRenderer $renderer): void { $this->renderer = $renderer; } private ?array $etablissementInfos = null; public function addValeur(string $clef, ?string $valeur): void { $this->etablissementInfos[$clef] = $valeur; } /** * Afficher la liste des entités Loading Loading @@ -581,6 +599,38 @@ class InscriptionController extends AbstractActionController ]); } public function inscriptionHistoriqueAction(): ViewModel { return new ViewModel([ 'participant' => $this->getParticipantService()->getParticipantUsager(), ]); } /** * @throws MpdfException */ public function genererHistoriqueAction(): ?string { $participant = $this->getParticipantService()->getParticipantUsager(); $vars = [ 'participant' => $participant, 'MacroService' => $this->getMacroService(), 'UrlService' => $this->getUrlService(), ]; $rendu = $this->getRenduService()->generateRenduByTemplateCode(TemplatesPdf::EVENEMENT_HISTORIQUE, $vars); $exporter = new PdfExporter(); $exporter->setRenderer($this->renderer); $exporter->getMpdf()->SetTitle($rendu->getSujet()); $exporter->getMpdf()->SetMargins(0, 0, 50); $exporter->setHeaderScript('/document/pdf/entete-logo-ccc', null, $this->etablissementInfos); $exporter->setFooterScript('/document/pdf/pied-vide'); $exporter->addBodyHtml($rendu->getCorps()); return $exporter->export($rendu->getSujet()); } /** VALIDATION DES INSCRIPTIONS ********************************************************************************* */ // public function validerAction(): ViewModel // { Loading
module/Evenementiel/src/Controller/InscriptionControllerFactory.php +19 −0 Original line number Diff line number Diff line Loading @@ -3,17 +3,23 @@ namespace Evenementiel\Controller; use Etudiant\Service\Etudiant\EtudiantService; use Evenementiel\Provider\Parametre\EtablissementParametres; use Evenementiel\Form\Inscription\InscriptionParticipantForm; use Evenementiel\Form\Inscription\InscriptionGroupeForm; use Evenementiel\Service\Evenement\EvenementService; use Evenementiel\Service\Inscription\InscriptionService; use Evenementiel\Service\Macro\MacroService; use Evenementiel\Service\Notification\NotificationService; use Evenementiel\Service\Participant\ParticipantService; use Evenementiel\Service\Url\UrlService; use Laminas\View\Renderer\PhpRenderer; use Psr\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use UnicaenEtat\Service\EtatInstance\EtatInstanceService; use UnicaenEtat\Service\EtatType\EtatTypeService; use UnicaenParametre\Service\Parametre\ParametreService; use UnicaenRenderer\Service\Rendu\RenduService; use UnicaenUtilisateur\Service\User\UserService; class InscriptionControllerFactory Loading Loading @@ -42,20 +48,33 @@ class InscriptionControllerFactory $inscriptionGroupeForm = $container->get("FormElementManager")->get(InscriptionGroupeForm::class); $etatInstanceService = $container->get(EtatInstanceService::class); $etatTypeService = $container->get(EtatTypeService::class); $macroService = $container->get(MacroService::class); $participantService = $container->get(ParticipantService::class); $parametreService = $container->get(ParametreService::class); $renduService = $container->get(RenduService::class); $etudiantService = $container->get(EtudiantService::class); $urlService = $container->get(UrlService::class); $userService = $container->get(UserService::class); $evenementService = $container->get(EvenementService::class); $notificationService = $container->get(NotificationService::class); $controller = new InscriptionController(); /** @var PhpRenderer $renderer */ $renderer = $container->get('ViewRenderer'); $controller->setRenderer($renderer); $controller->addValeur('image', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::LOGO)); $controller->addValeur('libelle', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::LIBELLE)); $controller->addValeur('souslibelle', $parametreService->getValeurForParametre(EtablissementParametres::TYPE, EtablissementParametres::SOUSLIBELLE)); $controller->setInscriptionService($inscriptionService); $controller->setInscriptionParticipantForm($inscriptionForm); $controller->setInscriptionGroupeForm($inscriptionGroupeForm); $controller->setEtatInstanceService($etatInstanceService); $controller->setEtatTypeService($etatTypeService); $controller->setMacroService($macroService); $controller->setParticipantService($participantService); $controller->setRenduService($renduService); $controller->setEtudiantService($etudiantService); $controller->setUrlService($urlService); $controller->setUserService($userService); $controller->setEvenementService($evenementService); $controller->setNotificationService($notificationService); Loading
module/Evenementiel/src/Entity/Db/Participant.php +49 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Evenementiel\Entity\Db; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Etudiant\Entity\Db\Etudiant; use Evenementiel\Provider\Etat\EvenementEtats; use Personnel\Entity\Db\Personnel; use UnicaenUtilisateur\Entity\Db\HistoriqueAwareInterface; use UnicaenUtilisateur\Entity\Db\HistoriqueAwareTrait; Loading Loading @@ -180,4 +181,52 @@ class Participant implements HistoriqueAwareInterface return [self::ETUDIANT, self::PERSONNEL, self::EXTERNE]; } public function generateHistoriqueListe(): string { /** @var Inscription[] $inscriptions */ $inscriptions = array_filter($this->getInscriptions(), function (Inscription $inscription) { $evenement = $inscription->getEvenement(); return $inscription->estNonHistorise() && $evenement !== null && $inscription->getNombrePlacesPointees() > 0 && $evenement->isEtatActif(EvenementEtats::ETAT_CLOTURE_INSTANCE); }); usort($inscriptions, function (Inscription $inscription1, Inscription $inscription2) { $dateDebut1 = $inscription1->getEvenement()->getJourDebut(); $dateDebut2 = $inscription2->getEvenement()->getJourDebut(); if ($dateDebut1 === $dateDebut2) { return 0; } if ($dateDebut1 === null) { return 1; } if ($dateDebut2 === null) { return -1; } return $dateDebut1 <=> $dateDebut2; }); $texte = ""; foreach ($inscriptions as $inscription) { $evenement = $inscription->getEvenement(); $texte .= "<div>"; $texte .= $evenement->getLibelle() . " (" . $evenement->getDateEtHoraire() . ") <br>"; $texte .= "Places pointées : " . $inscription->getNombrePlacesPointees() . "<br>"; if (!$inscription->estGroupe()) { $places = $inscription->getArrayDenominationPlaces(); if (!empty($places)) { $texte .= "Places nominatives : " . implode(', ', $places) . "<br>"; } } $texte .= "</div>"; } return $texte; } }
module/Evenementiel/src/Provider/Template/TemplatesPdf.php +1 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,5 @@ namespace Evenementiel\Provider\Template; class TemplatesPdf { const EVENEMENT_BILLETS = 'EVENEMENT_BILLETS'; const EVENEMENT_HISTORIQUE = 'EVENEMENT_HISTORIQUE'; } No newline at end of file