Skip to content
Snippets Groups Projects
Commit 148567d8 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

[FIX] Calcul erroné de l'autorité de responsables de structures sans parent

parent 0ecbeb15
Branches
Tags
No related merge requests found
......@@ -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**
......
......@@ -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
......@@ -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());
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment