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 +30 −3 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/src/Service/IntervenantService.php +62 −39 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'intervenant en fonction des paramètres de route transmis : * - soit code:<i>CODE</i> Loading Loading @@ -87,6 +88,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'intervenant de l'année précédente * Loading @@ -108,6 +110,7 @@ class IntervenantService extends AbstractEntityService } public function getByCode(string $code): ?Intervenant { $anneeId = $this->getServiceContext()->getAnnee()->getId(); Loading @@ -121,6 +124,7 @@ class IntervenantService extends AbstractEntityService } public function getByCodeRh(string $codeRh): ?Intervenant { $anneeId = $this->getServiceContext()->getAnnee()->getId(); Loading @@ -134,6 +138,7 @@ class IntervenantService extends AbstractEntityService } /** * * @param string $sourceCode Loading Loading @@ -161,6 +166,7 @@ class IntervenantService extends AbstractEntityService } private function getBones(array $params): array { $psql = ''; Loading @@ -186,6 +192,7 @@ class IntervenantService extends AbstractEntityService } private function bestIntervenantByBones(array $bones, ?string $code, ?int $anneeId, ?int $statutId, ?int $structureId): ?Intervenant { $count = count($bones); Loading Loading @@ -223,6 +230,7 @@ class IntervenantService extends AbstractEntityService } public function isImportable(Intervenant $intervenant): bool { $connection = $this->getEntityManager()->getConnection(); Loading @@ -238,6 +246,7 @@ class IntervenantService extends AbstractEntityService } private function getIntervenantIdParDefaut(string $code, int $anneeId): ?int { if (!$code || !$anneeId) return null; Loading @@ -252,6 +261,7 @@ class IntervenantService extends AbstractEntityService } /** * Permet de définit une fiche intervenant comme celle étant à consulter par défaut * Loading Loading @@ -284,6 +294,7 @@ class IntervenantService extends AbstractEntityService } /** * Permet de savoir si oui ou non cette fiche intervenant est définie comme étant celle par défaut. * Loading @@ -297,6 +308,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne les identifiants des données concernés * Loading Loading @@ -326,6 +338,7 @@ class IntervenantService extends AbstractEntityService } /** * @param $intervenant Intervenant * Loading @@ -342,6 +355,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'alias d'entité courante * Loading @@ -353,6 +367,7 @@ class IntervenantService extends AbstractEntityService } public function finderByMiseEnPaiement(Structure $structure = null, Periode $periode = null, QueryBuilder $qb = null, $alias = null) { $serviceMIS = $this->getServiceMiseEnPaiementIntervenantStructure(); Loading @@ -373,6 +388,7 @@ class IntervenantService extends AbstractEntityService } /** * @return Intervenant */ Loading @@ -390,6 +406,7 @@ class IntervenantService extends AbstractEntityService } /** * Sauvegarde une entité * Loading @@ -411,6 +428,7 @@ class IntervenantService extends AbstractEntityService } /** * * @param QueryBuilder|null $qb Loading @@ -426,6 +444,7 @@ class IntervenantService extends AbstractEntityService } /** * Filtre par le type d'intervenant * Loading @@ -447,6 +466,7 @@ class IntervenantService extends AbstractEntityService } /** * Supprime (historise par défaut) le service spécifié. * Loading Loading @@ -510,6 +530,7 @@ class IntervenantService extends AbstractEntityService } public function getSystemeInformationUrl(Intervenant $intervenant): ?string { if (!$intervenant->getSource()->getImportable()) return null; Loading @@ -529,6 +550,7 @@ class IntervenantService extends AbstractEntityService } /** * @param string $nom * @param string $prenom Loading Loading @@ -580,6 +602,7 @@ class IntervenantService extends AbstractEntityService } public function updateExportDate(Intervenant $intervenant): Intervenant { $date = new \DateTime(); Loading @@ -590,17 +613,17 @@ class IntervenantService extends AbstractEntityService return $intervenant; } public function updateCode(Intervenant $intervenant, $code): Intervenant { if (!empty($code)) { if (empty($intervenant->getExportDate())) { $intervenant->setCode($code); $this->getEntityManager()->persist($intervenant); $this->getEntityManager()->flush(); //On recalcul les tablaeux de bords de l'intervenant $this->getServiceWorkflow()->calculerTableauxBord([], $intervenant); } } return $intervenant; } 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 +30 −3 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/src/Service/IntervenantService.php +62 −39 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'intervenant en fonction des paramètres de route transmis : * - soit code:<i>CODE</i> Loading Loading @@ -87,6 +88,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'intervenant de l'année précédente * Loading @@ -108,6 +110,7 @@ class IntervenantService extends AbstractEntityService } public function getByCode(string $code): ?Intervenant { $anneeId = $this->getServiceContext()->getAnnee()->getId(); Loading @@ -121,6 +124,7 @@ class IntervenantService extends AbstractEntityService } public function getByCodeRh(string $codeRh): ?Intervenant { $anneeId = $this->getServiceContext()->getAnnee()->getId(); Loading @@ -134,6 +138,7 @@ class IntervenantService extends AbstractEntityService } /** * * @param string $sourceCode Loading Loading @@ -161,6 +166,7 @@ class IntervenantService extends AbstractEntityService } private function getBones(array $params): array { $psql = ''; Loading @@ -186,6 +192,7 @@ class IntervenantService extends AbstractEntityService } private function bestIntervenantByBones(array $bones, ?string $code, ?int $anneeId, ?int $statutId, ?int $structureId): ?Intervenant { $count = count($bones); Loading Loading @@ -223,6 +230,7 @@ class IntervenantService extends AbstractEntityService } public function isImportable(Intervenant $intervenant): bool { $connection = $this->getEntityManager()->getConnection(); Loading @@ -238,6 +246,7 @@ class IntervenantService extends AbstractEntityService } private function getIntervenantIdParDefaut(string $code, int $anneeId): ?int { if (!$code || !$anneeId) return null; Loading @@ -252,6 +261,7 @@ class IntervenantService extends AbstractEntityService } /** * Permet de définit une fiche intervenant comme celle étant à consulter par défaut * Loading Loading @@ -284,6 +294,7 @@ class IntervenantService extends AbstractEntityService } /** * Permet de savoir si oui ou non cette fiche intervenant est définie comme étant celle par défaut. * Loading @@ -297,6 +308,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne les identifiants des données concernés * Loading Loading @@ -326,6 +338,7 @@ class IntervenantService extends AbstractEntityService } /** * @param $intervenant Intervenant * Loading @@ -342,6 +355,7 @@ class IntervenantService extends AbstractEntityService } /** * Retourne l'alias d'entité courante * Loading @@ -353,6 +367,7 @@ class IntervenantService extends AbstractEntityService } public function finderByMiseEnPaiement(Structure $structure = null, Periode $periode = null, QueryBuilder $qb = null, $alias = null) { $serviceMIS = $this->getServiceMiseEnPaiementIntervenantStructure(); Loading @@ -373,6 +388,7 @@ class IntervenantService extends AbstractEntityService } /** * @return Intervenant */ Loading @@ -390,6 +406,7 @@ class IntervenantService extends AbstractEntityService } /** * Sauvegarde une entité * Loading @@ -411,6 +428,7 @@ class IntervenantService extends AbstractEntityService } /** * * @param QueryBuilder|null $qb Loading @@ -426,6 +444,7 @@ class IntervenantService extends AbstractEntityService } /** * Filtre par le type d'intervenant * Loading @@ -447,6 +466,7 @@ class IntervenantService extends AbstractEntityService } /** * Supprime (historise par défaut) le service spécifié. * Loading Loading @@ -510,6 +530,7 @@ class IntervenantService extends AbstractEntityService } public function getSystemeInformationUrl(Intervenant $intervenant): ?string { if (!$intervenant->getSource()->getImportable()) return null; Loading @@ -529,6 +550,7 @@ class IntervenantService extends AbstractEntityService } /** * @param string $nom * @param string $prenom Loading Loading @@ -580,6 +602,7 @@ class IntervenantService extends AbstractEntityService } public function updateExportDate(Intervenant $intervenant): Intervenant { $date = new \DateTime(); Loading @@ -590,17 +613,17 @@ class IntervenantService extends AbstractEntityService return $intervenant; } public function updateCode(Intervenant $intervenant, $code): Intervenant { if (!empty($code)) { if (empty($intervenant->getExportDate())) { $intervenant->setCode($code); $this->getEntityManager()->persist($intervenant); $this->getEntityManager()->flush(); //On recalcul les tablaeux de bords de l'intervenant $this->getServiceWorkflow()->calculerTableauxBord([], $intervenant); } } return $intervenant; } 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