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

Bricolage pour entretien pro

parent 54f69c85
Loading
Loading
Loading
Loading
+0 −0

Empty file added.

+0 −1
Changes for module/Application/src/Application/Controller/AgentController.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ class AgentController extends AbstractActionController
        //Récupération des status
        $agentStatuts = $this->getAgentStatutService()->getAgentStatutsByAgent($agent);
        $agentAffectations = $this->getAgentAffectationService()->getAgentsAffectationsByAgentAndDate($agent, new DateTime());
        foreach ($agentAffectations as $af) var_dump($af->getDateFin());
        $agentGrades = $this->getAgentGradeService()->getAgentGradesByAgent($agent);

        //Récupération des supérieures et autorités
+0 −1
Changes for module/Application/src/Application/Service/AgentAffectation/AgentAffectationService.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ class AgentAffectationService {
//            ->setParameter('date', $date)
//        ;

        var_dump($date);
        $result = $qb->getQuery()->getResult();
        $result = array_filter($result, function (AgentAffectation $a) use ($date) {
//            var_dump($a->getDateDebut()->format('H/m/Y'));
+9 −1
Changes for module/Structure/src/Structure/Controller/StructureController.php: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -111,11 +111,18 @@ class StructureController extends AbstractActionController {
        $campagnes[] = $last;
        usort($campagnes, function (Campagne $a, Campagne $b) { return $a->getDateDebut() > $b->getDateDebut();});

        $allAgents = [];
        $entretiensArray = []; $agentsArray = [];
        foreach ($campagnes as $campagne) {
            $agentsArray[$campagne->getId()] = $this->getCampagneService()->computeAgentByStructures($structures, $campagne);
            $agentsCampagne = $this->getCampagneService()->computeAgentByStructures($structures, $campagne);
            $agentsArray[$campagne->getId()] = $agentsCampagne;
            foreach ($agentsCampagne as $agent) { $allAgents[$agent->getId()] = $agent;}
            $entretiensArray[$campagne->getId()] = $this->getEntretienProfessionnelService()->getEntretienProfessionnelByCampagneAndAgents($campagne, $agentsArray[$campagne->getId()]);
        }
        $allAgentsAffectations = [];
        foreach ($allAgents as $id => $agent) {
            $allAgentsAffectations[$id] = $this->getAgentAffectationService()->getAgentAffectationsByAgent($agent, false, true);
        }

        return new ViewModel([
            'selecteur' => $selecteur,
@@ -133,6 +140,7 @@ class StructureController extends AbstractActionController {
            'agents' => $agents,
            'agentsForces' => $agentsForces,
            'agentsAll' => $allAgents,
            'allAgentsAffectations' => $allAgentsAffectations,
            'superieurs' => $superieurs,
            'autorites' => $autorites,

+2 −2
Changes for module/Structure/src/Structure/Service/Structure/StructureService.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Exception as DBA_Exception;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\ORMException;
use Doctrine\ORM\QueryBuilder;
use Laminas\Permissions\Acl\Role\RoleInterface;
use Structure\Entity\Db\Structure;
use Structure\Entity\Db\StructureAgentForce;
use Structure\Entity\Db\StructureGestionnaire;
@@ -18,7 +19,6 @@ use Structure\Entity\Db\StructureResponsable;
use Structure\Provider\Role\RoleProvider;
use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\Service\EntityManagerAwareTrait;
use UnicaenUtilisateur\Entity\Db\Role;
use UnicaenUtilisateur\Entity\Db\User;
use UnicaenUtilisateur\Service\User\UserServiceAwareTrait;
use Laminas\Mvc\Controller\AbstractActionController;
@@ -447,7 +447,7 @@ EOS;
    /**
     * @return Structure[]
     */
    public function getStructuresByCurrentRole(User $user, Role $role) : array
    public function getStructuresByCurrentRole(User $user, RoleInterface $role) : array
    {
        $selecteur = [];
        if ($role->getRoleId() === RoleProvider::GESTIONNAIRE) {
Loading