Loading module/Application/src/Controller/TypeFormationController.php +9 −12 Original line number Diff line number Diff line Loading @@ -81,14 +81,12 @@ class TypeFormationController extends AbstractController } $form->bindRequestSave($groupeTypeFormation, $this->getRequest(), function () use ($groupeTypeFormation, $form) { $this->getServiceTypeFormation()->save($groupeTypeFormation); $this->getServiceGroupeTypeFormation()->save($groupeTypeFormation); $this->flashMessenger()->addSuccessMessage( "Ajout réussis" ); }); return compact('form', 'title'); } Loading @@ -97,21 +95,20 @@ class TypeFormationController extends AbstractController public function supprimerAction() { // $typeformation = $this->getEvent()->getParam('typeformation'); // $this->getServicetypeformation()->delete($typeformation, false); // // return new MessengerViewModel(); } $typeformation = $this->getEvent()->getParam('typeFormation'); $this->getServiceTypeFormation()->delete($typeformation, true); return new MessengerViewModel(); } public function supprimerGroupeAction() { // $typeformation = $this->getEvent()->getParam('typeformation'); // $this->getServicetypeformation()->delete($typeformation, false); // // return new MessengerViewModel(); $typeformation = $this->getEvent()->getParam('groupeFypeFormation'); $this->getServiceGroupeTypeFormation()->delete($typeformation, true); return new MessengerViewModel(); } Loading module/Application/src/Form/TypeFormation/TypeFormationSaisieForm.php +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class TypeFormationSaisieForm extends AbstractForm $this->get('libelleLong')->setLabel('Libellé long'); $this->setValueOptions('groupe', $this->getServiceGroupeTypeFormation()->getList()); $this->addSubmit(); return $this; } Loading module/Application/src/Service/GroupeTypeFormationService.php +20 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,26 @@ class GroupeTypeFormationService extends AbstractEntityService * * @return string */ public function getAlias(){ public function getAlias() { return 'gtf'; } /** * Sauvegarde la periode * * @param Periode $entity */ public function save($entity) { if (empty($entity->getOrdre())) { $ordre = (int)$this->getEntityManager()->getConnection()->fetchOne("SELECT MAX(ORDRE) M FROM GROUPE_TYPE_FORMATION gtf"); $ordre++; $entity->setOrdre($ordre); } return parent::save($entity); } } No newline at end of file module/Application/src/Service/TypeFormationService.php +0 −1 Original line number Diff line number Diff line Loading @@ -56,5 +56,4 @@ class TypeFormationService extends AbstractEntityService $qb->addOrderBy("$alias.libelleLong"); return parent::getList($qb, $alias); } } No newline at end of file module/Application/view/application/type-formation/index.phtml +2 −3 Original line number Diff line number Diff line Loading @@ -97,8 +97,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); <tr class="champ-triable"> <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/saisie'); ?>"><i class="fas fa-plus"></i> Ajout d'un nouveau type de formation</a> Ajout d'un nouveau type de formation</a> </tr> <?php endif; ?> Loading Loading @@ -132,7 +131,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); }); $(function () { $("body").on("groupe-formation-edition", function (event, data) { $("body").on("groupe-type-formation-edition", function (event, data) { window.location.reload(); }); }); Loading Loading
module/Application/src/Controller/TypeFormationController.php +9 −12 Original line number Diff line number Diff line Loading @@ -81,14 +81,12 @@ class TypeFormationController extends AbstractController } $form->bindRequestSave($groupeTypeFormation, $this->getRequest(), function () use ($groupeTypeFormation, $form) { $this->getServiceTypeFormation()->save($groupeTypeFormation); $this->getServiceGroupeTypeFormation()->save($groupeTypeFormation); $this->flashMessenger()->addSuccessMessage( "Ajout réussis" ); }); return compact('form', 'title'); } Loading @@ -97,21 +95,20 @@ class TypeFormationController extends AbstractController public function supprimerAction() { // $typeformation = $this->getEvent()->getParam('typeformation'); // $this->getServicetypeformation()->delete($typeformation, false); // // return new MessengerViewModel(); } $typeformation = $this->getEvent()->getParam('typeFormation'); $this->getServiceTypeFormation()->delete($typeformation, true); return new MessengerViewModel(); } public function supprimerGroupeAction() { // $typeformation = $this->getEvent()->getParam('typeformation'); // $this->getServicetypeformation()->delete($typeformation, false); // // return new MessengerViewModel(); $typeformation = $this->getEvent()->getParam('groupeFypeFormation'); $this->getServiceGroupeTypeFormation()->delete($typeformation, true); return new MessengerViewModel(); } Loading
module/Application/src/Form/TypeFormation/TypeFormationSaisieForm.php +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class TypeFormationSaisieForm extends AbstractForm $this->get('libelleLong')->setLabel('Libellé long'); $this->setValueOptions('groupe', $this->getServiceGroupeTypeFormation()->getList()); $this->addSubmit(); return $this; } Loading
module/Application/src/Service/GroupeTypeFormationService.php +20 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,26 @@ class GroupeTypeFormationService extends AbstractEntityService * * @return string */ public function getAlias(){ public function getAlias() { return 'gtf'; } /** * Sauvegarde la periode * * @param Periode $entity */ public function save($entity) { if (empty($entity->getOrdre())) { $ordre = (int)$this->getEntityManager()->getConnection()->fetchOne("SELECT MAX(ORDRE) M FROM GROUPE_TYPE_FORMATION gtf"); $ordre++; $entity->setOrdre($ordre); } return parent::save($entity); } } No newline at end of file
module/Application/src/Service/TypeFormationService.php +0 −1 Original line number Diff line number Diff line Loading @@ -56,5 +56,4 @@ class TypeFormationService extends AbstractEntityService $qb->addOrderBy("$alias.libelleLong"); return parent::getList($qb, $alias); } } No newline at end of file
module/Application/view/application/type-formation/index.phtml +2 −3 Original line number Diff line number Diff line Loading @@ -97,8 +97,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); <tr class="champ-triable"> <a class="btn btn-primary ajax-modal " data-event="type-formation-edition" href="<?= $this->url('type-formation/saisie'); ?>"><i class="fas fa-plus"></i> Ajout d'un nouveau type de formation</a> Ajout d'un nouveau type de formation</a> </tr> <?php endif; ?> Loading Loading @@ -132,7 +131,7 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); }); $(function () { $("body").on("groupe-formation-edition", function (event, data) { $("body").on("groupe-type-formation-edition", function (event, data) { window.location.reload(); }); }); Loading