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

ConvocationVH + correction diverse

parent b85cc855
Loading
Loading
Loading
Loading
+2 −5
Changes for documentation/000_BD_BIBLIOTHEQUE.sql: 2 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -890,8 +890,7 @@ create table unicaen_aide_faq_question
    ordre      integer
);

create unique index unicaen_faq_question_id_uindex
    on unicaen_aide_faq_question (id);
create unique index unicaen_faq_question_id_uindex on unicaen_aide_faq_question (id);

create table unicaen_aide_documentation_lien
(
@@ -907,9 +906,7 @@ create table unicaen_aide_documentation_lien
    role_ids    varchar(4096)
);


create unique index unicaen_aide_documentation_lien_id_uindex
    on unicaen_aide_documentation_lien (id);
create unique index unicaen_aide_documentation_lien_id_uindex on unicaen_aide_documentation_lien (id);


INSERT INTO unicaen_privilege_categorie (code, libelle, ordre, namespace)
+3 −1
Changes for module/Application/src/Application/Controller/AgentController.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ use Application\Service\FichePoste\FichePosteServiceAwareTrait;
use Application\Service\ParcoursDeFormation\ParcoursDeFormationServiceAwareTrait;
use Carriere\Provider\Parametre\CarriereParametres;
use Carriere\Service\Categorie\CategorieServiceAwareTrait;
use DateTime;
use Doctrine\ORM\ORMException;
use Element\Entity\Db\ApplicationElement;
use Element\Form\ApplicationElement\ApplicationElementFormAwareTrait;
@@ -130,7 +131,8 @@ class AgentController extends AbstractActionController

        //Récupération des status
        $agentStatuts = $this->getAgentStatutService()->getAgentStatutsByAgent($agent);
        $agentAffectations = $this->getAgentAffectationService()->getAgentAffectationsByAgent($agent, true, false, false, false);
        $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
+16 −7
Changes for module/Application/src/Application/Entity/Db/Agent.php: 16 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -314,11 +314,17 @@ class Agent implements
    /**
     * @return AgentAffectation
     */
    public function getAffectationPrincipale() : ?AgentAffectation
    public function getAffectationPrincipale(?DateTime $date = null) : ?AgentAffectation
    {
        if ($date === null) {
            $date = new DateTime();
        }
        /** @var AgentAffectation $affectation */
        foreach ($this->getAffectations() as $affectation) {
            if ($affectation->isPrincipale() and $affectation->estEnCours()) {
            if ($affectation->isPrincipale()
                and ($affectation->getDateDebut() === null OR $affectation->getDateDebut() <= $date)
                and ($affectation->getDateFin() === null OR $affectation->getDateFin() >= $date)
            ) {
                return $affectation;
            }
        }
@@ -380,15 +386,16 @@ class Agent implements
    }

    /**
     * @var ?DateTime $date
     * @return AgentStatut[]
     */
    public function getStatutsActifs() : array
    public function getStatutsActifs(?DateTime $date = null) : array
    {
        $now = (new DateTime());
        if ($date === null) $date = (new DateTime());
        $statuts = [];
        /** @var AgentStatut $statut */
        foreach ($this->getStatuts() as $statut) {
            if ($statut->estEnCours($now)) $statuts[] = $statut;
            if ($statut->estEnCours($date)) $statuts[] = $statut;
        }
        return $statuts;
    }
@@ -407,14 +414,16 @@ class Agent implements
    }

    /**
     * @var ?DateTime $date
     * @return AgentGrade[]
     */
    public function getGradesActifs() : array
    public function getGradesActifs(?DateTime $date = null) : array
    {
        if ($date === null) $date = (new DateTime());
        $grades = [];
        /** @var AgentGrade $grade */
        foreach ($this->getGrades() as $grade) {
            if ($grade->estEnCours()) $grades[] = $grade;
            if ($grade->estEnCours($date)) $grades[] = $grade;
        }
        return $grades;
    }
+2 −3
Changes for module/Application/src/Application/Entity/Db/AgentStatut.php: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -28,8 +28,7 @@ class AgentStatut implements HasPeriodeInterface {
    /** @var Structure */
    private $structure;

    /** @var boolean */
    private $titulaire;
    private string $titulaire = 'N';
    /** @var boolean */
    private $cdi;
    /** @var boolean */
@@ -162,7 +161,7 @@ class AgentStatut implements HasPeriodeInterface {
    /**
     * @return bool
     */
    public function isTitulaire()
    public function isTitulaire() : bool
    {
        return $this->titulaire === 'O';
    }
+4 −3
Changes for module/Application/src/Application/Entity/Db/Traits/HasPeriodeTrait.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -83,10 +83,11 @@ trait HasPeriodeTrait {
    {
        if ($date === null) $date = new DateTime();
        $qb = $qb
            ->andWhere($entityName . '.dateDebut IS NULL OR ' . $entityName . '.dateDebut <= :date')
            ->andWhere($entityName . '.dateFin IS NULL OR ' . $entityName . '.dateFin >= :date')
            ->andWhere("(" .$entityName . '.dateDebut IS NULL OR ' . $entityName . '.dateDebut <= :date'.")")
            ->andWhere("(" .$entityName . '.dateFin IS NULL OR ' . $entityName . '.dateFin >= :date'. ")")
            ->andWhere($entityName . '.id IS NOT NULL')
            ->setParameter('date', $date);
            ->setParameter('date', $date)
        ;
        return $qb;
    }
}
 No newline at end of file
Loading