diff --git a/module/Formation/src/Formation/Service/Inscription/InscriptionService.php b/module/Formation/src/Formation/Service/Inscription/InscriptionService.php index ffec255e0d216f956e67b16eae358c8479048720..d8128daad32a35c2e0e3fb176a615830bcaf350e 100644 --- a/module/Formation/src/Formation/Service/Inscription/InscriptionService.php +++ b/module/Formation/src/Formation/Service/Inscription/InscriptionService.php @@ -359,11 +359,14 @@ class InscriptionService public function checkDisponibiliteAgent(?Agent $agent, Seance $seance) : array { + if ($seance->getType() === Seance::TYPE_VOLUME) return []; + $probleme = []; $inscriptions = $this->getInscriptionsByAgent($agent); $inscriptions = array_filter($inscriptions, function (Inscription $inscription) { return !$inscription->isEtatActif(InscriptionEtats::ETAT_DESISTEMENT);}); foreach ($inscriptions as $inscription) { $seances = $inscription->getSession()->getSeances(); + $seances = array_filter($seances, function (Seance $s) { return $s->getType() !== Seance::TYPE_VOLUME; }); foreach ($seances as $sessionSeance) { if (Seance::hasIntersectionNonNulle($seance, $sessionSeance)) $probleme[$seance->getId()] = $sessionSeance; }