Loading module/OffreFormation/config/module.config.php +8 −1 Original line number Diff line number Diff line Loading @@ -308,6 +308,13 @@ return [ ], 'action' => 'saisie', ], 'ajout' => [ 'route' => '/ajout/:groupeTypeFormation', 'constraints' => [ 'typeFormation' => '[0-9]*', ], 'action' => 'ajout', ], 'supprimer' => [ 'route' => '/supprimer/:typeFormation', 'constraints' => [ Loading Loading @@ -550,7 +557,7 @@ return [ ], [ 'controller' => TypeFormationController::class, 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'action' => ['saisie', 'ajout', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'privileges' => [Privileges::ODF_TYPE_FORMATION_EDITION], ], ], Loading module/OffreFormation/src/Controller/TypeFormationController.php +29 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ class TypeFormationController extends AbstractController ]); $typeFormation = $this->getEvent()->getParam('typeFormation'); $form = $this->getFormTypeFormationTypeFormationSaisie(); if (empty($typeFormation)) { Loading @@ -82,6 +81,32 @@ 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/OffreFormation/view/offre-formation/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/OffreFormation/view/offre-formation/type-formation/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); <?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 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/OffreFormation/config/module.config.php +8 −1 Original line number Diff line number Diff line Loading @@ -308,6 +308,13 @@ return [ ], 'action' => 'saisie', ], 'ajout' => [ 'route' => '/ajout/:groupeTypeFormation', 'constraints' => [ 'typeFormation' => '[0-9]*', ], 'action' => 'ajout', ], 'supprimer' => [ 'route' => '/supprimer/:typeFormation', 'constraints' => [ Loading Loading @@ -550,7 +557,7 @@ return [ ], [ 'controller' => TypeFormationController::class, 'action' => ['saisie', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'action' => ['saisie', 'ajout', 'supprimer', 'saisieGroupe', 'supprimerGroupe', "trier"], 'privileges' => [Privileges::ODF_TYPE_FORMATION_EDITION], ], ], Loading
module/OffreFormation/src/Controller/TypeFormationController.php +29 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ class TypeFormationController extends AbstractController ]); $typeFormation = $this->getEvent()->getParam('typeFormation'); $form = $this->getFormTypeFormationTypeFormationSaisie(); if (empty($typeFormation)) { Loading @@ -82,6 +81,32 @@ 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/OffreFormation/view/offre-formation/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/OffreFormation/view/offre-formation/type-formation/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); <?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 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