Loading module/Application/src/Assertion/ServiceAssertion.php +31 −5 Changes for module/Application/src/Assertion/ServiceAssertion.php: 31 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertPage(array $page) { $role = $this->getRole(); Loading Loading @@ -95,6 +96,7 @@ class ServiceAssertion extends AbstractAssertion } /** * @param ResourceInterface $entity * @param string $privilege Loading Loading @@ -206,6 +208,7 @@ class ServiceAssertion extends AbstractAssertion } /** * @param string $controller * @param string $action Loading Loading @@ -249,6 +252,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertPageServices(Role $role, Intervenant $intervenant = null, string $typeVolumeHoraireCode) { if (!$intervenant) return true; Loading @@ -274,6 +278,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertEnseignements(Role $role) { return $this->asserts([ Loading @@ -288,6 +293,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertImportAgenda(Role $role) { return true; Loading @@ -295,6 +301,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceVisualisation(Role $role, Service $service) { $typeVolumeHoraire = $service->getTypeVolumeHoraire(); Loading @@ -318,6 +325,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielVisualisation(Role $role, ServiceReferentiel $serviceReferentiel) { $typeVolumeHoraire = $serviceReferentiel->getTypeVolumeHoraire(); Loading @@ -341,6 +349,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceEdition(Role $role, Service $service) { $structure = $role->getStructure(); Loading Loading @@ -373,6 +382,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielEdition(Role $role, ServiceReferentiel $serviceReferentiel) { $asserts = []; Loading Loading @@ -403,18 +413,19 @@ class ServiceAssertion extends AbstractAssertion } protected function assertHasServices(Intervenant $intervenant, Structure $structure, string $etape, Role $role) { $services = $intervenant->getService(); $serviceEnComposanteAffectation = []; $serviceHorsComposanteAffectation = []; $typeIntervenant = $intervenant->getStatut()->getTypeIntervenant(); foreach ($services as $service) { if ($service->getHistoDestruction()) continue; if (!$service->getElementPedagogique()) continue; $typeIntervenant = $service->getIntervenant()->getStatut()->getTypeIntervenant(); $intervenantStructure = $service->getIntervenant()->getStructure(); $serviceStructure = $service->getElementPedagogique()->getStructure(); if ($intervenantStructure == $serviceStructure) { Loading @@ -422,7 +433,6 @@ class ServiceAssertion extends AbstractAssertion } else { $serviceHorsComposanteAffectation[] = $service; } } $reglesValidation = $this->getServiceRegleStructureValidation()->getList(); Loading @@ -438,7 +448,6 @@ class ServiceAssertion extends AbstractAssertion return true; } } } if ($etape == WfEtape::CODE_SERVICE_VALIDATION_REALISE && $regle->getTypeVolumeHoraire()->getCode() == 'REALISE') { Loading @@ -450,9 +459,7 @@ class ServiceAssertion extends AbstractAssertion return true; } } } } Loading @@ -460,6 +467,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertCampagneSaisie(Role $role, TypeVolumeHoraire $typeVolumeHoraire) { if ($typeVolumeHoraire && $role->getIntervenant()) { Loading @@ -474,6 +482,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertCloture(Role $role, Intervenant $intervenant) { if ($intervenant->getStatut()->getCloture()) { Loading @@ -494,6 +503,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceVisualisationValidation(Role $role, Service $service) { $wfEtape = $this->getWorkflowEtape($service->getTypeVolumeHoraire(), 'validation-enseignement'); Loading @@ -505,6 +515,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertVolumeHoraireValidation(Role $role, VolumeHoraire $volumeHoraire) { $service = $volumeHoraire->getService(); Loading @@ -513,12 +524,14 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceValidation(Role $role, Service $service) { return $this->assertValidation($role, $service->getIntervenant(), $service->getStructure()); } protected function assertVolumeHoraireReferentielValidation(Role $role, VolumeHoraireReferentiel $volumeHoraireReferentiel) { $serviceReferentiel = $volumeHoraireReferentiel->getServiceReferentiel(); Loading @@ -527,12 +540,14 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielValidation(Role $role, ServiceReferentiel $serviceReferentiel) { return $this->assert($role, $serviceReferentiel->getIntervenant(), $serviceReferentiel->getStructure()); } protected function assertValidationValidation(Role $role, Validation $validation) { return $this->asserts([ Loading @@ -542,6 +557,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertValidation(Role $role, Intervenant $intervenant, ?Structure $structure) { return $this->asserts([ Loading @@ -551,6 +567,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertValidationDevalidation(Role $role, Validation $validation) { return $this->asserts([ Loading @@ -561,6 +578,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceExterieur(Role $role, Service $service) { return $this->asserts([ Loading @@ -569,6 +587,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantServiceExterieur(Role $role, Intervenant $intervenant) { return $this->asserts([ Loading @@ -578,6 +597,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertMotifNonPaiement(Role $role, Intervenant $intervenant) { // filtrer pour la structure ? ? Loading @@ -588,6 +608,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenant(Role $role, Intervenant $intervenant = null) { if ($intervenant) { Loading @@ -602,6 +623,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantService( Role $role, Intervenant $intervenant, Loading @@ -623,6 +645,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantReferentiel( Role $role, Intervenant $intervenant, Loading @@ -644,6 +667,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertStructure(Role $role, ?Structure $structure = null) { if ($structure) { Loading @@ -658,6 +682,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertEtapeAtteignable($etape, Intervenant $intervenant = null) { if ($intervenant) { Loading @@ -671,6 +696,7 @@ class ServiceAssertion extends AbstractAssertion } private function getWorkflowEtape(TypeVolumeHoraire $typeVolumeHoraire, $action) { $key = $action . '-' . strtolower($typeVolumeHoraire->getCode()); Loading Loading
module/Application/src/Assertion/ServiceAssertion.php +31 −5 Changes for module/Application/src/Assertion/ServiceAssertion.php: 31 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertPage(array $page) { $role = $this->getRole(); Loading Loading @@ -95,6 +96,7 @@ class ServiceAssertion extends AbstractAssertion } /** * @param ResourceInterface $entity * @param string $privilege Loading Loading @@ -206,6 +208,7 @@ class ServiceAssertion extends AbstractAssertion } /** * @param string $controller * @param string $action Loading Loading @@ -249,6 +252,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertPageServices(Role $role, Intervenant $intervenant = null, string $typeVolumeHoraireCode) { if (!$intervenant) return true; Loading @@ -274,6 +278,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertEnseignements(Role $role) { return $this->asserts([ Loading @@ -288,6 +293,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertImportAgenda(Role $role) { return true; Loading @@ -295,6 +301,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceVisualisation(Role $role, Service $service) { $typeVolumeHoraire = $service->getTypeVolumeHoraire(); Loading @@ -318,6 +325,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielVisualisation(Role $role, ServiceReferentiel $serviceReferentiel) { $typeVolumeHoraire = $serviceReferentiel->getTypeVolumeHoraire(); Loading @@ -341,6 +349,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceEdition(Role $role, Service $service) { $structure = $role->getStructure(); Loading Loading @@ -373,6 +382,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielEdition(Role $role, ServiceReferentiel $serviceReferentiel) { $asserts = []; Loading Loading @@ -403,18 +413,19 @@ class ServiceAssertion extends AbstractAssertion } protected function assertHasServices(Intervenant $intervenant, Structure $structure, string $etape, Role $role) { $services = $intervenant->getService(); $serviceEnComposanteAffectation = []; $serviceHorsComposanteAffectation = []; $typeIntervenant = $intervenant->getStatut()->getTypeIntervenant(); foreach ($services as $service) { if ($service->getHistoDestruction()) continue; if (!$service->getElementPedagogique()) continue; $typeIntervenant = $service->getIntervenant()->getStatut()->getTypeIntervenant(); $intervenantStructure = $service->getIntervenant()->getStructure(); $serviceStructure = $service->getElementPedagogique()->getStructure(); if ($intervenantStructure == $serviceStructure) { Loading @@ -422,7 +433,6 @@ class ServiceAssertion extends AbstractAssertion } else { $serviceHorsComposanteAffectation[] = $service; } } $reglesValidation = $this->getServiceRegleStructureValidation()->getList(); Loading @@ -438,7 +448,6 @@ class ServiceAssertion extends AbstractAssertion return true; } } } if ($etape == WfEtape::CODE_SERVICE_VALIDATION_REALISE && $regle->getTypeVolumeHoraire()->getCode() == 'REALISE') { Loading @@ -450,9 +459,7 @@ class ServiceAssertion extends AbstractAssertion return true; } } } } Loading @@ -460,6 +467,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertCampagneSaisie(Role $role, TypeVolumeHoraire $typeVolumeHoraire) { if ($typeVolumeHoraire && $role->getIntervenant()) { Loading @@ -474,6 +482,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertCloture(Role $role, Intervenant $intervenant) { if ($intervenant->getStatut()->getCloture()) { Loading @@ -494,6 +503,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceVisualisationValidation(Role $role, Service $service) { $wfEtape = $this->getWorkflowEtape($service->getTypeVolumeHoraire(), 'validation-enseignement'); Loading @@ -505,6 +515,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertVolumeHoraireValidation(Role $role, VolumeHoraire $volumeHoraire) { $service = $volumeHoraire->getService(); Loading @@ -513,12 +524,14 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceValidation(Role $role, Service $service) { return $this->assertValidation($role, $service->getIntervenant(), $service->getStructure()); } protected function assertVolumeHoraireReferentielValidation(Role $role, VolumeHoraireReferentiel $volumeHoraireReferentiel) { $serviceReferentiel = $volumeHoraireReferentiel->getServiceReferentiel(); Loading @@ -527,12 +540,14 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceReferentielValidation(Role $role, ServiceReferentiel $serviceReferentiel) { return $this->assert($role, $serviceReferentiel->getIntervenant(), $serviceReferentiel->getStructure()); } protected function assertValidationValidation(Role $role, Validation $validation) { return $this->asserts([ Loading @@ -542,6 +557,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertValidation(Role $role, Intervenant $intervenant, ?Structure $structure) { return $this->asserts([ Loading @@ -551,6 +567,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertValidationDevalidation(Role $role, Validation $validation) { return $this->asserts([ Loading @@ -561,6 +578,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertServiceExterieur(Role $role, Service $service) { return $this->asserts([ Loading @@ -569,6 +587,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantServiceExterieur(Role $role, Intervenant $intervenant) { return $this->asserts([ Loading @@ -578,6 +597,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertMotifNonPaiement(Role $role, Intervenant $intervenant) { // filtrer pour la structure ? ? Loading @@ -588,6 +608,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenant(Role $role, Intervenant $intervenant = null) { if ($intervenant) { Loading @@ -602,6 +623,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantService( Role $role, Intervenant $intervenant, Loading @@ -623,6 +645,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertIntervenantReferentiel( Role $role, Intervenant $intervenant, Loading @@ -644,6 +667,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertStructure(Role $role, ?Structure $structure = null) { if ($structure) { Loading @@ -658,6 +682,7 @@ class ServiceAssertion extends AbstractAssertion } protected function assertEtapeAtteignable($etape, Intervenant $intervenant = null) { if ($intervenant) { Loading @@ -671,6 +696,7 @@ class ServiceAssertion extends AbstractAssertion } private function getWorkflowEtape(TypeVolumeHoraire $typeVolumeHoraire, $action) { $key = $action . '-' . strtolower($typeVolumeHoraire->getCode()); Loading