Loading module/Application/src/Controller/OffreFormationController.php +19 −29 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class OffreFormationController extends AbstractController $params = []; if ($structure) $params['structure'] = $structure->getId(); if ($niveau) $params['niveau'] = $niveau->getId(); if ($niveau) $params['niveau'] = ($niveau->getPertinence()) ? $niveau->getId() : $niveau->getLib(); if ($etape) $params['etape'] = $etape->getId(); Loading @@ -82,7 +82,6 @@ class OffreFormationController extends AbstractController } public function exportAction() { $this->initFilters(); Loading Loading @@ -174,14 +173,12 @@ class OffreFormationController extends AbstractController } public function administrationOffreAction() { return []; } public function reconductionAction() { $this->initFilterHistorique(); Loading Loading @@ -238,7 +235,6 @@ class OffreFormationController extends AbstractController } public function reconductionCentreCoutAction() { $this->initFilterHistorique(); Loading Loading @@ -290,7 +286,6 @@ class OffreFormationController extends AbstractController } public function reconductionModulateurAction() { $this->initFilterHistorique(); Loading Loading @@ -343,7 +338,6 @@ class OffreFormationController extends AbstractController } protected function initFilters() { $this->initFilterAnnee(); Loading @@ -351,7 +345,6 @@ class OffreFormationController extends AbstractController } protected function initFilterAnnee() { $this->em()->getFilters()->enable('annee')->init([ Loading @@ -362,7 +355,6 @@ class OffreFormationController extends AbstractController } protected function initFilterHistorique() { /* Mise en place des filtres */ Loading @@ -377,14 +369,12 @@ class OffreFormationController extends AbstractController } protected function disableFilters($name) { $this->em()->getFilters()->disable($name); } protected function getParams() { $structure = $this->context()->structureFromQuery() ?: $this->getServiceContext()->getStructure(); Loading module/Application/src/Entity/NiveauEtape.php +16 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ class NiveauEtape */ protected $lib; protected $pertinence; /** * * @param \Application\Entity\Db\Etape $etape Loading Loading @@ -93,6 +95,11 @@ class NiveauEtape return $this->lib; } public function getPertinence() { return $this->pertinence; } public function setNiv($niv) { $this->niv = $niv; Loading @@ -105,11 +112,18 @@ class NiveauEtape return $this; } public function setPertinence($pertinence) { $this->pertinence = $pertinence; return $this; } public function setEtape(Etape $etape) { $this->etape = $etape; $this->niv = $this->etape->getNiveau(); $this->lib = $this->etape->getTypeFormation()->getGroupe()->getLibelleCourt(); $this->pertinence = $this->etape->getTypeFormation()->getGroupe()->getPertinenceNiveau(); return $this; } } No newline at end of file module/Application/src/Service/NiveauEtapeService.php +6 −5 Original line number Diff line number Diff line Loading @@ -22,8 +22,9 @@ class NiveauEtapeService extends AbstractService return null; } $tiretPos = strrpos($id, '-'); $groupeTypeFormationLibelleCourt = substr( $id, 0, $tiretPos ); $niv = substr( $id, $tiretPos+1 ); $groupeTypeFormationLibelleCourt = (!$tiretPos) ? $id : substr($id, 0, $tiretPos); $niv = (!$tiretPos) ? false : substr($id, $tiretPos + 1); if ($niv === false) $niv = null; $niveau = new NiveauEtape(); Loading module/Application/src/Service/OffreFormationService.php +27 −26 Original line number Diff line number Diff line Loading @@ -30,13 +30,11 @@ class OffreFormationService extends AbstractEntityService } public function getAlias() { } public function getNeep($structure, $niveau, $etape, $annee = null, $source = null) { if ($etape) { Loading @@ -57,7 +55,7 @@ class OffreFormationService extends AbstractEntityService $dql = 'SELECT partial e.{id,code,annee,libelle,sourceCode,niveau,histoDestruction}, partial tf.{id}, partial gtf.{id, libelleCourt, ordre}, partial gtf.{id, libelleCourt, ordre, pertinenceNiveau}, partial ep.{id,code,libelle,sourceCode,etape,periode,tauxFoad,fi,fc,fa,tauxFi,tauxFc,tauxFa}, partial vme.{id,heures, groupes} FROM Loading Loading @@ -92,9 +90,14 @@ class OffreFormationService extends AbstractEntityService if ($object instanceof Etape) { $n = NiveauEtape::getInstanceFromEtape($object); if ($object->estNonHistorise()) { $gtf = $object->getTypeFormation()->getGroupe()->getPertinenceNiveau(); if ($gtf) { $niveaux[$n->getId()] = $n; } else { $niveaux[$n->getLib()] = $n; } if (!$niveau || $niveau->getId() == $n->getId()) { } if (!$niveau || ($niveau->getId() == $n->getId() && $n->getPertinence()) || ($niveau->getLib() == $n->getLib() && !$n->getPertinence())) { if ($object->estNonHistorise() || $object->getElementPedagogique()->count() > 0) { $etapes[] = $object; } Loading Loading @@ -122,11 +125,11 @@ class OffreFormationService extends AbstractEntityService return $e1Lib > $e2Lib ? 1 : 0; }); return [$niveaux, $etapes, $elements]; } public function getNeepEtape($etape) { $niveaux = []; Loading Loading @@ -176,7 +179,6 @@ class OffreFormationService extends AbstractEntityService } /** * @return array */ Loading Loading @@ -250,7 +252,6 @@ class OffreFormationService extends AbstractEntityService } public function createMappingEtapeNEtapeN1($etapesN, $etapesN1) { $codesEtapeN = []; Loading module/Application/view/application/offre-formation/index.phtml +11 −11 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ function makeQuery($structure = null, $niveau = null, $etape = null) $params = []; //@formatter:off if ($structure) $params['structure'] = $structure->getId(); if ($niveau) $params['niveau'] = $niveau->getId(); if ($niveau) $params['niveau'] = ($niveau->getPertinence()) ? $niveau->getId() : $niveau->getLib(); if ($etape) $params['etape'] = $etape->getId(); //@formatter:on Loading @@ -41,9 +41,9 @@ $niveauxItems = [ ], ]; foreach ($niveaux as $niv) { $niveauxItems[$niv->getId()] = [ 'label' => (string)$niv, foreach ($niveaux as $code => $niv) { $niveauxItems[$code] = [ 'label' => ($niv->getPertinence()) ? (string)$niv : $code, 'niveau' => $niv, 'url' => $this->url('of', [], makeQuery($structure, $niv)), ]; Loading Loading
module/Application/src/Controller/OffreFormationController.php +19 −29 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class OffreFormationController extends AbstractController $params = []; if ($structure) $params['structure'] = $structure->getId(); if ($niveau) $params['niveau'] = $niveau->getId(); if ($niveau) $params['niveau'] = ($niveau->getPertinence()) ? $niveau->getId() : $niveau->getLib(); if ($etape) $params['etape'] = $etape->getId(); Loading @@ -82,7 +82,6 @@ class OffreFormationController extends AbstractController } public function exportAction() { $this->initFilters(); Loading Loading @@ -174,14 +173,12 @@ class OffreFormationController extends AbstractController } public function administrationOffreAction() { return []; } public function reconductionAction() { $this->initFilterHistorique(); Loading Loading @@ -238,7 +235,6 @@ class OffreFormationController extends AbstractController } public function reconductionCentreCoutAction() { $this->initFilterHistorique(); Loading Loading @@ -290,7 +286,6 @@ class OffreFormationController extends AbstractController } public function reconductionModulateurAction() { $this->initFilterHistorique(); Loading Loading @@ -343,7 +338,6 @@ class OffreFormationController extends AbstractController } protected function initFilters() { $this->initFilterAnnee(); Loading @@ -351,7 +345,6 @@ class OffreFormationController extends AbstractController } protected function initFilterAnnee() { $this->em()->getFilters()->enable('annee')->init([ Loading @@ -362,7 +355,6 @@ class OffreFormationController extends AbstractController } protected function initFilterHistorique() { /* Mise en place des filtres */ Loading @@ -377,14 +369,12 @@ class OffreFormationController extends AbstractController } protected function disableFilters($name) { $this->em()->getFilters()->disable($name); } protected function getParams() { $structure = $this->context()->structureFromQuery() ?: $this->getServiceContext()->getStructure(); Loading
module/Application/src/Entity/NiveauEtape.php +16 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ class NiveauEtape */ protected $lib; protected $pertinence; /** * * @param \Application\Entity\Db\Etape $etape Loading Loading @@ -93,6 +95,11 @@ class NiveauEtape return $this->lib; } public function getPertinence() { return $this->pertinence; } public function setNiv($niv) { $this->niv = $niv; Loading @@ -105,11 +112,18 @@ class NiveauEtape return $this; } public function setPertinence($pertinence) { $this->pertinence = $pertinence; return $this; } public function setEtape(Etape $etape) { $this->etape = $etape; $this->niv = $this->etape->getNiveau(); $this->lib = $this->etape->getTypeFormation()->getGroupe()->getLibelleCourt(); $this->pertinence = $this->etape->getTypeFormation()->getGroupe()->getPertinenceNiveau(); return $this; } } No newline at end of file
module/Application/src/Service/NiveauEtapeService.php +6 −5 Original line number Diff line number Diff line Loading @@ -22,8 +22,9 @@ class NiveauEtapeService extends AbstractService return null; } $tiretPos = strrpos($id, '-'); $groupeTypeFormationLibelleCourt = substr( $id, 0, $tiretPos ); $niv = substr( $id, $tiretPos+1 ); $groupeTypeFormationLibelleCourt = (!$tiretPos) ? $id : substr($id, 0, $tiretPos); $niv = (!$tiretPos) ? false : substr($id, $tiretPos + 1); if ($niv === false) $niv = null; $niveau = new NiveauEtape(); Loading
module/Application/src/Service/OffreFormationService.php +27 −26 Original line number Diff line number Diff line Loading @@ -30,13 +30,11 @@ class OffreFormationService extends AbstractEntityService } public function getAlias() { } public function getNeep($structure, $niveau, $etape, $annee = null, $source = null) { if ($etape) { Loading @@ -57,7 +55,7 @@ class OffreFormationService extends AbstractEntityService $dql = 'SELECT partial e.{id,code,annee,libelle,sourceCode,niveau,histoDestruction}, partial tf.{id}, partial gtf.{id, libelleCourt, ordre}, partial gtf.{id, libelleCourt, ordre, pertinenceNiveau}, partial ep.{id,code,libelle,sourceCode,etape,periode,tauxFoad,fi,fc,fa,tauxFi,tauxFc,tauxFa}, partial vme.{id,heures, groupes} FROM Loading Loading @@ -92,9 +90,14 @@ class OffreFormationService extends AbstractEntityService if ($object instanceof Etape) { $n = NiveauEtape::getInstanceFromEtape($object); if ($object->estNonHistorise()) { $gtf = $object->getTypeFormation()->getGroupe()->getPertinenceNiveau(); if ($gtf) { $niveaux[$n->getId()] = $n; } else { $niveaux[$n->getLib()] = $n; } if (!$niveau || $niveau->getId() == $n->getId()) { } if (!$niveau || ($niveau->getId() == $n->getId() && $n->getPertinence()) || ($niveau->getLib() == $n->getLib() && !$n->getPertinence())) { if ($object->estNonHistorise() || $object->getElementPedagogique()->count() > 0) { $etapes[] = $object; } Loading Loading @@ -122,11 +125,11 @@ class OffreFormationService extends AbstractEntityService return $e1Lib > $e2Lib ? 1 : 0; }); return [$niveaux, $etapes, $elements]; } public function getNeepEtape($etape) { $niveaux = []; Loading Loading @@ -176,7 +179,6 @@ class OffreFormationService extends AbstractEntityService } /** * @return array */ Loading Loading @@ -250,7 +252,6 @@ class OffreFormationService extends AbstractEntityService } public function createMappingEtapeNEtapeN1($etapesN, $etapesN1) { $codesEtapeN = []; Loading
module/Application/view/application/offre-formation/index.phtml +11 −11 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ function makeQuery($structure = null, $niveau = null, $etape = null) $params = []; //@formatter:off if ($structure) $params['structure'] = $structure->getId(); if ($niveau) $params['niveau'] = $niveau->getId(); if ($niveau) $params['niveau'] = ($niveau->getPertinence()) ? $niveau->getId() : $niveau->getLib(); if ($etape) $params['etape'] = $etape->getId(); //@formatter:on Loading @@ -41,9 +41,9 @@ $niveauxItems = [ ], ]; foreach ($niveaux as $niv) { $niveauxItems[$niv->getId()] = [ 'label' => (string)$niv, foreach ($niveaux as $code => $niv) { $niveauxItems[$code] = [ 'label' => ($niv->getPertinence()) ? (string)$niv : $code, 'niveau' => $niv, 'url' => $this->url('of', [], makeQuery($structure, $niv)), ]; Loading