Loading module/Application/config/type-formation.config.php +14 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,19 @@ return [ ], 'may_terminate' => true, ], 'ajout' => [ 'type' => 'Segment', 'options' => [ 'route' => '/ajout/:groupeTypeFormation', 'constraints' => [ 'typeFormation' => '[0-9]*', ], 'defaults' => [ 'action' => 'ajout', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -126,7 +139,7 @@ return [ ], [ 'controller' => 'Application\Controller\TypeFormation', 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier", 'ajout'], 'privileges' => [Privileges::ODF_TYPE_FORMATION_EDITION], ], ], Loading @@ -135,7 +148,6 @@ return [ 'controllers' => [ 'factories' => [ 'Application\Controller\TypeFormation' => Controller\Factory\TypeFormationControllerFactory::class, 'Application\Controller\GroupeTypeFormation' => Controller\Factory\GroupeTypeFormationControllerFactory::class, ], ], 'form_elements' => [ Loading module/Application/src/Controller/TypeFormationController.php +27 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,33 @@ class TypeFormationController extends AbstractController public function ajoutAction() { $this->em()->getFilters()->enable('historique')->init([ GroupeTypeFormation::class, ]); $form = $this->getFormTypeFormationTypeFormationSaisie(); $title = "Création d'un nouveau type de formation"; /** @var TypeFormation $typeFormation */ $typeFormation = $this->getServiceTypeFormation()->newEntity(); $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation'); $typeFormation->setGroupe($groupeTypeFormation); $form->bindRequestSave($typeFormation, $this->getRequest(), function () use ($typeFormation, $form) { $this->getServiceTypeFormation()->save($typeFormation); $this->flashMessenger()->addSuccessMessage( "Ajout réussi" ); }); return compact('form', 'title'); } public function saisieGroupeAction() { $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation'); Loading module/Application/view/application/type-formation/ajout.phtml 0 → 100755 +7 −0 Original line number Diff line number Diff line <?php /** * @var $this \Application\View\Renderer\PhpRenderer */ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); echo $this->form($form); module/Application/view/application/type-formation/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); </table> <?php if ($canEdit): ?> <tr class="champ-triable"> <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/saisie', ['typeFormation' => '','groupeTypeFormation' => $groupeTypeFormation->getId()]); ?>"><i <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/ajout', ['groupeTypeFormation' => $groupeTypeFormation->getId()]); ?>"><i class="fas fa-plus"></i> Ajout d'un nouveau type de formation</a> </tr> Loading Loading
module/Application/config/type-formation.config.php +14 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,19 @@ return [ ], 'may_terminate' => true, ], 'ajout' => [ 'type' => 'Segment', 'options' => [ 'route' => '/ajout/:groupeTypeFormation', 'constraints' => [ 'typeFormation' => '[0-9]*', ], 'defaults' => [ 'action' => 'ajout', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -126,7 +139,7 @@ return [ ], [ 'controller' => 'Application\Controller\TypeFormation', 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier", 'ajout'], 'privileges' => [Privileges::ODF_TYPE_FORMATION_EDITION], ], ], Loading @@ -135,7 +148,6 @@ return [ 'controllers' => [ 'factories' => [ 'Application\Controller\TypeFormation' => Controller\Factory\TypeFormationControllerFactory::class, 'Application\Controller\GroupeTypeFormation' => Controller\Factory\GroupeTypeFormationControllerFactory::class, ], ], 'form_elements' => [ Loading
module/Application/src/Controller/TypeFormationController.php +27 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,33 @@ class TypeFormationController extends AbstractController public function ajoutAction() { $this->em()->getFilters()->enable('historique')->init([ GroupeTypeFormation::class, ]); $form = $this->getFormTypeFormationTypeFormationSaisie(); $title = "Création d'un nouveau type de formation"; /** @var TypeFormation $typeFormation */ $typeFormation = $this->getServiceTypeFormation()->newEntity(); $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation'); $typeFormation->setGroupe($groupeTypeFormation); $form->bindRequestSave($typeFormation, $this->getRequest(), function () use ($typeFormation, $form) { $this->getServiceTypeFormation()->save($typeFormation); $this->flashMessenger()->addSuccessMessage( "Ajout réussi" ); }); return compact('form', 'title'); } public function saisieGroupeAction() { $groupeTypeFormation = $this->getEvent()->getParam('groupeTypeFormation'); Loading
module/Application/view/application/type-formation/ajout.phtml 0 → 100755 +7 −0 Original line number Diff line number Diff line <?php /** * @var $this \Application\View\Renderer\PhpRenderer */ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); echo $this->form($form);
module/Application/view/application/type-formation/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); </table> <?php if ($canEdit): ?> <tr class="champ-triable"> <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/saisie', ['typeFormation' => '','groupeTypeFormation' => $groupeTypeFormation->getId()]); ?>"><i <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/ajout', ['groupeTypeFormation' => $groupeTypeFormation->getId()]); ?>"><i class="fas fa-plus"></i> Ajout d'un nouveau type de formation</a> </tr> Loading