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

Correction du calcul de disponibilité

parent fc68e80c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment