Loading CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ Journal des modifications 5.2.4 ----- - [FIX] Correction du ViewHelper SelectHelper (ne suivant pas le lien de substitution) - Ajout de la modalité de formation mixte - Ajout d'une garde pour éviter les inscriptions répétées 5.2.3 ----- Loading module/Formation/src/Formation/Controller/InscriptionController.php +17 −8 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class InscriptionController extends AbstractController public function ajouterAction() { $session = $this->getSessionService()->getRepository()->getRequestedSession($this); $libelle = $session->getFormation()->getLibelle(); /** @var Doctorant|null $doctorant */ $doctorantId = $this->params()->fromRoute('doctorant'); if ($doctorantId !== null) { Loading @@ -78,10 +79,13 @@ class InscriptionController extends AbstractController $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); if (!empty($this->getInscriptionService()->getRepository()->findInscriptionsByDoctorantAndSession($doctorant, $session))) { $this->flashMessenger()->addErrorMessage("Vous êtes déjà inscrit·e à la formation <strong>" . $libelle . "</strong>."); } else { $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Inscription à la formation [] faite."); $this->flashMessenger()->addSuccessMessage("Inscription à la formation <strong>".$libelle."</strong> faite."); $this->getNotificationService()->triggerInscriptionEnregistree($inscription); } $retour=$this->params()->fromQuery('retour'); if ($retour) return $this->redirect()->toUrl($retour); Loading @@ -98,10 +102,15 @@ class InscriptionController extends AbstractController $doctorant = $this->doctorantService->getRepository()->findOneByIndividu($individu); } if ($doctorant !== null) { if (!empty($this->getInscriptionService()->getRepository()->findInscriptionsByDoctorantAndSession($doctorant, $session))) { $this->flashMessenger()->addSuccessMessage("Vous êtes déjà inscrit·e à la formation <strong>" . $libelle . "</strong>."); } else { $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Vous êtes maintenant inscrit·e à la formation <strong>" . $libelle . "</strong>."); } } } Loading module/Formation/src/Formation/Entity/Db/Repository/InscriptionRepository.php +13 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,17 @@ class InscriptionRepository extends EntityRepository $result = $qb->getQuery()->getResult(); return $result; } public function findInscriptionsByDoctorantAndSession($doctorant, ?Session $session) { $qb = $this->createQB('inscription') ->andWhere('inscription.doctorant = :doctorant') ->setParameter('doctorant', $doctorant) ->andWhere('inscription.session = :session') ->setParameter('session', $session) ->andWhere('inscription.histoDestruction IS NULL') ; $result = $qb->getQuery()->getResult(); return $result; } } No newline at end of file module/Formation/view/formation/index/index-doctorant.phtml +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP </div> </div> <?php echo $this->messenger()->addMessagesFromFlashMessengerWithNoNamespace(); ?> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="nav-item active"> <a href="#a_venir" Loading Loading
CHANGELOG.md +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ Journal des modifications 5.2.4 ----- - [FIX] Correction du ViewHelper SelectHelper (ne suivant pas le lien de substitution) - Ajout de la modalité de formation mixte - Ajout d'une garde pour éviter les inscriptions répétées 5.2.3 ----- Loading
module/Formation/src/Formation/Controller/InscriptionController.php +17 −8 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class InscriptionController extends AbstractController public function ajouterAction() { $session = $this->getSessionService()->getRepository()->getRequestedSession($this); $libelle = $session->getFormation()->getLibelle(); /** @var Doctorant|null $doctorant */ $doctorantId = $this->params()->fromRoute('doctorant'); if ($doctorantId !== null) { Loading @@ -78,10 +79,13 @@ class InscriptionController extends AbstractController $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); if (!empty($this->getInscriptionService()->getRepository()->findInscriptionsByDoctorantAndSession($doctorant, $session))) { $this->flashMessenger()->addErrorMessage("Vous êtes déjà inscrit·e à la formation <strong>" . $libelle . "</strong>."); } else { $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Inscription à la formation [] faite."); $this->flashMessenger()->addSuccessMessage("Inscription à la formation <strong>".$libelle."</strong> faite."); $this->getNotificationService()->triggerInscriptionEnregistree($inscription); } $retour=$this->params()->fromQuery('retour'); if ($retour) return $this->redirect()->toUrl($retour); Loading @@ -98,10 +102,15 @@ class InscriptionController extends AbstractController $doctorant = $this->doctorantService->getRepository()->findOneByIndividu($individu); } if ($doctorant !== null) { if (!empty($this->getInscriptionService()->getRepository()->findInscriptionsByDoctorantAndSession($doctorant, $session))) { $this->flashMessenger()->addSuccessMessage("Vous êtes déjà inscrit·e à la formation <strong>" . $libelle . "</strong>."); } else { $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Vous êtes maintenant inscrit·e à la formation <strong>" . $libelle . "</strong>."); } } } Loading
module/Formation/src/Formation/Entity/Db/Repository/InscriptionRepository.php +13 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,17 @@ class InscriptionRepository extends EntityRepository $result = $qb->getQuery()->getResult(); return $result; } public function findInscriptionsByDoctorantAndSession($doctorant, ?Session $session) { $qb = $this->createQB('inscription') ->andWhere('inscription.doctorant = :doctorant') ->setParameter('doctorant', $doctorant) ->andWhere('inscription.session = :session') ->setParameter('session', $session) ->andWhere('inscription.histoDestruction IS NULL') ; $result = $qb->getQuery()->getResult(); return $result; } } No newline at end of file
module/Formation/view/formation/index/index-doctorant.phtml +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP </div> </div> <?php echo $this->messenger()->addMessagesFromFlashMessengerWithNoNamespace(); ?> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="nav-item active"> <a href="#a_venir" Loading