Loading module/Formation/src/Formation/Entity/Db/FormationInstance.php +20 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $this->coutTtc = $coutTtc; } /** PARAMETRES ***************************************************************************************************/ public function getParametre(): ?SessionParametre { return $this->parametre; Loading @@ -458,6 +460,24 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $this->parametre = $parametre; } public function isMailActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isMailActive(); } public function isEvenementActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isEvenementActive(); } public function isEnqueteActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isEnqueteActive(); } /** PREDICAT D'ETAT *********************************************************************************************/ public function estPreparation() : bool Loading module/Formation/src/Formation/Event/Convocation/ConvocationEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ class ConvocationEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_INSCRIPTION_FERMEE); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateDebut = ($session->getDebut() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getDebut()) : null; if ($dateDebut >= $deadline) { $this->getFormationInstanceService()->envoyerConvocation($session); Loading @@ -61,6 +62,7 @@ class ConvocationEvent extends EvenementService $convocations[] = $session; } } } $this->getNotificationService()->triggerNotifierConvocationAutomatique($convocations); } catch(Exception $e) { $evenement->setLog($e->getMessage()); Loading module/Formation/src/Formation/Event/DemandeRetour/DemandeRetourEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ class DemandeRetourEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_FORMATION_CONVOCATION); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateFin = ($session->getFin() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getFin()) : null; if ($dateFin < $deadline) { $this->getFormationInstanceService()->demanderRetour($session); Loading @@ -57,6 +58,7 @@ class DemandeRetourEvent extends EvenementService $nbSession++; } } } } catch(Exception $e) { $evenement->setLog($e->getMessage()); return Etat::ECHEC; Loading module/Formation/src/Formation/Event/InscriptionCloture/InscriptionClotureEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ class InscriptionClotureEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_INSCRIPTION_OUVERTE); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateDebut = ($session->getDebut() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getDebut()) : null; if ($dateDebut >= $deadline) { $this->getFormationInstanceService()->fermerInscription($session); Loading @@ -61,6 +62,7 @@ class InscriptionClotureEvent extends EvenementService $closes[] = $session; } } } $this->getNotificationService()->triggerNotifierInscriptionClotureAutomatique($closes); } catch(Exception $e) { $evenement->setLog($e->getMessage()); Loading module/Formation/src/Formation/Event/SessionCloture/SessionClotureEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ class SessionClotureEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_ATTENTE_RETOURS); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateFin = ($session->getFin() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getFin()) : null; if ($dateFin < $deadline) { $this->getFormationInstanceService()->cloturer($session); Loading @@ -57,6 +58,7 @@ class SessionClotureEvent extends EvenementService $nbSession++; } } } } catch(Exception $e) { $evenement->setLog($e->getMessage()); return Etat::ECHEC; Loading Loading
module/Formation/src/Formation/Entity/Db/FormationInstance.php +20 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $this->coutTtc = $coutTtc; } /** PARAMETRES ***************************************************************************************************/ public function getParametre(): ?SessionParametre { return $this->parametre; Loading @@ -458,6 +460,24 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $this->parametre = $parametre; } public function isMailActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isMailActive(); } public function isEvenementActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isEvenementActive(); } public function isEnqueteActive() : bool { if ($this->parametre === null) return true; return $this->parametre->isEnqueteActive(); } /** PREDICAT D'ETAT *********************************************************************************************/ public function estPreparation() : bool Loading
module/Formation/src/Formation/Event/Convocation/ConvocationEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ class ConvocationEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_INSCRIPTION_FERMEE); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateDebut = ($session->getDebut() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getDebut()) : null; if ($dateDebut >= $deadline) { $this->getFormationInstanceService()->envoyerConvocation($session); Loading @@ -61,6 +62,7 @@ class ConvocationEvent extends EvenementService $convocations[] = $session; } } } $this->getNotificationService()->triggerNotifierConvocationAutomatique($convocations); } catch(Exception $e) { $evenement->setLog($e->getMessage()); Loading
module/Formation/src/Formation/Event/DemandeRetour/DemandeRetourEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ class DemandeRetourEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_FORMATION_CONVOCATION); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateFin = ($session->getFin() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getFin()) : null; if ($dateFin < $deadline) { $this->getFormationInstanceService()->demanderRetour($session); Loading @@ -57,6 +58,7 @@ class DemandeRetourEvent extends EvenementService $nbSession++; } } } } catch(Exception $e) { $evenement->setLog($e->getMessage()); return Etat::ECHEC; Loading
module/Formation/src/Formation/Event/InscriptionCloture/InscriptionClotureEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ class InscriptionClotureEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_INSCRIPTION_OUVERTE); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateDebut = ($session->getDebut() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getDebut()) : null; if ($dateDebut >= $deadline) { $this->getFormationInstanceService()->fermerInscription($session); Loading @@ -61,6 +62,7 @@ class InscriptionClotureEvent extends EvenementService $closes[] = $session; } } } $this->getNotificationService()->triggerNotifierInscriptionClotureAutomatique($closes); } catch(Exception $e) { $evenement->setLog($e->getMessage()); Loading
module/Formation/src/Formation/Event/SessionCloture/SessionClotureEvent.php +7 −5 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ class SessionClotureEvent extends EvenementService $sessions = $this->getFormationInstanceService()->getFormationsInstancesByEtat(SessionEtats::ETAT_ATTENTE_RETOURS); $deadline = (new DateTime())->sub(new DateInterval($this->deadline)); foreach ($sessions as $session) { if ($session->isEvenementActive()) { $dateFin = ($session->getFin() !== null) ? DateTime::createFromFormat('d/m/Y', $session->getFin()) : null; if ($dateFin < $deadline) { $this->getFormationInstanceService()->cloturer($session); Loading @@ -57,6 +58,7 @@ class SessionClotureEvent extends EvenementService $nbSession++; } } } } catch(Exception $e) { $evenement->setLog($e->getMessage()); return Etat::ECHEC; Loading