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 @@ -25,7 +25,7 @@ return [ 'restaurer', 'supprimer', 'passer-liste-principale', 'passer-liste-secondaire', 'passer-liste-complementaire', ], 'privileges' => [ IndexPrivileges::INDEX_AFFICHER, Loading module/Formation/config/others/module.config.php +21 Changes for module/Formation/config/others/module.config.php: 21 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ return [ 'controller' => ModuleController::class, 'action' => [ 'index', 'afficher', 'ajouter', 'modifier', 'historiser', Loading @@ -48,6 +49,15 @@ return [ 'route' => 'formation/module', 'resource' => PrivilegeController::getResourceId(ModuleController::class, 'index') , 'order' => 100, 'pages' => [ 'afficher' => [ 'label' => "Affichage d'un module", 'route' => 'formation/module/afficher', 'resource' => PrivilegeController::getResourceId(ModuleController::class, 'afficher') , 'order' => 100, 'visible' => false, ], ], ], ], ], Loading @@ -71,6 +81,17 @@ return [ ], ], 'child_routes' => [ 'afficher' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/afficher/:module', 'defaults' => [ 'controller' => ModuleController::class, 'action' => 'afficher', ], ], ], 'ajouter' => [ 'type' => Literal::class, 'may_terminate' => true, 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 @@ -28,6 +28,7 @@ return [ 'modifier', 'historiser', 'restaurer', 'supprimer', ], 'privileges' => [ IndexPrivileges::INDEX_AFFICHER, Loading Loading @@ -126,6 +127,17 @@ return [ ], ], ], 'supprimer' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/supprimer/:session', 'defaults' => [ 'controller' => SessionController::class, 'action' => 'supprimer', ], ], ], ], ], ], Loading module/Formation/src/Formation/Controller/ModuleController.php +10 Changes for module/Formation/src/Formation/Controller/ModuleController.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,16 @@ class ModuleController extends AbstractController ]); } public function afficherAction() { /** @var Module|null $module */ $module = $this->getEntityManager()->getRepository(Module::class)->getRequestedModule($this); return new ViewModel([ 'module' => $module, ]); } public function ajouterAction() { $module = new Module(); Loading module/Formation/src/Formation/Controller/SessionController.php +24 Changes for module/Formation/src/Formation/Controller/SessionController.php: 24 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -117,4 +117,28 @@ class SessionController extends AbstractController return $this->redirect()->toRoute('formation/session'); } public function supprimerAction() { /**@var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); if ($data["reponse"] === "oui") $this->getSessionService()->delete($session); exit(); } $vm = new ViewModel(); if ($session !== null) { $vm->setTemplate('formation/default/confirmation'); $vm->setVariables([ 'title' => "Suppression de la session #" . $session->getIndex(), 'text' => "La suppression est définitive êtes-vous sûr·e de vouloir continuer ?", 'action' => $this->url()->fromRoute('formation/session/supprimer', ["module" => $session->getId()], [], true), ]); } return $vm; } } No newline at end of file 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 @@ -25,7 +25,7 @@ return [ 'restaurer', 'supprimer', 'passer-liste-principale', 'passer-liste-secondaire', 'passer-liste-complementaire', ], 'privileges' => [ IndexPrivileges::INDEX_AFFICHER, Loading
module/Formation/config/others/module.config.php +21 Changes for module/Formation/config/others/module.config.php: 21 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ return [ 'controller' => ModuleController::class, 'action' => [ 'index', 'afficher', 'ajouter', 'modifier', 'historiser', Loading @@ -48,6 +49,15 @@ return [ 'route' => 'formation/module', 'resource' => PrivilegeController::getResourceId(ModuleController::class, 'index') , 'order' => 100, 'pages' => [ 'afficher' => [ 'label' => "Affichage d'un module", 'route' => 'formation/module/afficher', 'resource' => PrivilegeController::getResourceId(ModuleController::class, 'afficher') , 'order' => 100, 'visible' => false, ], ], ], ], ], Loading @@ -71,6 +81,17 @@ return [ ], ], 'child_routes' => [ 'afficher' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/afficher/:module', 'defaults' => [ 'controller' => ModuleController::class, 'action' => 'afficher', ], ], ], 'ajouter' => [ 'type' => Literal::class, 'may_terminate' => true, 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 @@ -28,6 +28,7 @@ return [ 'modifier', 'historiser', 'restaurer', 'supprimer', ], 'privileges' => [ IndexPrivileges::INDEX_AFFICHER, Loading Loading @@ -126,6 +127,17 @@ return [ ], ], ], 'supprimer' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/supprimer/:session', 'defaults' => [ 'controller' => SessionController::class, 'action' => 'supprimer', ], ], ], ], ], ], Loading
module/Formation/src/Formation/Controller/ModuleController.php +10 Changes for module/Formation/src/Formation/Controller/ModuleController.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,16 @@ class ModuleController extends AbstractController ]); } public function afficherAction() { /** @var Module|null $module */ $module = $this->getEntityManager()->getRepository(Module::class)->getRequestedModule($this); return new ViewModel([ 'module' => $module, ]); } public function ajouterAction() { $module = new Module(); Loading
module/Formation/src/Formation/Controller/SessionController.php +24 Changes for module/Formation/src/Formation/Controller/SessionController.php: 24 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -117,4 +117,28 @@ class SessionController extends AbstractController return $this->redirect()->toRoute('formation/session'); } public function supprimerAction() { /**@var Session $session */ $session = $this->getEntityManager()->getRepository(Session::class)->getRequestedSession($this); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); if ($data["reponse"] === "oui") $this->getSessionService()->delete($session); exit(); } $vm = new ViewModel(); if ($session !== null) { $vm->setTemplate('formation/default/confirmation'); $vm->setVariables([ 'title' => "Suppression de la session #" . $session->getIndex(), 'text' => "La suppression est définitive êtes-vous sûr·e de vouloir continuer ?", 'action' => $this->url()->fromRoute('formation/session/supprimer', ["module" => $session->getId()], [], true), ]); } return $vm; } } No newline at end of file