Loading module/Formation/config/module.config.php +3 Changes for module/Formation/config/module.config.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ use Application\Navigation\ApplicationNavigationFactory; use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain; use Doctrine\DBAL\Driver\OCI8\Driver as OCI8; use Doctrine\ORM\Mapping\Driver\XmlDriver; use Formation\Service\Notification\NotificationService; use Formation\Service\Notification\NotificationServiceFactory; use Formation\View\Helper\EtatViewHelper; use Formation\View\Helper\FormateursViewHelper; use Formation\View\Helper\ModaliteViewHelper; Loading Loading @@ -68,6 +70,7 @@ return array( 'service_manager' => [ 'factories' => [ NotificationService::class => NotificationServiceFactory::class, ], ], Loading module/Formation/config/others/inscription.config.php +1 −1 Changes for module/Formation/config/others/inscription.config.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ return [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/ajouter/:session[/:individu]', 'route' => '/ajouter/:session[/:doctorant]', 'defaults' => [ 'controller' => InscriptionController::class, 'action' => 'ajouter', Loading module/Formation/config/others/session.config.php +12 Changes for module/Formation/config/others/session.config.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ return [ 'restaurer', 'supprimer', 'changer-etat', 'classer-inscriptions', 'declasser-inscriptions', 'generer-emargements', Loading Loading @@ -142,6 +143,17 @@ return [ ], ], ], 'changer-etat' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/changer-etat/:session[/:etat]', 'defaults' => [ 'controller' => SessionController::class, 'action' => 'changer-etat', ], ], ], 'classer-inscriptions' => [ 'type' => Segment::class, 'may_terminate' => true, Loading module/Formation/src/Formation/Controller/InscriptionController.php +13 −2 Changes for module/Formation/src/Formation/Controller/InscriptionController.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -54,9 +54,20 @@ class InscriptionController extends AbstractController { /** @var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); /** @var Doctorant|null $doctorant */ $doctorant = null; $doctorantId = $this->params()->fromRoute('doctorant'); $doctorant = $this->getEntityManager()->getRepository(Doctorant::class)->find($doctorantId); if ($doctorant !== null) { $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Inscription à la formation [] faite."); $retour=$this->params()->fromQuery('retour'); if ($retour) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('formation/session/afficher', ['session' => $session->getId()], [], true); } $request = $this->getRequest(); if ($request->isPost()) { Loading module/Formation/src/Formation/Controller/SessionController.php +39 Changes for module/Formation/src/Formation/Controller/SessionController.php: 39 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\File\FileServiceAwareTrait; use Formation\Entity\Db\Etat; use Formation\Entity\Db\Inscription; use Formation\Entity\Db\Module; use Formation\Entity\Db\Presence; Loading @@ -13,6 +14,7 @@ use Formation\Entity\Db\Session; use Formation\Form\Session\SessionFormAwareTrait; use Formation\Service\Exporter\Emargement\EmargementExporter; use Formation\Service\Inscription\InscriptionServiceAwareTrait; use Formation\Service\Notification\NotificationServiceAwareTrait; use Formation\Service\Session\SessionServiceAwareTrait; use UnicaenApp\Service\EntityManagerAwareTrait; use Zend\View\Model\ViewModel; Loading @@ -24,6 +26,7 @@ class SessionController extends AbstractController use EtablissementServiceAwareTrait; use FileServiceAwareTrait; use InscriptionServiceAwareTrait; use NotificationServiceAwareTrait; use SessionServiceAwareTrait; use SessionFormAwareTrait; Loading Loading @@ -170,6 +173,42 @@ class SessionController extends AbstractController return $vm; } public function changerEtatAction() { /**@var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); /**@var Etat $etat */ $etat = $this->getEntityManager()->getRepository(Etat::class)->getRequestedEtat($this); if ($etat) { $retour = $this->params()->fromQuery('retour'); $session->setEtat($etat); $this->getSessionService()->update($session); if ($retour) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('formation/session/afficher', ['session' => $session->getId()], [], true); } $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $etat = $this->getEntityManager()->getRepository(Etat::class)->find($data["etat"]); if ($etat !== null) { $session->setEtat($etat); $this->getSessionService()->update($session); //todo ceci est un test ... if ($session->getEtat()->getCode() === Etat::CODE_FERME) $this->getNotificationService()->triggerSessionImminente($session); } } return new ViewModel([ "title" => "Changement de l'état de la session", "etats" => $this->getEntityManager()->getRepository(Etat::class)->findAll(), "session" => $session, ]); } public function classerInscriptionsAction() { /**@var Session $session */ Loading Loading
module/Formation/config/module.config.php +3 Changes for module/Formation/config/module.config.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ use Application\Navigation\ApplicationNavigationFactory; use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain; use Doctrine\DBAL\Driver\OCI8\Driver as OCI8; use Doctrine\ORM\Mapping\Driver\XmlDriver; use Formation\Service\Notification\NotificationService; use Formation\Service\Notification\NotificationServiceFactory; use Formation\View\Helper\EtatViewHelper; use Formation\View\Helper\FormateursViewHelper; use Formation\View\Helper\ModaliteViewHelper; Loading Loading @@ -68,6 +70,7 @@ return array( 'service_manager' => [ 'factories' => [ NotificationService::class => NotificationServiceFactory::class, ], ], Loading
module/Formation/config/others/inscription.config.php +1 −1 Changes for module/Formation/config/others/inscription.config.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ return [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/ajouter/:session[/:individu]', 'route' => '/ajouter/:session[/:doctorant]', 'defaults' => [ 'controller' => InscriptionController::class, 'action' => 'ajouter', Loading
module/Formation/config/others/session.config.php +12 Changes for module/Formation/config/others/session.config.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ return [ 'restaurer', 'supprimer', 'changer-etat', 'classer-inscriptions', 'declasser-inscriptions', 'generer-emargements', Loading Loading @@ -142,6 +143,17 @@ return [ ], ], ], 'changer-etat' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/changer-etat/:session[/:etat]', 'defaults' => [ 'controller' => SessionController::class, 'action' => 'changer-etat', ], ], ], 'classer-inscriptions' => [ 'type' => Segment::class, 'may_terminate' => true, Loading
module/Formation/src/Formation/Controller/InscriptionController.php +13 −2 Changes for module/Formation/src/Formation/Controller/InscriptionController.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -54,9 +54,20 @@ class InscriptionController extends AbstractController { /** @var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); /** @var Doctorant|null $doctorant */ $doctorant = null; $doctorantId = $this->params()->fromRoute('doctorant'); $doctorant = $this->getEntityManager()->getRepository(Doctorant::class)->find($doctorantId); if ($doctorant !== null) { $inscription = new Inscription(); $inscription->setSession($session); $inscription->setDoctorant($doctorant); $this->getInscriptionService()->create($inscription); $this->flashMessenger()->addSuccessMessage("Inscription à la formation [] faite."); $retour=$this->params()->fromQuery('retour'); if ($retour) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('formation/session/afficher', ['session' => $session->getId()], [], true); } $request = $this->getRequest(); if ($request->isPost()) { Loading
module/Formation/src/Formation/Controller/SessionController.php +39 Changes for module/Formation/src/Formation/Controller/SessionController.php: 39 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\File\FileServiceAwareTrait; use Formation\Entity\Db\Etat; use Formation\Entity\Db\Inscription; use Formation\Entity\Db\Module; use Formation\Entity\Db\Presence; Loading @@ -13,6 +14,7 @@ use Formation\Entity\Db\Session; use Formation\Form\Session\SessionFormAwareTrait; use Formation\Service\Exporter\Emargement\EmargementExporter; use Formation\Service\Inscription\InscriptionServiceAwareTrait; use Formation\Service\Notification\NotificationServiceAwareTrait; use Formation\Service\Session\SessionServiceAwareTrait; use UnicaenApp\Service\EntityManagerAwareTrait; use Zend\View\Model\ViewModel; Loading @@ -24,6 +26,7 @@ class SessionController extends AbstractController use EtablissementServiceAwareTrait; use FileServiceAwareTrait; use InscriptionServiceAwareTrait; use NotificationServiceAwareTrait; use SessionServiceAwareTrait; use SessionFormAwareTrait; Loading Loading @@ -170,6 +173,42 @@ class SessionController extends AbstractController return $vm; } public function changerEtatAction() { /**@var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); /**@var Etat $etat */ $etat = $this->getEntityManager()->getRepository(Etat::class)->getRequestedEtat($this); if ($etat) { $retour = $this->params()->fromQuery('retour'); $session->setEtat($etat); $this->getSessionService()->update($session); if ($retour) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('formation/session/afficher', ['session' => $session->getId()], [], true); } $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $etat = $this->getEntityManager()->getRepository(Etat::class)->find($data["etat"]); if ($etat !== null) { $session->setEtat($etat); $this->getSessionService()->update($session); //todo ceci est un test ... if ($session->getEtat()->getCode() === Etat::CODE_FERME) $this->getNotificationService()->triggerSessionImminente($session); } } return new ViewModel([ "title" => "Changement de l'état de la session", "etats" => $this->getEntityManager()->getRepository(Etat::class)->findAll(), "session" => $session, ]); } public function classerInscriptionsAction() { /**@var Session $session */ Loading