Commit 995e720d authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files
parent 55c7234d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -740,6 +740,14 @@ class ServiceService extends AbstractEntityService

    public function setRealisesFromPrevus(Service $service)
    {
        $role       = $this->getServiceContext()->getSelectedIdentityRole();
        $rStructure = $role ? $role->getStructure() : null;
        $sStructure = $service->getElementPedagogique() ? $service->getElementPedagogique()->getStructure() : null;

        if ($rStructure && $sStructure && $rStructure != $sStructure) {
            return; // on ne reporte pas de service si l'utilisateur est d'une composante différente de celle du service
        }

        $prevus = $service
            ->getVolumeHoraireListe()->createChild()
            ->setTypeVolumeHoraire($this->getServiceTypeVolumeHoraire()->getPrevu())