Loading module/Application/src/Application/Controller/AgentController.php +8 −8 Original line number Diff line number Diff line Loading @@ -73,16 +73,16 @@ class AgentController extends AbstractActionController public function indexAction() { $fromQueries = $this->params()->fromQuery(); $filtres = []; $clefs = ['titulaire', 'cdi', 'cdd', 'administratif', 'chercheur', 'enseignant', 'vacataire']; foreach ($clefs as $clef) { if (empty($fromQueries) or $fromQueries[$clef] === 'on') $filtres[$clef] = true; } $agents = $this->getAgentService()->getAgents($filtres); // $filtres = []; // $clefs = ['titulaire', 'cdi', 'cdd', 'administratif', 'chercheur', 'enseignant', 'vacataire']; // foreach ($clefs as $clef) { // if (empty($fromQueries) or $fromQueries[$clef] === 'on') $filtres[$clef] = true; // } // $agents = $this->getAgentService()->getAgents($filtres); $agents = $this->getAgentService()->getAgents(); return new ViewModel([ 'agents' => $agents, 'filtres' => $filtres, // 'filtres' => $filtres, ]); } Loading module/Application/src/Application/Service/Agent/AgentService.php +10 −9 Original line number Diff line number Diff line Loading @@ -109,20 +109,21 @@ class AgentService { $qb = $this->getEntityManager()->getRepository(Agent::class)->createQueryBuilder('agent') ->andWhere('agent.delete IS NULL') ->addSelect('affectation')->join('agent.affectations', 'affectation') ->addSelect('statut')->leftJoin('agent.statuts', 'statut') ->addSelect('utilisateur')->leftjoin('agent.utilisateur', 'utilisateur') // ->addSelect('statut')->leftJoin('agent.statuts', 'statut') ->andWhere('affectation.dateDebut <= :NOW') ->andWhere('affectation.dateFin >= :NOW OR affectation.dateFin IS NULL') ->setParameter('NOW', $this->getDateTime()) ; $tmp = ['statut IS NULL']; foreach ($temoins as $temoin => $value) { if ($value) $tmp[] = 'statut.'. $temoin .' = :TRUE'; } if (!empty($tmp)) { $qb = $qb->andWhere(implode(" OR ",$tmp)) ->setParameter('TRUE', 'O'); } // $tmp = ['statut IS NULL']; // foreach ($temoins as $temoin => $value) { // if ($value) $tmp[] = 'statut.'. $temoin .' = :TRUE'; // } // if (!empty($tmp)) { // $qb = $qb->andWhere(implode(" OR ",$tmp)) // ->setParameter('TRUE', 'O'); // } if ($order !== null) { $qb = $qb->orderBy('agent.' . $order); Loading module/Application/view/application/agent/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ $this->headTitle("Index des agents") <div class="main"> <?php echo $this->partial('partial/filtre_statut', ['url' => $this->url('agent'), 'filtres' => $filtres]); ?> <!-- --><?php //echo $this->partial('partial/filtre_statut', ['url' => $this->url('agent'), 'filtres' => $filtres]); ?> <?php if (count($agents) > 0) : ?> <table id="agents" class="datatable table table-condensed"> Loading Loading
module/Application/src/Application/Controller/AgentController.php +8 −8 Original line number Diff line number Diff line Loading @@ -73,16 +73,16 @@ class AgentController extends AbstractActionController public function indexAction() { $fromQueries = $this->params()->fromQuery(); $filtres = []; $clefs = ['titulaire', 'cdi', 'cdd', 'administratif', 'chercheur', 'enseignant', 'vacataire']; foreach ($clefs as $clef) { if (empty($fromQueries) or $fromQueries[$clef] === 'on') $filtres[$clef] = true; } $agents = $this->getAgentService()->getAgents($filtres); // $filtres = []; // $clefs = ['titulaire', 'cdi', 'cdd', 'administratif', 'chercheur', 'enseignant', 'vacataire']; // foreach ($clefs as $clef) { // if (empty($fromQueries) or $fromQueries[$clef] === 'on') $filtres[$clef] = true; // } // $agents = $this->getAgentService()->getAgents($filtres); $agents = $this->getAgentService()->getAgents(); return new ViewModel([ 'agents' => $agents, 'filtres' => $filtres, // 'filtres' => $filtres, ]); } Loading
module/Application/src/Application/Service/Agent/AgentService.php +10 −9 Original line number Diff line number Diff line Loading @@ -109,20 +109,21 @@ class AgentService { $qb = $this->getEntityManager()->getRepository(Agent::class)->createQueryBuilder('agent') ->andWhere('agent.delete IS NULL') ->addSelect('affectation')->join('agent.affectations', 'affectation') ->addSelect('statut')->leftJoin('agent.statuts', 'statut') ->addSelect('utilisateur')->leftjoin('agent.utilisateur', 'utilisateur') // ->addSelect('statut')->leftJoin('agent.statuts', 'statut') ->andWhere('affectation.dateDebut <= :NOW') ->andWhere('affectation.dateFin >= :NOW OR affectation.dateFin IS NULL') ->setParameter('NOW', $this->getDateTime()) ; $tmp = ['statut IS NULL']; foreach ($temoins as $temoin => $value) { if ($value) $tmp[] = 'statut.'. $temoin .' = :TRUE'; } if (!empty($tmp)) { $qb = $qb->andWhere(implode(" OR ",$tmp)) ->setParameter('TRUE', 'O'); } // $tmp = ['statut IS NULL']; // foreach ($temoins as $temoin => $value) { // if ($value) $tmp[] = 'statut.'. $temoin .' = :TRUE'; // } // if (!empty($tmp)) { // $qb = $qb->andWhere(implode(" OR ",$tmp)) // ->setParameter('TRUE', 'O'); // } if ($order !== null) { $qb = $qb->orderBy('agent.' . $order); Loading
module/Application/view/application/agent/index.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ $this->headTitle("Index des agents") <div class="main"> <?php echo $this->partial('partial/filtre_statut', ['url' => $this->url('agent'), 'filtres' => $filtres]); ?> <!-- --><?php //echo $this->partial('partial/filtre_statut', ['url' => $this->url('agent'), 'filtres' => $filtres]); ?> <?php if (count($agents) > 0) : ?> <table id="agents" class="datatable table table-condensed"> Loading