Loading module/Enseignement/src/Form/EnseignementSaisieFieldset.php −2 Changes for module/Enseignement/src/Form/EnseignementSaisieFieldset.php: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ use OffreFormation\Service\Traits\ElementPedagogiqueServiceAwareTrait; use OffreFormation\Service\Traits\EtapeServiceAwareTrait; use OffreFormation\Service\Traits\NiveauEtapeServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenAuthentification\Service\Traits\AuthorizeServiceAwareTrait; /** Loading @@ -37,7 +36,6 @@ class EnseignementSaisieFieldset extends AbstractFieldset use NiveauEtapeServiceAwareTrait; use StructureServiceAwareTrait; use ElementPedagogiqueRechercheFieldsetAwareTrait; use AuthorizeServiceAwareTrait; /** * etablissement par défaut Loading module/Referentiel/config/module.config.php +5 −2 Changes for module/Referentiel/config/module.config.php: 5 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Application\Provider\Privileges; use Laminas\ServiceManager\Factory\InvokableFactory; use Referentiel\Controller\FonctionReferentielController; use Referentiel\Controller\ServiceReferentielController; use Workflow\Entity\Db\WorkflowEtape; return [ Loading Loading @@ -117,6 +116,10 @@ return [ 'constraints' => [ 'serviceReferentiel' => '[0-9]*', ], 'privileges' => [ Privileges::REFERENTIEL_PREVU_EDITION, Privileges::REFERENTIEL_REALISE_EDITION, ], ], 'constatation' => [ 'route' => '/constatation', Loading Loading @@ -241,7 +244,7 @@ return [ ], [ 'controller' => ServiceReferentielController::class, 'action' => ['saisie', 'suppression', 'rafraichir-ligne', 'initialisation', 'constatation'], 'action' => ['saisie', 'suppression', 'initialisation', 'constatation'], 'privileges' => [ Privileges::REFERENTIEL_PREVU_EDITION, Privileges::REFERENTIEL_REALISE_EDITION, Loading module/Referentiel/src/Assertion/ReferentielAssertion.php +35 −3 Changes for module/Referentiel/src/Assertion/ReferentielAssertion.php: 35 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ namespace Referentiel\Assertion; use Application\Provider\Privileges; use Application\Service\LocalContextService; use Application\Service\Traits\ContextServiceAwareTrait; use Doctrine\ORM\EntityManager; use Unicaen\Framework\Authorize\AbstractAssertion; use Unicaen\Framework\Navigation\Page; use Intervenant\Entity\Db\Intervenant; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Lieu\Entity\Db\Structure; Loading @@ -18,6 +19,7 @@ use Service\Entity\Db\TypeVolumeHoraire; use Service\Service\CampagneSaisieServiceAwareTrait; use Service\Service\RegleStructureValidationServiceAwareTrait; use Service\Service\TypeVolumeHoraireServiceAwareTrait; use Unicaen\Framework\Authorize\Authorize; use Workflow\Entity\Db\Validation; use Workflow\Entity\Db\WorkflowEtape; use Workflow\Service\ValidationServiceAwareTrait; Loading @@ -39,6 +41,16 @@ class ReferentielAssertion extends AbstractAssertion use RegleStructureValidationServiceAwareTrait; use ServiceAssertionAwareTrait; public function __construct( Authorize $authorize, private readonly EntityManager $entityManager, private readonly LocalContextService $localContext, ) { parent::__construct($authorize); } /** * @param ResourceInterface $entity Loading Loading @@ -119,12 +131,31 @@ class ReferentielAssertion extends AbstractAssertion */ protected function assertController(string $controller, ?string $action): bool { $intervenant = $this->getParam(Intervenant::class); /* @var $intervenant Intervenant */ $intervenant = $this->getParam(Intervenant::class); if (!$intervenant){ $intervenant = $this->localContext->getIntervenant(); } if (!$this->getAssertionService()->assertIntervenant($intervenant)) return false; // si on n'est pas le bon intervenant!! switch ($controller . '.' . $action) { case ServiceReferentielController::class.'.saisie': case ServiceReferentielController::class.'.suppression': $serviceReferentiel = $this->getParam('id') ? $this->entityManager->find(ServiceReferentiel::class, $this->getParam('id')) : null; if (!$serviceReferentiel){ $serviceReferentiel = new ServiceReferentiel(); $serviceReferentiel->setIntervenant($intervenant); } $typeVolumeHoraireId = $_GET['type-volume-horaire'] ?? null; if ($typeVolumeHoraireId) { $typeVolumeHoraire = $this->entityManager->find(TypeVolumeHoraire::class, $typeVolumeHoraireId); $serviceReferentiel->setTypeVolumeHoraire($typeVolumeHoraire); } return $this->assertServiceReferentielEdition($serviceReferentiel); case ServiceReferentielController::class . '.validationPrevu': return $this->authorize->isAllowedPrivilege(Privileges::REFERENTIEL_PREVU_VISUALISATION); Loading @@ -136,7 +167,6 @@ class ReferentielAssertion extends AbstractAssertion case ServiceReferentielController::class . '.referentiel-realise': return $this->assertPageReferentiel($intervenant, TypeVolumeHoraire::CODE_REALISE); } return false; Loading Loading @@ -213,7 +243,9 @@ class ReferentielAssertion extends AbstractAssertion } $asserts[] = $this->getAssertionService()->assertIntervenant($serviceReferentiel->getIntervenant()); if ($serviceReferentiel->getTypeVolumeHoraire()) { $asserts[] = $this->getAssertionService()->assertCampagneSaisie($serviceReferentiel->getTypeVolumeHoraire()); } $asserts[] = $this->getAssertionService()->assertCloture($serviceReferentiel->getIntervenant()); return $this->asserts($asserts); Loading module/Referentiel/src/Form/SaisieFieldset.php +8 −6 Changes for module/Referentiel/src/Form/SaisieFieldset.php: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -22,9 +22,10 @@ use Referentiel\Entity\Db\ServiceReferentiel; use Referentiel\Service\FonctionReferentielServiceAwareTrait; use Service\Entity\Db\Tag; use Service\Service\TagServiceAwareTrait; use Unicaen\Framework\Application\Application; use Unicaen\Framework\Authorize\Authorize; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenApp\Util; use UnicaenAuthentification\Service\Traits\AuthorizeServiceAwareTrait; /** Loading @@ -40,7 +41,6 @@ class SaisieFieldset extends AbstractFieldset use FonctionReferentielServiceAwareTrait; use TagServiceAwareTrait; use MotifNonPaiementServiceAwareTrait; use AuthorizeServiceAwareTrait; use ContextServiceAwareTrait; /** Loading @@ -48,10 +48,14 @@ class SaisieFieldset extends AbstractFieldset */ protected $structures; protected Authorize $authorize; public function __construct($name = null, $options = []) { $this->authorize = Application::getInstance()->container()->get(Authorize::class); parent::__construct('service', $options); } Loading @@ -66,10 +70,8 @@ class SaisieFieldset extends AbstractFieldset $this->setHydrator($hydrator) ->setAllowedObjectBindingClass(ServiceReferentiel::class); $canViewMNP = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_VISUALISATION)); $canEditMNP = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_EDITION)); $canViewTag = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::TAG_VISUALISATION)); $canEditTag = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::TAG_EDITION)); $canEditMNP = $this->authorize->isAllowedPrivilege(Privileges::MOTIF_NON_PAIEMENT_EDITION); $canEditTag = $this->authorize->isAllowedPrivilege(Privileges::TAG_EDITION); $this->add([ 'name' => 'id', Loading module/Referentiel/src/View/Helper/FormSaisieViewHelper.php +1 −2 Changes for module/Referentiel/src/View/Helper/FormSaisieViewHelper.php: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ EOS; </div> </div> <div class="row"> <div class="col-md-4" id="volumes-horaires" data-url="%s"> <div class="col-md-4" id="volumes-horaires"> $rappelPrevu %s </div> Loading @@ -123,7 +123,6 @@ EOS; $template, $this->getView()->formControlGroup($fservice->get('fonction')), $this->getView()->formControlGroup($fservice->get('structure')), $this->getVolumesHorairesRefreshUrl(), $this->getView()->formControlGroup($fservice->get('heures')) ); Loading Loading
module/Enseignement/src/Form/EnseignementSaisieFieldset.php −2 Changes for module/Enseignement/src/Form/EnseignementSaisieFieldset.php: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ use OffreFormation\Service\Traits\ElementPedagogiqueServiceAwareTrait; use OffreFormation\Service\Traits\EtapeServiceAwareTrait; use OffreFormation\Service\Traits\NiveauEtapeServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenAuthentification\Service\Traits\AuthorizeServiceAwareTrait; /** Loading @@ -37,7 +36,6 @@ class EnseignementSaisieFieldset extends AbstractFieldset use NiveauEtapeServiceAwareTrait; use StructureServiceAwareTrait; use ElementPedagogiqueRechercheFieldsetAwareTrait; use AuthorizeServiceAwareTrait; /** * etablissement par défaut Loading
module/Referentiel/config/module.config.php +5 −2 Changes for module/Referentiel/config/module.config.php: 5 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Application\Provider\Privileges; use Laminas\ServiceManager\Factory\InvokableFactory; use Referentiel\Controller\FonctionReferentielController; use Referentiel\Controller\ServiceReferentielController; use Workflow\Entity\Db\WorkflowEtape; return [ Loading Loading @@ -117,6 +116,10 @@ return [ 'constraints' => [ 'serviceReferentiel' => '[0-9]*', ], 'privileges' => [ Privileges::REFERENTIEL_PREVU_EDITION, Privileges::REFERENTIEL_REALISE_EDITION, ], ], 'constatation' => [ 'route' => '/constatation', Loading Loading @@ -241,7 +244,7 @@ return [ ], [ 'controller' => ServiceReferentielController::class, 'action' => ['saisie', 'suppression', 'rafraichir-ligne', 'initialisation', 'constatation'], 'action' => ['saisie', 'suppression', 'initialisation', 'constatation'], 'privileges' => [ Privileges::REFERENTIEL_PREVU_EDITION, Privileges::REFERENTIEL_REALISE_EDITION, Loading
module/Referentiel/src/Assertion/ReferentielAssertion.php +35 −3 Changes for module/Referentiel/src/Assertion/ReferentielAssertion.php: 35 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ namespace Referentiel\Assertion; use Application\Provider\Privileges; use Application\Service\LocalContextService; use Application\Service\Traits\ContextServiceAwareTrait; use Doctrine\ORM\EntityManager; use Unicaen\Framework\Authorize\AbstractAssertion; use Unicaen\Framework\Navigation\Page; use Intervenant\Entity\Db\Intervenant; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Lieu\Entity\Db\Structure; Loading @@ -18,6 +19,7 @@ use Service\Entity\Db\TypeVolumeHoraire; use Service\Service\CampagneSaisieServiceAwareTrait; use Service\Service\RegleStructureValidationServiceAwareTrait; use Service\Service\TypeVolumeHoraireServiceAwareTrait; use Unicaen\Framework\Authorize\Authorize; use Workflow\Entity\Db\Validation; use Workflow\Entity\Db\WorkflowEtape; use Workflow\Service\ValidationServiceAwareTrait; Loading @@ -39,6 +41,16 @@ class ReferentielAssertion extends AbstractAssertion use RegleStructureValidationServiceAwareTrait; use ServiceAssertionAwareTrait; public function __construct( Authorize $authorize, private readonly EntityManager $entityManager, private readonly LocalContextService $localContext, ) { parent::__construct($authorize); } /** * @param ResourceInterface $entity Loading Loading @@ -119,12 +131,31 @@ class ReferentielAssertion extends AbstractAssertion */ protected function assertController(string $controller, ?string $action): bool { $intervenant = $this->getParam(Intervenant::class); /* @var $intervenant Intervenant */ $intervenant = $this->getParam(Intervenant::class); if (!$intervenant){ $intervenant = $this->localContext->getIntervenant(); } if (!$this->getAssertionService()->assertIntervenant($intervenant)) return false; // si on n'est pas le bon intervenant!! switch ($controller . '.' . $action) { case ServiceReferentielController::class.'.saisie': case ServiceReferentielController::class.'.suppression': $serviceReferentiel = $this->getParam('id') ? $this->entityManager->find(ServiceReferentiel::class, $this->getParam('id')) : null; if (!$serviceReferentiel){ $serviceReferentiel = new ServiceReferentiel(); $serviceReferentiel->setIntervenant($intervenant); } $typeVolumeHoraireId = $_GET['type-volume-horaire'] ?? null; if ($typeVolumeHoraireId) { $typeVolumeHoraire = $this->entityManager->find(TypeVolumeHoraire::class, $typeVolumeHoraireId); $serviceReferentiel->setTypeVolumeHoraire($typeVolumeHoraire); } return $this->assertServiceReferentielEdition($serviceReferentiel); case ServiceReferentielController::class . '.validationPrevu': return $this->authorize->isAllowedPrivilege(Privileges::REFERENTIEL_PREVU_VISUALISATION); Loading @@ -136,7 +167,6 @@ class ReferentielAssertion extends AbstractAssertion case ServiceReferentielController::class . '.referentiel-realise': return $this->assertPageReferentiel($intervenant, TypeVolumeHoraire::CODE_REALISE); } return false; Loading Loading @@ -213,7 +243,9 @@ class ReferentielAssertion extends AbstractAssertion } $asserts[] = $this->getAssertionService()->assertIntervenant($serviceReferentiel->getIntervenant()); if ($serviceReferentiel->getTypeVolumeHoraire()) { $asserts[] = $this->getAssertionService()->assertCampagneSaisie($serviceReferentiel->getTypeVolumeHoraire()); } $asserts[] = $this->getAssertionService()->assertCloture($serviceReferentiel->getIntervenant()); return $this->asserts($asserts); Loading
module/Referentiel/src/Form/SaisieFieldset.php +8 −6 Changes for module/Referentiel/src/Form/SaisieFieldset.php: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -22,9 +22,10 @@ use Referentiel\Entity\Db\ServiceReferentiel; use Referentiel\Service\FonctionReferentielServiceAwareTrait; use Service\Entity\Db\Tag; use Service\Service\TagServiceAwareTrait; use Unicaen\Framework\Application\Application; use Unicaen\Framework\Authorize\Authorize; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenApp\Util; use UnicaenAuthentification\Service\Traits\AuthorizeServiceAwareTrait; /** Loading @@ -40,7 +41,6 @@ class SaisieFieldset extends AbstractFieldset use FonctionReferentielServiceAwareTrait; use TagServiceAwareTrait; use MotifNonPaiementServiceAwareTrait; use AuthorizeServiceAwareTrait; use ContextServiceAwareTrait; /** Loading @@ -48,10 +48,14 @@ class SaisieFieldset extends AbstractFieldset */ protected $structures; protected Authorize $authorize; public function __construct($name = null, $options = []) { $this->authorize = Application::getInstance()->container()->get(Authorize::class); parent::__construct('service', $options); } Loading @@ -66,10 +70,8 @@ class SaisieFieldset extends AbstractFieldset $this->setHydrator($hydrator) ->setAllowedObjectBindingClass(ServiceReferentiel::class); $canViewMNP = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_VISUALISATION)); $canEditMNP = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_EDITION)); $canViewTag = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::TAG_VISUALISATION)); $canEditTag = $this->getServiceAuthorize()->isAllowed(Privileges::getResourceId(Privileges::TAG_EDITION)); $canEditMNP = $this->authorize->isAllowedPrivilege(Privileges::MOTIF_NON_PAIEMENT_EDITION); $canEditTag = $this->authorize->isAllowedPrivilege(Privileges::TAG_EDITION); $this->add([ 'name' => 'id', Loading
module/Referentiel/src/View/Helper/FormSaisieViewHelper.php +1 −2 Changes for module/Referentiel/src/View/Helper/FormSaisieViewHelper.php: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ EOS; </div> </div> <div class="row"> <div class="col-md-4" id="volumes-horaires" data-url="%s"> <div class="col-md-4" id="volumes-horaires"> $rappelPrevu %s </div> Loading @@ -123,7 +123,6 @@ EOS; $template, $this->getView()->formControlGroup($fservice->get('fonction')), $this->getView()->formControlGroup($fservice->get('structure')), $this->getVolumesHorairesRefreshUrl(), $this->getView()->formControlGroup($fservice->get('heures')) ); Loading