Commit 0daf06c9 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Affichage de l'affectation principale (lorsque connue) dans le badge extra

parent 35f73e2b
Loading
Loading
Loading
Loading
+3 −1
Changes for module/Application/src/Application/Controller/AgentController.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -748,10 +748,12 @@ class AgentController extends AbstractActionController
        $result = [];
        /** @var Agent[] $agents */
        foreach ($agents as $agent) {
            $structure = ($agent->getAffectationPrincipale())?($agent->getAffectationPrincipale()->getStructure()):null;
            $extra = ($structure)?$structure->getLibelleCourt():"Affectation inconnue";
            $result[] = array(
                'id'    => $agent->getId(),
                'label' => $agent->getDenomination(),
                'extra' => "<span class='badge' style='background-color: slategray;'>"."OCTOPUS"."</span>",
                'extra' => "<span class='badge' style='background-color: slategray;'>".$extra."</span>",
            );
        }
        usort($result, function($a, $b) {
+1 −2
Changes for module/Application/src/Application/Service/Agent/AgentService.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -140,9 +140,8 @@ class AgentService {
        return $result;
    }


    /**
     * @param integer $id
     * @param integer|null $id
     * @return Agent
     */
    public function getAgent(?int $id)