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

Nettoyage

parent 489025ef
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -126,12 +126,13 @@ class AgentController extends AbstractActionController
        $agent = $this->getAgentService()->getAgentByUser($user);

        $agents = [];
        if ($role->getRoleId() === Agent::ROLE_SUPERIEURE) $agents = array_map(function (AgentSuperieur $a) {
            return $a->getAgent();
        }, $this->getAgentSuperieurService()->getAgentsSuperieursBySuperieur($agent));
        if ($role->getRoleId() === Agent::ROLE_AUTORITE) $agents = array_map(function (AgentAutorite $a) {
            return $a->getAgent();
        }, $this->getAgentAutoriteService()->getAgentsAutoritesByAutorite($agent));
        if ($role->getRoleId() === Agent::ROLE_SUPERIEURE)
            $agents = array_map(
                function (AgentSuperieur $a) {return $a->getAgent();},
                $this->getAgentSuperieurService()->getAgentsSuperieursBySuperieur($agent));
        if ($role->getRoleId() === Agent::ROLE_AUTORITE)
            $agents = array_map(function (AgentAutorite $a) { return $a->getAgent(); },
            $this->getAgentAutoriteService()->getAgentsAutoritesByAutorite($agent));

        usort($agents, function (Agent $a, Agent $b) {
            $aaa = $a->getNomUsuel() . " " . $a->getPrenom() . " " . $a->getId();
+1 −3
Original line number Diff line number Diff line
@@ -83,9 +83,7 @@ class StructureController extends AbstractActionController
    {
        /**  Récupération du sous-arbre des structures */
        $structure = $this->getStructureService()->getRequestedStructure($this);

        $structures = $this->getStructureService()->getStructuresFilles($structure);
        $structures[] = $structure;
        $structures = $this->getStructureService()->getStructuresFilles($structure,true);

        /** Récupération des agents et postes liés aux structures */
        $agents = $this->getAgentService()->getAgentsByStructures($structures);