Skip to content
Snippets Groups Projects
Commit 575517b0 authored by Florian Joriot's avatar Florian Joriot
Browse files

Ajout d'un tri sur l'ordre pour les types d'interventions

parent 8b1baf89
No related branches found
No related tags found
No related merge requests found
Pipeline #35327 passed
...@@ -219,11 +219,17 @@ class EnseignementSaisieFormViewHelper extends AbstractHtmlElement ...@@ -219,11 +219,17 @@ class EnseignementSaisieFormViewHelper extends AbstractHtmlElement
$element = $fieldset->getObject()->getService()->getElementPedagogique(); $element = $fieldset->getObject()->getService()->getElementPedagogique();
if ($element) { if ($element) {
$typesIntervention = $element->getTypeIntervention(); $typesIntervention = $element->getTypeIntervention();
$typesIntervention->getValues(); // Retourne un tableau des éléments
$elements = $typesIntervention->toArray(); // Copie en tableau
usort($elements, function ($a, $b) {
return $a->getOrdre() <=> $b->getOrdre();
});
} else { } else {
$qb = $this->getServiceTypeIntervention()->finderByHistorique(); $qb = $this->getServiceTypeIntervention()->finderByHistorique();
$this->getServiceTypeIntervention()->finderByContext($qb); $this->getServiceTypeIntervention()->finderByContext($qb);
$this->getServiceTypeIntervention()->finderByVisibleExterieur(true, $qb); $this->getServiceTypeIntervention()->finderByVisibleExterieur(true, $qb);
$typesIntervention = $this->getServiceTypeIntervention()->getList($qb); $typesIntervention = $this->getServiceTypeIntervention()->getList($qb);
} }
$res = $this->getView()->formHidden($fieldset->get('service')); $res = $this->getView()->formHidden($fieldset->get('service'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment