Loading module/Application/src/Application/Entity/Db/Agent.php +14 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use Application\Service\Agent\AgentServiceAwareTrait; use DateInterval; use DateTime; use Doctrine\Common\Collections\ArrayCollection; use EntretienProfessionnel\Entity\Db\AgentForceSansObligation; use EntretienProfessionnel\Entity\Db\Campagne; use EntretienProfessionnel\Entity\Db\EntretienProfessionnel; use Exception; Loading Loading @@ -68,6 +69,7 @@ class Agent implements private Collection $fichiers; /** Fichier[] */ private Collection $missionsSpecifiques; /** AgentMissionSpecifique[] */ private Collection $structuresForcees; /** StructureAgentForce */ private Collection $forcesSansObligation; /** StructureAgentForce */ private Collection $autorites; /** AgentAutorite[] */ private Collection $superieurs; /** AgentSuperieur[] */ Loading @@ -81,6 +83,7 @@ class Agent implements $this->echelons = new ArrayCollection(); $this->grades = new ArrayCollection(); $this->structuresForcees = new ArrayCollection(); $this->forcesSansObligation = new ArrayCollection(); $this->autorites = new ArrayCollection(); $this->superieurs = new ArrayCollection(); Loading Loading @@ -319,6 +322,17 @@ class Agent implements return $structures; } /** SANS OBLIGATION ***********************************************************************************************/ public function isForceSansObligation(Campagne $campagne): bool { /** @var AgentForceSansObligation $forcage */ foreach ($this->forcesSansObligation as $forcage) { if ($forcage->getCampagne() === $campagne) return true; } return false; } /** FICHES POSTES *************************************************************************************************/ /** Loading module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ <one-to-many target-entity="EntretienProfessionnel\Entity\Db\EntretienProfessionnel" mapped-by="agent" field="entretiens"/> <one-to-many target-entity="Structure\Entity\Db\StructureAgentForce" mapped-by="agent" field="structuresForcees"/> <one-to-many target-entity="EntretienProfessionnel\Entity\Db\AgentForceSansObligation" mapped-by="agent" field="forcesSansObligation"/> <many-to-many field="fichiers" target-entity="Fichier\Entity\Db\Fichier" inversed-by="fichier" fetch="LAZY"> <join-table name="agent_fichier"> Loading module/Application/view/application/index/partial/entretien.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ $obligatoires = []; $facultatifs = []; $dateMinEnPoste = (DateTime::createFromFormat('d/m/Y', $campagne->getDateFin()->format('d/m/Y')))->sub(new DateInterval('P12M')); foreach ($agents as $agent) { if (!empty($agent->getAffectationsActifs($dateMinEnPoste))) $obligatoires[] = $agent; else $facultatifs[] = $agent; if (!empty($agent->getAffectationsActifs($dateMinEnPoste)) && !$agent->isForceSansObligation($campagne)) $obligatoires[] = $agent; else $facultatifs[] = $agent; } $finalises = []; Loading module/EntretienProfessionnel/src/EntretienProfessionnel/Service/Campagne/CampagneService.php +6 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,12 @@ class CampagneService $facultatifs[] = $agent; $ok = true; } if (!$ok) { if ($agent->isForceSansObligation($campagne)) { $facultatifs[] = $agent; $ok=true; } } $res = $this->getAgentService()->isValideEmploiType($agent, $this->getParametreService()->getParametreByCode(EntretienProfessionnelParametres::TYPE, EntretienProfessionnelParametres::TEMOIN_EMPLOITYPE), $dateMinEnPoste); if (!$ok && !$res) { $facultatifs[] = $agent; Loading module/EntretienProfessionnel/src/EntretienProfessionnel/View/Helper/partial/campagne-avancement.phtml +19 −17 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ if ($nbTotal !== 0) { ?> <?php if ($mode === 'div') : ?> <?php if ($nbTotal !== 0) : ?> <div class="progress"> <div class="progress-bar entretien-agent" role="progressbar" style="width: <?php echo $ratioAgent; ?>%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100" title="Entretiens complétés <?php echo $nbValiderAgent; ?>/<?php echo $nbTotal; ?>"> Loading @@ -79,6 +80,7 @@ if ($nbTotal !== 0) { <?php echo round($ratioSans); ?>%</div> </div> <?php endif; ?> <?php endif; ?> <?php if ($mode === 'table') : ?> <table> <tr> Loading Loading
module/Application/src/Application/Entity/Db/Agent.php +14 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use Application\Service\Agent\AgentServiceAwareTrait; use DateInterval; use DateTime; use Doctrine\Common\Collections\ArrayCollection; use EntretienProfessionnel\Entity\Db\AgentForceSansObligation; use EntretienProfessionnel\Entity\Db\Campagne; use EntretienProfessionnel\Entity\Db\EntretienProfessionnel; use Exception; Loading Loading @@ -68,6 +69,7 @@ class Agent implements private Collection $fichiers; /** Fichier[] */ private Collection $missionsSpecifiques; /** AgentMissionSpecifique[] */ private Collection $structuresForcees; /** StructureAgentForce */ private Collection $forcesSansObligation; /** StructureAgentForce */ private Collection $autorites; /** AgentAutorite[] */ private Collection $superieurs; /** AgentSuperieur[] */ Loading @@ -81,6 +83,7 @@ class Agent implements $this->echelons = new ArrayCollection(); $this->grades = new ArrayCollection(); $this->structuresForcees = new ArrayCollection(); $this->forcesSansObligation = new ArrayCollection(); $this->autorites = new ArrayCollection(); $this->superieurs = new ArrayCollection(); Loading Loading @@ -319,6 +322,17 @@ class Agent implements return $structures; } /** SANS OBLIGATION ***********************************************************************************************/ public function isForceSansObligation(Campagne $campagne): bool { /** @var AgentForceSansObligation $forcage */ foreach ($this->forcesSansObligation as $forcage) { if ($forcage->getCampagne() === $campagne) return true; } return false; } /** FICHES POSTES *************************************************************************************************/ /** Loading
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ <one-to-many target-entity="EntretienProfessionnel\Entity\Db\EntretienProfessionnel" mapped-by="agent" field="entretiens"/> <one-to-many target-entity="Structure\Entity\Db\StructureAgentForce" mapped-by="agent" field="structuresForcees"/> <one-to-many target-entity="EntretienProfessionnel\Entity\Db\AgentForceSansObligation" mapped-by="agent" field="forcesSansObligation"/> <many-to-many field="fichiers" target-entity="Fichier\Entity\Db\Fichier" inversed-by="fichier" fetch="LAZY"> <join-table name="agent_fichier"> Loading
module/Application/view/application/index/partial/entretien.phtml +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ $obligatoires = []; $facultatifs = []; $dateMinEnPoste = (DateTime::createFromFormat('d/m/Y', $campagne->getDateFin()->format('d/m/Y')))->sub(new DateInterval('P12M')); foreach ($agents as $agent) { if (!empty($agent->getAffectationsActifs($dateMinEnPoste))) $obligatoires[] = $agent; else $facultatifs[] = $agent; if (!empty($agent->getAffectationsActifs($dateMinEnPoste)) && !$agent->isForceSansObligation($campagne)) $obligatoires[] = $agent; else $facultatifs[] = $agent; } $finalises = []; Loading
module/EntretienProfessionnel/src/EntretienProfessionnel/Service/Campagne/CampagneService.php +6 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,12 @@ class CampagneService $facultatifs[] = $agent; $ok = true; } if (!$ok) { if ($agent->isForceSansObligation($campagne)) { $facultatifs[] = $agent; $ok=true; } } $res = $this->getAgentService()->isValideEmploiType($agent, $this->getParametreService()->getParametreByCode(EntretienProfessionnelParametres::TYPE, EntretienProfessionnelParametres::TEMOIN_EMPLOITYPE), $dateMinEnPoste); if (!$ok && !$res) { $facultatifs[] = $agent; Loading
module/EntretienProfessionnel/src/EntretienProfessionnel/View/Helper/partial/campagne-avancement.phtml +19 −17 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ if ($nbTotal !== 0) { ?> <?php if ($mode === 'div') : ?> <?php if ($nbTotal !== 0) : ?> <div class="progress"> <div class="progress-bar entretien-agent" role="progressbar" style="width: <?php echo $ratioAgent; ?>%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100" title="Entretiens complétés <?php echo $nbValiderAgent; ?>/<?php echo $nbTotal; ?>"> Loading @@ -79,6 +80,7 @@ if ($nbTotal !== 0) { <?php echo round($ratioSans); ?>%</div> </div> <?php endif; ?> <?php endif; ?> <?php if ($mode === 'table') : ?> <table> <tr> Loading