From 148567d8f5327bb33ed68e22e34f47539fc3799d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Metivier <jean-philippe.metivier@unicaen.fr> Date: Thu, 8 Dec 2022 09:25:09 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=20Calcul=20erron=C3=A9=20de=20l'autorit?= =?UTF-8?q?=C3=A9=20de=20responsables=20de=20structures=20sans=20parent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/release/3.1.1.md | 2 +- .../Service/Agent/AgentService.php | 24 +++++++++++++++++++ .../Controller/StructureController.php | 5 +--- root@lemc2.unicaen.fr | 13 ++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 root@lemc2.unicaen.fr diff --git a/documentation/release/3.1.1.md b/documentation/release/3.1.1.md index 2c7d66b49..eacce6fa9 100644 --- a/documentation/release/3.1.1.md +++ b/documentation/release/3.1.1.md @@ -4,6 +4,7 @@ **Changements** +* [FIX] Calcul erroné de l'autorité de responsables de structures sans parent * Retrait de mention à Octopus * Logos modifiables via un CSS (mais pas de lien) @@ -24,7 +25,6 @@ div#etablissement { } ``` - **Modifications de la base de donnée** **Évolution des bibliothèques** diff --git a/module/Application/src/Application/Service/Agent/AgentService.php b/module/Application/src/Application/Service/Agent/AgentService.php index fa54749ac..2fdee58e4 100644 --- a/module/Application/src/Application/Service/Agent/AgentService.php +++ b/module/Application/src/Application/Service/Agent/AgentService.php @@ -12,6 +12,7 @@ use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\ORMException; use Doctrine\ORM\QueryBuilder; +use Fichier\Entity\Db\Fichier; use Formation\Entity\Db\FormationElement; use Laminas\Mvc\Controller\AbstractActionController; use Structure\Entity\Db\Structure; @@ -657,4 +658,27 @@ class AgentService { return $result; } + /** FICHE DE POSTE PDF */ + + /** + * @param Agent[]$agents + * @return Fichier[] :: [AgentId => Fichier] + */ + public function getFichesPostesPdfByAgents(array $agents) : array + { + $ids = array_map(function (Agent $a) {return $a->getId(); }, $agents); + + $qb = $this->getEntityManager()->getRepository(Agent::class)->createQueryBuilder('agent') + ->leftJoin('agent.fichiers', 'fichier')->addSelect('fichier') + ->leftJoin('fichier.nature', 'nature')->addSelect('nature') + ->andWhere('nature.code = :ficheposte')->setParameter('ficheposte', "FICHE_POSTE") + ->andWhere('agent.id in (:ids)')->setParameter('ids', $ids); + + $result = $qb->getQuery()->getResult(); + + $fiches = []; + foreach ($result as $item) $fiches[$item->getId()] = $item->getFichiersByCode("FICHE_POSTE"); + return $fiches; + } + } \ No newline at end of file diff --git a/module/Structure/src/Structure/Controller/StructureController.php b/module/Structure/src/Structure/Controller/StructureController.php index d79e99aad..93a71ad6c 100644 --- a/module/Structure/src/Structure/Controller/StructureController.php +++ b/module/Structure/src/Structure/Controller/StructureController.php @@ -136,10 +136,7 @@ class StructureController extends AbstractActionController { $delegues = $this->getDelegueService()->getDeleguesByStructure($structure); // $profils = $this->getFicheProfilService()->getFichesPostesByStructure($structure); - $fichespostes_pdf = []; - foreach ($allAgents as $agent) { - $fichespostes_pdf[$agent->getId()] = $agent->getFichiersByCode("FICHE_POSTE"); - } + $fichespostes_pdf = $this->getAgentService()->getFichesPostesPdfByAgents($allAgents); //formations $demandesNonValidees = $this->getDemandeExterneService()->getDemandesExternesNonValideesByAgents($allAgents, Formation::getAnnee()); diff --git a/root@lemc2.unicaen.fr b/root@lemc2.unicaen.fr new file mode 100644 index 000000000..abdea1c19 --- /dev/null +++ b/root@lemc2.unicaen.fr @@ -0,0 +1,13 @@ +div#comue { + background-image: url('../img/normandie-universite-logo.svg'); + height: 85px; + width: 146px; + margin-top: -20px; +} + +div#etablissement { + background-image: url('../img/unicaen-logo-noir.svg'); + height:85px; + width:160px; + margin-top: -20px; +} \ No newline at end of file -- GitLab