Loading documentation/release/3.2.1.md +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ Version 3.2.1 (10/05/2023) - Formulaire de saisie des chaînes hiérarchiques pour un agent - Correction de la modale de convocation qui ne fermait plus - Utilisation d'un paramètre pour les temoins d'affectation pour la liste des agents passant un EP - [Fix] : AgentAffichageAssertion était mal déclarée --- Loading module/Application/config/merged/agent.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ return [ 'options' => [ 'route' => '/rechercher-large', 'defaults' => [ /** @see AgentController::rechercherLargeAction() */ 'controller' => AgentController::class, 'action' => 'rechercher-large', ], Loading module/Application/src/Application/Assertion/AgentAffichageAssertion.php +14 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ use Application\Service\AgentSuperieur\AgentSuperieurServiceAwareTrait; use Structure\Provider\Role\RoleProvider as StructureRoleProvider; use Structure\Service\Structure\StructureServiceAwareTrait; use UnicaenPrivilege\Assertion\AbstractAssertion; use UnicaenPrivilege\Service\Privilege\PrivilegeCategorieServiceAwareTrait; use UnicaenPrivilege\Service\Privilege\PrivilegeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserServiceAwareTrait; use Laminas\Permissions\Acl\Resource\ResourceInterface; Loading @@ -26,7 +28,10 @@ class AgentAffichageAssertion extends AbstractAssertion use StructureServiceAwareTrait; use UserServiceAwareTrait; protected function assertEntity(ResourceInterface $entity = null, $privilege = null): bool use PrivilegeCategorieServiceAwareTrait; use PrivilegeServiceAwareTrait; public function assertEntity(ResourceInterface $entity = null, $privilege = null): bool { if (!$entity instanceof Agent) { return false; Loading @@ -37,6 +42,14 @@ class AgentAffichageAssertion extends AbstractAssertion $agent = $this->getAgentService()->getAgentByUser($user); $role = $this->getUserService()->getConnectedRole(); //todo QUESTION : pourquoi devoir faire cela c'est pas normal !!! [$catCode, $priCode] = explode('-', $privilege); $categorie = $this->getPrivilegeCategorieService()->findByCode($catCode); $pprivilege = $this->getPrivilegeService()->findByCode($priCode, $categorie->getId()); $listings = $pprivilege->getRoles()->toArray(); if (!in_array($role, $listings)) return false; //todo FIN BIZARERIE ... $structures = []; foreach ($entity->getAffectations() as $affectation) { $structures[] = $affectation->getStructure(); Loading module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php +14 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Structure\Service\Structure\StructureService; use UnicaenPrivilege\Service\Privilege\PrivilegeCategorieService; use UnicaenPrivilege\Service\Privilege\PrivilegeService; use UnicaenPrivilege\Service\Privilege\PrivilegeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserService; use Laminas\Mvc\Application; Loading @@ -21,7 +24,7 @@ class AgentAffichageAssertionFactory { * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container): AgentAssertion public function __invoke(ContainerInterface $container): AgentAffichageAssertion { /** * @var AgentService $agentService Loading @@ -30,6 +33,9 @@ class AgentAffichageAssertionFactory { * @var AgentAffectationService $agentAffectationService * @var StructureService $structureService * @var UserService $userService * * @var PrivilegeService $privilegeService * @var PrivilegeCategorieService $categorieService */ $agentService = $container->get(AgentService::class); $agentAutoriteService = $container->get(AgentAutoriteService::class); Loading @@ -38,8 +44,10 @@ class AgentAffichageAssertionFactory { $structureService = $container->get(StructureService::class); $userService = $container->get(UserService::class); /** @var AgentAssertion $assertion */ $assertion = new AgentAssertion(); $privilegeService = $container->get(PrivilegeService::class); $categorieService = $container->get(PrivilegeCategorieService::class); $assertion = new AgentAffichageAssertion(); $assertion->setAgentService($agentService); $assertion->setAgentAutoriteService($agentAutoriteService); $assertion->setAgentSuperieurService($agentSuperieurService); Loading @@ -47,6 +55,9 @@ class AgentAffichageAssertionFactory { $assertion->setStructureService($structureService); $assertion->setUserService($userService); $assertion->setPrivilegeService($privilegeService); $assertion->setPrivilegeCategorieService($categorieService); /* @var $application Application */ $application = $container->get('Application'); $mvcEvent = $application->getMvcEvent(); Loading module/Application/src/Application/Controller/AgentController.php +2 −4 Original line number Diff line number Diff line Loading @@ -301,11 +301,8 @@ class AgentController extends AbstractActionController return $vm; } //TODO fix that ... public function revoquerElementAction() : Response { $retour = $this->params()->fromQuery('retour'); $validation = $this->getValidationInstanceService()->getRequestedValidationInstance($this); $this->getValidationInstanceService()->historise($validation); Loading @@ -318,8 +315,9 @@ class AgentController extends AbstractActionController throw new RuntimeException("Un problème est survenue lors de l'enregistrement en base."); } $retour = $this->params()->fromQuery('retour'); if ($retour !== null) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('agent/afficher', ['agent' => $entity->getAgent()->getId()], [], true); return $this->redirect()->toRoute('home', [],[], true); } /** Fichier associé à l'agent *************************************************************************************/ Loading Loading
documentation/release/3.2.1.md +2 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ Version 3.2.1 (10/05/2023) - Formulaire de saisie des chaînes hiérarchiques pour un agent - Correction de la modale de convocation qui ne fermait plus - Utilisation d'un paramètre pour les temoins d'affectation pour la liste des agents passant un EP - [Fix] : AgentAffichageAssertion était mal déclarée --- Loading
module/Application/config/merged/agent.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ return [ 'options' => [ 'route' => '/rechercher-large', 'defaults' => [ /** @see AgentController::rechercherLargeAction() */ 'controller' => AgentController::class, 'action' => 'rechercher-large', ], Loading
module/Application/src/Application/Assertion/AgentAffichageAssertion.php +14 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ use Application\Service\AgentSuperieur\AgentSuperieurServiceAwareTrait; use Structure\Provider\Role\RoleProvider as StructureRoleProvider; use Structure\Service\Structure\StructureServiceAwareTrait; use UnicaenPrivilege\Assertion\AbstractAssertion; use UnicaenPrivilege\Service\Privilege\PrivilegeCategorieServiceAwareTrait; use UnicaenPrivilege\Service\Privilege\PrivilegeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserServiceAwareTrait; use Laminas\Permissions\Acl\Resource\ResourceInterface; Loading @@ -26,7 +28,10 @@ class AgentAffichageAssertion extends AbstractAssertion use StructureServiceAwareTrait; use UserServiceAwareTrait; protected function assertEntity(ResourceInterface $entity = null, $privilege = null): bool use PrivilegeCategorieServiceAwareTrait; use PrivilegeServiceAwareTrait; public function assertEntity(ResourceInterface $entity = null, $privilege = null): bool { if (!$entity instanceof Agent) { return false; Loading @@ -37,6 +42,14 @@ class AgentAffichageAssertion extends AbstractAssertion $agent = $this->getAgentService()->getAgentByUser($user); $role = $this->getUserService()->getConnectedRole(); //todo QUESTION : pourquoi devoir faire cela c'est pas normal !!! [$catCode, $priCode] = explode('-', $privilege); $categorie = $this->getPrivilegeCategorieService()->findByCode($catCode); $pprivilege = $this->getPrivilegeService()->findByCode($priCode, $categorie->getId()); $listings = $pprivilege->getRoles()->toArray(); if (!in_array($role, $listings)) return false; //todo FIN BIZARERIE ... $structures = []; foreach ($entity->getAffectations() as $affectation) { $structures[] = $affectation->getStructure(); Loading
module/Application/src/Application/Assertion/AgentAffichageAssertionFactory.php +14 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Structure\Service\Structure\StructureService; use UnicaenPrivilege\Service\Privilege\PrivilegeCategorieService; use UnicaenPrivilege\Service\Privilege\PrivilegeService; use UnicaenPrivilege\Service\Privilege\PrivilegeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserService; use Laminas\Mvc\Application; Loading @@ -21,7 +24,7 @@ class AgentAffichageAssertionFactory { * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container): AgentAssertion public function __invoke(ContainerInterface $container): AgentAffichageAssertion { /** * @var AgentService $agentService Loading @@ -30,6 +33,9 @@ class AgentAffichageAssertionFactory { * @var AgentAffectationService $agentAffectationService * @var StructureService $structureService * @var UserService $userService * * @var PrivilegeService $privilegeService * @var PrivilegeCategorieService $categorieService */ $agentService = $container->get(AgentService::class); $agentAutoriteService = $container->get(AgentAutoriteService::class); Loading @@ -38,8 +44,10 @@ class AgentAffichageAssertionFactory { $structureService = $container->get(StructureService::class); $userService = $container->get(UserService::class); /** @var AgentAssertion $assertion */ $assertion = new AgentAssertion(); $privilegeService = $container->get(PrivilegeService::class); $categorieService = $container->get(PrivilegeCategorieService::class); $assertion = new AgentAffichageAssertion(); $assertion->setAgentService($agentService); $assertion->setAgentAutoriteService($agentAutoriteService); $assertion->setAgentSuperieurService($agentSuperieurService); Loading @@ -47,6 +55,9 @@ class AgentAffichageAssertionFactory { $assertion->setStructureService($structureService); $assertion->setUserService($userService); $assertion->setPrivilegeService($privilegeService); $assertion->setPrivilegeCategorieService($categorieService); /* @var $application Application */ $application = $container->get('Application'); $mvcEvent = $application->getMvcEvent(); Loading
module/Application/src/Application/Controller/AgentController.php +2 −4 Original line number Diff line number Diff line Loading @@ -301,11 +301,8 @@ class AgentController extends AbstractActionController return $vm; } //TODO fix that ... public function revoquerElementAction() : Response { $retour = $this->params()->fromQuery('retour'); $validation = $this->getValidationInstanceService()->getRequestedValidationInstance($this); $this->getValidationInstanceService()->historise($validation); Loading @@ -318,8 +315,9 @@ class AgentController extends AbstractActionController throw new RuntimeException("Un problème est survenue lors de l'enregistrement en base."); } $retour = $this->params()->fromQuery('retour'); if ($retour !== null) return $this->redirect()->toUrl($retour); return $this->redirect()->toRoute('agent/afficher', ['agent' => $entity->getAgent()->getId()], [], true); return $this->redirect()->toRoute('home', [],[], true); } /** Fichier associé à l'agent *************************************************************************************/ Loading