Commit f6324ec7 authored by joriot221's avatar joriot221
Browse files

Modification de la fiche intervenant pour qu'un gestionaire puisse mettre du...

Modification de la fiche intervenant pour qu'un gestionaire puisse mettre du service référentiel sur un intervenant n'étant pas de sa composante
parent 3779b6e1
Loading
Loading
Loading
Loading
+4 −1
Changes for module/Application/src/Controller/ServiceReferentielController.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ class ServiceReferentielController extends AbstractController
            $typeVolumeHoraire = $this->getServiceTypeVolumehoraire()->get($typeVolumeHoraire);
        }
        $service = $this->getServiceServiceReferentiel();
        //$role    = $this->getServiceContext()->getSelectedIdentityRole();
        $role    = $this->getServiceContext()->getSelectedIdentityRole();
        $form    = $this->getFormServiceReferentielSaisie();
        $form->get('type-volume-horaire')->setValue($typeVolumeHoraire->getId());

@@ -136,6 +136,9 @@ class ServiceReferentielController extends AbstractController
        $assertionEntity
            ->setTypeVolumeHoraire($typeVolumeHoraire)
            ->setIntervenant($intervenant);
        if ($assertionEntity->getStructure() == null) {
            $assertionEntity->setStructure($role->getStructure());
        }
        if (!$this->isAllowed($assertionEntity, Privileges::REFERENTIEL_EDITION)) {
            throw new \LogicException("Cette opération n'est pas autorisée.");
        }
+1 −0
Changes for module/Application/view/application/intervenant/services.phtml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ $canAddService = $this->isAllowed($service, Privileges::ENSEIGNEMENT_EDITION);
$serviceReferentiel = new \Application\Entity\Db\ServiceReferentiel();
$serviceReferentiel->setIntervenant($intervenant);
$serviceReferentiel->setTypeVolumeHoraire($typeVolumeHoraire);
$serviceReferentiel->setStructure($role->getStructure());
$canAddServiceReferentiel = $this->isAllowed($serviceReferentiel, Privileges::REFERENTIEL_EDITION);

if ($typeVolumeHoraire->isPrevu()) {