Skip to content
Snippets Groups Projects
Commit 29016b79 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

...

parent 7af41074
No related branches found
No related tags found
No related merge requests found
...@@ -151,12 +151,14 @@ class SeanceController extends AbstractActionController ...@@ -151,12 +151,14 @@ class SeanceController extends AbstractActionController
public function gererEvenement(Seance $seance): void public function gererEvenement(Seance $seance): void
{ {
if ($seance->isPremiereSeance()) { $first = $seance->isPremiereSeance();
$last = $seance->isDerniereSeance();
if ($first) {
$this->getInscriptionClotureEvent()->updateEvent($seance); $this->getInscriptionClotureEvent()->updateEvent($seance);
$this->getConvocationEvent()->updateEvent($seance); $this->getConvocationEvent()->updateEvent($seance);
$this->getRappelAgentEvent()->updateEvent($seance); $this->getRappelAgentEvent()->updateEvent($seance);
} }
if ($seance->isDerniereSeance()) { if ($last) {
$this->getDemandeRetourEvent()->updateEvent($seance); $this->getDemandeRetourEvent()->updateEvent($seance);
$this->getSessionClotureEvent()->updateEvent($seance); $this->getSessionClotureEvent()->updateEvent($seance);
} }
......
...@@ -149,7 +149,7 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface ...@@ -149,7 +149,7 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface
$asString = $this->getJour()->format('d/m/Y') . " " . $this->getFin(); $asString = $this->getJour()->format('d/m/Y') . " " . $this->getFin();
return DateTime::createFromFormat('d/m/Y H:i', $asString); return DateTime::createFromFormat('d/m/Y H:i', $asString);
case Seance::TYPE_VOLUME : case Seance::TYPE_VOLUME :
$asString = $this->getVolumeFin()->format('d/m/Y') . " 08:00"; $asString = $this->getVolumeFin()->format('d/m/Y') . " 18:00";
return DateTime::createFromFormat('d/m/Y H:i', $asString); return DateTime::createFromFormat('d/m/Y H:i', $asString);
} }
throw new RuntimeException("Le type de seance est inconnu"); throw new RuntimeException("Le type de seance est inconnu");
...@@ -222,7 +222,11 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface ...@@ -222,7 +222,11 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface
public function isDerniereSeance(): bool public function isDerniereSeance(): bool
{ {
$session = $this->getInstance(); $session = $this->getInstance();
$res = ($session->getSeances() === null OR $session->getSeances() === [] OR $this->getDateFin()->format('d/m/Y H:i') === $session->getFin()); $isNull = ($session->getSeances() === null);
$isEmpty = ($session->getSeances() === []);
$isLast = ($this->getDateFin()->format('d/m/Y H:i') === $session->getFin());
$res = ($isNull OR $isEmpty OR $isLast);
return $res; return $res;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment