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

Correction de la recherche d'agent en fonction de la structure utilisation de...

Correction de la recherche d'agent en fonction de la structure utilisation de l'affectation plutôt que du grade
parent fae2bd53
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -228,7 +228,6 @@ return [
                        ],
                    ],


                    /** AUTRE  ****************************************************************************************/

                    'upload-fichier' => [
+6 −3
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ class AgentService {
    public function createQueryBuilder()
    {
        $qb = $this->getEntityManager()->getRepository(Agent::class)->createQueryBuilder('agent')
            //affectations
            ->addSelect('affectation')->leftJoin('agent.affectations', 'affectation')
            ->addSelect('affectation_structure')->leftJoin('affectation.structure', 'affectation_structure')
            //quotite de l'agent
            ->addSelect('quotite')->leftJoin('agent.quotites', 'quotite')
//            //status de l'agent
@@ -147,10 +150,10 @@ class AgentService {
        if ($structures !== null) {
            $date = $this->getDateTime();
            $qb = $qb
                ->andWhere('grade.dateDebut <= :date')
                ->andWhere('grade.dateFin IS NULL OR grade.dateFin >= :date')
                ->andWhere('affectation.dateDebut <= :date OR affectation.dateDebut IS NULL')
                ->andWhere('affectation.dateFin >= :date OR affectation.dateFin IS NULL')
                ->setParameter('date', $date)
                ->addSelect('structure')->join('grade.structure', 'structure')
                ->addSelect('structure')->join('affectation.structure', 'structure')
                ->andWhere('structure IN (:structures)')
                ->setParameter('structures', $structures)
            ;