Loading data/SQL/sygal/pdc_ordre_role.sql Empty file added. data/role.config.php +73 Changes for data/role.config.php: 73 added lines, 0 removed lines. Original line number Diff line number Diff line <?php // // //use Application\Controller\Factory\RoleControllerFactory; //use Application\Controller\RoleController; //use UnicaenAuth\Guard\PrivilegeController; //use Zend\Mvc\Router\Http\Literal; //use Zend\Mvc\Router\Http\Segment; // //return [ // 'bjyauthorize' => [ // 'guards' => [ // RoleController::class => [ // [ // 'controller' => RoleController::class, // 'action' => [ // 'index', // ], // 'roles' => [], // //'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_CONSULTATION, // ], // ], // ], // ], // // 'router' => [ // 'routes' => [ // 'role-affichage' => [ // 'type' => Literal::class, // 'options' => [ // 'route' => '/role-affichage', // 'defaults' => [ // 'controller' => RoleController::class, // 'action' => 'index', // ], // ], // 'may_terminate' => true, // 'child_routes' => [ // ], // ], // // ], // ], // 'navigation' => [ // 'default' => [ // 'home' => [ // 'pages' => [ // 'admin' => [ // 'pages' => [ // ], // ], // ], // ], // ], // ], // 'service_manager' => [ // 'factories' => [], // ], // 'controllers' => [ // 'factories' => [ // RoleController::class => RoleControllerFactory::class, // ], // ], // 'form_elements' => [ // 'factories' => [], // ], // 'hydrators' => [ // 'factories' => [], // ], // 'view_helpers' => [ // 'invokables' => [], // ], //]; module/Application/config/others/admin.config.php +47 Changes for module/Application/config/others/admin.config.php: 47 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,9 @@ use Application\Controller\AdminController; use Application\Controller\Factory\PrivilegeControllerFactory; use Application\Controller\Factory\RoleControllerFactory; use Application\Controller\MailConfirmationController; use Application\Controller\RoleController; use Application\Provider\Privilege\EcoleDoctoralePrivileges; use Application\Provider\Privilege\UniteRecherchePrivileges; use Application\Provider\Privilege\UtilisateurPrivileges; Loading @@ -20,6 +22,17 @@ return [ 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ [ 'controller' => RoleController::class, 'action' => [ 'index', 'incrementer-ordre', 'decrementer-ordre', ], 'roles' => [ 'Administrateur technique' ], ], [ 'controller' => 'Application\Controller\Admin', 'action' => [ Loading Loading @@ -102,6 +115,39 @@ return [ ], ], ], 'role-ordre' => [ 'type' => Literal::class, 'options' => [ 'route' => '/role-ordre', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ 'incrementer' => [ 'type' => Segment::class, 'options' => [ 'route' => '/incrementer/:role', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'incrementer-ordre', ], ], ], 'decrementer' => [ 'type' => Segment::class, 'options' => [ 'route' => '/decrementer/:role', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'decrementer-ordre', ], ], ], ] ], 'mail-confirmation-acceuil' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -214,6 +260,7 @@ return [ 'factories' => [ \Application\Controller\PrivilegeController::class => \Application\Controller\Factory\PrivilegeControllerFactory::class, MailConfirmationController::class => MailConfirmationControllerFactory::class, RoleController::class => RoleControllerFactory::class, ], ], Loading module/Application/src/Application/Controller/Factory/RoleControllerFactory.php +32 Changes for module/Application/src/Application/Controller/Factory/RoleControllerFactory.php: 32 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller\Factory; use Application\Controller\RoleController; use Application\Service\Etablissement\EtablissementService; use Application\Service\Role\RoleService; use Zend\Mvc\Controller\ControllerManager; class RoleControllerFactory { /** * @param ControllerManager $controllerManager * @return RoleController */ public function __invoke(ControllerManager $controllerManager) { /** * @var RoleService $roleService * @var EtablissementService $etablissementService */ $roleService = $controllerManager->getServiceLocator()->get('RoleService'); $etablissementService = $controllerManager->getServiceLocator()->get(EtablissementService::class); $controller = new RoleController(); $controller->setRoleService($roleService); $controller->setEtablissementService($etablissementService); return $controller; } } No newline at end of file module/Application/src/Application/Controller/RoleController.php +43 Changes for module/Application/src/Application/Controller/RoleController.php: 43 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Zend\View\Model\ViewModel; class RoleController extends AbstractController { use RoleServiceAwareTrait; use EtablissementServiceAwareTrait; public function indexAction() { $etablissementsMembres = $this->getEtablissementService()->getRepository()->findAllEtablissementsMembres(); $mappedRoles = []; foreach ($etablissementsMembres as $etablissement) { $roles = $this->getRoleService()->getRepository()->findAllRolesTheseDependantByEtablissement($etablissement); $mappedRoles[$etablissement->getCode()] = $roles; } return new ViewModel([ 'etablissements' => $etablissementsMembres, 'mappedRoles' => $mappedRoles, ]); } // public function incrementerOrdreAction() { // $idRole = $this->params()->fromRoute('role'); // $role = $this->getRoleService()->getRepository()->find($idRole); // $this->getRoleService()->incrementerOrdre($role); // // $this->redirect()->toRoute('role-ordre'); // } // // public function decrementerOrdreAction() { // $idRole = $this->params()->fromRoute('role'); // $role = $this->getRoleService()->getRepository()->find($idRole); // $this->getRoleService()->decrementerOrdre($role); // // $this->redirect()->toRoute('role-ordre'); // } } No newline at end of file Loading
data/role.config.php +73 Changes for data/role.config.php: 73 added lines, 0 removed lines. Original line number Diff line number Diff line <?php // // //use Application\Controller\Factory\RoleControllerFactory; //use Application\Controller\RoleController; //use UnicaenAuth\Guard\PrivilegeController; //use Zend\Mvc\Router\Http\Literal; //use Zend\Mvc\Router\Http\Segment; // //return [ // 'bjyauthorize' => [ // 'guards' => [ // RoleController::class => [ // [ // 'controller' => RoleController::class, // 'action' => [ // 'index', // ], // 'roles' => [], // //'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_CONSULTATION, // ], // ], // ], // ], // // 'router' => [ // 'routes' => [ // 'role-affichage' => [ // 'type' => Literal::class, // 'options' => [ // 'route' => '/role-affichage', // 'defaults' => [ // 'controller' => RoleController::class, // 'action' => 'index', // ], // ], // 'may_terminate' => true, // 'child_routes' => [ // ], // ], // // ], // ], // 'navigation' => [ // 'default' => [ // 'home' => [ // 'pages' => [ // 'admin' => [ // 'pages' => [ // ], // ], // ], // ], // ], // ], // 'service_manager' => [ // 'factories' => [], // ], // 'controllers' => [ // 'factories' => [ // RoleController::class => RoleControllerFactory::class, // ], // ], // 'form_elements' => [ // 'factories' => [], // ], // 'hydrators' => [ // 'factories' => [], // ], // 'view_helpers' => [ // 'invokables' => [], // ], //];
module/Application/config/others/admin.config.php +47 Changes for module/Application/config/others/admin.config.php: 47 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,9 @@ use Application\Controller\AdminController; use Application\Controller\Factory\PrivilegeControllerFactory; use Application\Controller\Factory\RoleControllerFactory; use Application\Controller\MailConfirmationController; use Application\Controller\RoleController; use Application\Provider\Privilege\EcoleDoctoralePrivileges; use Application\Provider\Privilege\UniteRecherchePrivileges; use Application\Provider\Privilege\UtilisateurPrivileges; Loading @@ -20,6 +22,17 @@ return [ 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ [ 'controller' => RoleController::class, 'action' => [ 'index', 'incrementer-ordre', 'decrementer-ordre', ], 'roles' => [ 'Administrateur technique' ], ], [ 'controller' => 'Application\Controller\Admin', 'action' => [ Loading Loading @@ -102,6 +115,39 @@ return [ ], ], ], 'role-ordre' => [ 'type' => Literal::class, 'options' => [ 'route' => '/role-ordre', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ 'incrementer' => [ 'type' => Segment::class, 'options' => [ 'route' => '/incrementer/:role', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'incrementer-ordre', ], ], ], 'decrementer' => [ 'type' => Segment::class, 'options' => [ 'route' => '/decrementer/:role', 'defaults' => [ 'controller' => RoleController::class, 'action' => 'decrementer-ordre', ], ], ], ] ], 'mail-confirmation-acceuil' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -214,6 +260,7 @@ return [ 'factories' => [ \Application\Controller\PrivilegeController::class => \Application\Controller\Factory\PrivilegeControllerFactory::class, MailConfirmationController::class => MailConfirmationControllerFactory::class, RoleController::class => RoleControllerFactory::class, ], ], Loading
module/Application/src/Application/Controller/Factory/RoleControllerFactory.php +32 Changes for module/Application/src/Application/Controller/Factory/RoleControllerFactory.php: 32 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller\Factory; use Application\Controller\RoleController; use Application\Service\Etablissement\EtablissementService; use Application\Service\Role\RoleService; use Zend\Mvc\Controller\ControllerManager; class RoleControllerFactory { /** * @param ControllerManager $controllerManager * @return RoleController */ public function __invoke(ControllerManager $controllerManager) { /** * @var RoleService $roleService * @var EtablissementService $etablissementService */ $roleService = $controllerManager->getServiceLocator()->get('RoleService'); $etablissementService = $controllerManager->getServiceLocator()->get(EtablissementService::class); $controller = new RoleController(); $controller->setRoleService($roleService); $controller->setEtablissementService($etablissementService); return $controller; } } No newline at end of file
module/Application/src/Application/Controller/RoleController.php +43 Changes for module/Application/src/Application/Controller/RoleController.php: 43 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Zend\View\Model\ViewModel; class RoleController extends AbstractController { use RoleServiceAwareTrait; use EtablissementServiceAwareTrait; public function indexAction() { $etablissementsMembres = $this->getEtablissementService()->getRepository()->findAllEtablissementsMembres(); $mappedRoles = []; foreach ($etablissementsMembres as $etablissement) { $roles = $this->getRoleService()->getRepository()->findAllRolesTheseDependantByEtablissement($etablissement); $mappedRoles[$etablissement->getCode()] = $roles; } return new ViewModel([ 'etablissements' => $etablissementsMembres, 'mappedRoles' => $mappedRoles, ]); } // public function incrementerOrdreAction() { // $idRole = $this->params()->fromRoute('role'); // $role = $this->getRoleService()->getRepository()->find($idRole); // $this->getRoleService()->incrementerOrdre($role); // // $this->redirect()->toRoute('role-ordre'); // } // // public function decrementerOrdreAction() { // $idRole = $this->params()->fromRoute('role'); // $role = $this->getRoleService()->getRepository()->find($idRole); // $this->getRoleService()->decrementerOrdre($role); // // $this->redirect()->toRoute('role-ordre'); // } } No newline at end of file