Skip to content
Snippets Groups Projects
Commit c4446ba6 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

retrait d'un trie dans l'affichage du parcours de formation

parent 74015f32
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
use Application\Entity\Db\Categorie; use Application\Entity\Db\Categorie;
use Application\Entity\Db\Formation; use Application\Entity\Db\Formation;
use Application\Entity\Db\FormationGroupe;
use Application\Entity\Db\Metier; use Application\Entity\Db\Metier;
use Application\Entity\Db\ParcoursDeFormation; use Application\Entity\Db\ParcoursDeFormation;
use Application\Provider\Privilege\FormationPrivileges; use Application\Provider\Privilege\FormationPrivileges;
...@@ -82,12 +83,24 @@ $canModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPriv ...@@ -82,12 +83,24 @@ $canModifier = $this->isAllowed(FormationPrivileges::getResourceId(FormationPriv
</div> </div>
<?php <?php
$groupes = [];
foreach ($formations as $formation) {
$groupe = $formation->getGroupe();
if ($groupe !== null) $groupes[$groupe->getId()] = $groupe;
}
$dictionnaire = []; $dictionnaire = [];
usort($groupes, function (FormationGroupe $a, FormationGroupe $b) {return $a->getOrdre() > $b->getOrdre();});
foreach ($groupes as $groupe) {
$dictionnaire[$groupe->getLibelle()] = [];
}
foreach ($formations as $formation) { foreach ($formations as $formation) {
$groupe = ($formation->getGroupe())?$formation->getGroupe()->getLibelle():"ZZZ"; $groupe = ($formation->getGroupe())?$formation->getGroupe()->getLibelle():"ZZZ";
$dictionnaire[$groupe][] = $formation; $dictionnaire[$groupe][] = $formation;
} }
ksort($dictionnaire); // ksort($dictionnaire);
?> ?>
<table style="width:90%;"> <table style="width:90%;">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment