From 23a77035b24fd968f4063c60b515f1591218e254 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Metivier <jean-philippe.metivier@unicaen.fr> Date: Mon, 27 Jan 2020 08:59:26 +0100 Subject: [PATCH] Utilisation du optionify pour les filtre d'UR --- .../Service/Structure/StructureService.php | 2 +- .../Service/These/TheseRechercheService.php | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/Application/src/Application/Service/Structure/StructureService.php b/module/Application/src/Application/Service/Structure/StructureService.php index 3e09b4404..eda5d2809 100755 --- a/module/Application/src/Application/Service/Structure/StructureService.php +++ b/module/Application/src/Application/Service/Structure/StructureService.php @@ -636,7 +636,7 @@ class StructureService extends BaseService ->andWhere('substitutionTo.id IS NULL OR pasHistorise(substitutionTo) != 1'); if ($order) $qb->orderBy(' structure.' . $order); else { - if ($type === TypeStructure::CODE_ECOLE_DOCTORALE) $qb->orderBy('structure.ferme, structureConcrete.sourceCode'); + if ($type === TypeStructure::CODE_ECOLE_DOCTORALE || $type === TypeStructure::CODE_UNITE_RECHERCHE) $qb->orderBy('structure.ferme, structureConcrete.sourceCode'); } $result = $qb->getQuery()->getResult(); diff --git a/module/Application/src/Application/Service/These/TheseRechercheService.php b/module/Application/src/Application/Service/These/TheseRechercheService.php index 1e58e4b9b..03ce6bdbe 100644 --- a/module/Application/src/Application/Service/These/TheseRechercheService.php +++ b/module/Application/src/Application/Service/These/TheseRechercheService.php @@ -545,20 +545,20 @@ class TheseRechercheService private function fetchUnitesRecherchesOptions() { - //$urs = $this->getStructureService()->getAllStructuresAffichablesByType(TypeStructure::CODE_UNITE_RECHERCHE, 'libelle'); - $all = $this->getStructureService()->getUnitesRechercheSelection(); + $urs = $this->getStructureService()->getAllStructuresAffichablesByType(TypeStructure::CODE_UNITE_RECHERCHE); +// $all = $this->getStructureService()->getUnitesRechercheSelection(); $options = []; -// foreach ($urs as $ur) { -// $options[] = $this->optionify($ur); + foreach ($urs as $ur) { + $options[] = $this->optionify($ur); + } +// foreach ($all as $a) { +// $options[] = [ +// 'value' => $a[4], //['sourceCode'], +// 'label' => $a[3], //['sigle'], +// 'subtext' => $a[2], //['libelle'] +// ]; // } - foreach ($all as $a) { - $options[] = [ - 'value' => $a[4], //['sourceCode'], - 'label' => $a[3], //['sigle'], - 'subtext' => $a[2], //['libelle'] - ]; - } // usort($options, function($a, $b) { // return strcmp($a['label'], $b['label']); // }); @@ -785,7 +785,7 @@ class TheseRechercheService } elseif ($value instanceof UniteRecherche) { $subtext = $value->getLibelle(); if ($value->getStructure()->isFerme()) $subtext.= " <span class='label' style='color:darkred;'>FERMEE</span>"; - return ['value' => $value->getSourceCode(), 'label' => $value->getCode(), 'subtext' => $subtext]; + return ['value' => $value->getSourceCode(), 'label' => $value->getSigle(), 'subtext' => $subtext]; } elseif ($value instanceof DomaineScientifique) { return ['value' => (string) $value->getId(), 'label' => $value->getLibelle()]; } elseif ($value instanceof OrigineFinancement) { -- GitLab