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/Enseignement/src/Controller/EnseignementController.php +2 −1 Original line number Diff line number Diff line Loading @@ -552,10 +552,11 @@ class EnseignementController extends AbstractController 'formule', 'validation_enseignement', 'contrat', 'service', ], $intervenant); if (!$validation) { $this->getServiceWorkflow()->calculerTableauxBord(['service', 'piece_jointe_demande', 'piece_jointe_fournie'], $intervenant); $this->getServiceWorkflow()->calculerTableauxBord(['piece_jointe_demande', 'piece_jointe_fournie'], $intervenant); } } } 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); 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/Enseignement/src/Controller/EnseignementController.php +2 −1 Original line number Diff line number Diff line Loading @@ -552,10 +552,11 @@ class EnseignementController extends AbstractController 'formule', 'validation_enseignement', 'contrat', 'service', ], $intervenant); if (!$validation) { $this->getServiceWorkflow()->calculerTableauxBord(['service', 'piece_jointe_demande', 'piece_jointe_fournie'], $intervenant); $this->getServiceWorkflow()->calculerTableauxBord(['piece_jointe_demande', 'piece_jointe_fournie'], $intervenant); } } }
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);