Loading module/Application/src/Application/Controller/PrivilegeController.php +13 −2 Changes for module/Application/src/Application/Controller/PrivilegeController.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -68,6 +68,18 @@ class PrivilegeController extends AbstractController $role = $this->entityManager->getRepository(Role::class)->find($role_id); $value = null; // /!\ si le role à un privilège desactivé la modification if (! $role->getProfils()->isEmpty()) { if( array_search($role, $privilege->getRole()->toArray()) !== false) { $value = 1; } else { $value = 0; } } else { if (array_search($role, $privilege->getRole()->toArray()) !== false) { $privilege->removeRole($role); try { Loading @@ -87,9 +99,8 @@ class PrivilegeController extends AbstractController } // retrait des profils associés à un role $this->getRoleService()->removeProfils($role); } $queryParams = $this->params()->fromQuery(); return new ViewModel([ 'value' => $value, ]); Loading module/Application/src/Application/Controller/ProfilController.php +2 −0 Changes for module/Application/src/Application/Controller/ProfilController.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ class ProfilController extends AbstractActionController { /** @var ProfilForm $form */ $form = $this->getServiceLocator()->get('FormElementManager')->get(ProfilForm::class); $form->setAttribute('action', $this->url()->fromRoute('profil/editer', ['profil' => $profil->getId()], [], true)); $form->bind($profil); /** @var Request $request */ Loading @@ -57,6 +58,7 @@ class ProfilController extends AbstractActionController { } return new ViewModel([ 'title' => 'Édition d\'un profil', 'form' => $form, ]); } Loading module/Application/view/application/profil/gerer-roles.phtml +8 −0 Changes for module/Application/view/application/profil/gerer-roles.phtml: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,14 @@ Gestion des rôles associées au profil </h1> <a href="<?php echo $this->url('profil', [], [], true); ?>" class="btn btn-info"> <span class="glyphicon glyphicon-chevron-left"></span> Retour à la gestion des profils </a> <br/> <br/> <div class="panel panel-info"> <div class="panel-heading"> Information sur le profil sélectionné Loading module/Application/view/application/profil/index.phtml +2 −2 Changes for module/Application/view/application/profil/index.phtml: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ $canChangePrivilege = true; <h2> Liste des profils </h2> <a href="<?php echo $this->url('profil/editer', [], [], true); ?>" class="btn btn-primary"> <a href="<?php echo $this->url('profil/editer', [], [], true); ?>" class="btn btn-primary ajax-modal" data-event="modification"> <span class="glyphicon glyphicon-plus"></span> Ajouter un nouveau profil </a> Loading @@ -44,7 +44,7 @@ $canChangePrivilege = true; <td> <?php echo count($profil->getRoles()); ?></td> <td> <?php if ($canEdit) : ?> <a href="<?php echo $this->url('profil/editer', ['profil' => $profil->getId()], [], true);?>"> <a href="<?php echo $this->url('profil/editer', ['profil' => $profil->getId()], [], true);?>" class="ajax-modal" data-event="modification"> <span class="glyphicon glyphicon-pencil" title="Éditer les informations du profil"></span> </a> <?php endif; ?> Loading Loading
module/Application/src/Application/Controller/PrivilegeController.php +13 −2 Changes for module/Application/src/Application/Controller/PrivilegeController.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -68,6 +68,18 @@ class PrivilegeController extends AbstractController $role = $this->entityManager->getRepository(Role::class)->find($role_id); $value = null; // /!\ si le role à un privilège desactivé la modification if (! $role->getProfils()->isEmpty()) { if( array_search($role, $privilege->getRole()->toArray()) !== false) { $value = 1; } else { $value = 0; } } else { if (array_search($role, $privilege->getRole()->toArray()) !== false) { $privilege->removeRole($role); try { Loading @@ -87,9 +99,8 @@ class PrivilegeController extends AbstractController } // retrait des profils associés à un role $this->getRoleService()->removeProfils($role); } $queryParams = $this->params()->fromQuery(); return new ViewModel([ 'value' => $value, ]); Loading
module/Application/src/Application/Controller/ProfilController.php +2 −0 Changes for module/Application/src/Application/Controller/ProfilController.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ class ProfilController extends AbstractActionController { /** @var ProfilForm $form */ $form = $this->getServiceLocator()->get('FormElementManager')->get(ProfilForm::class); $form->setAttribute('action', $this->url()->fromRoute('profil/editer', ['profil' => $profil->getId()], [], true)); $form->bind($profil); /** @var Request $request */ Loading @@ -57,6 +58,7 @@ class ProfilController extends AbstractActionController { } return new ViewModel([ 'title' => 'Édition d\'un profil', 'form' => $form, ]); } Loading
module/Application/view/application/profil/gerer-roles.phtml +8 −0 Changes for module/Application/view/application/profil/gerer-roles.phtml: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,14 @@ Gestion des rôles associées au profil </h1> <a href="<?php echo $this->url('profil', [], [], true); ?>" class="btn btn-info"> <span class="glyphicon glyphicon-chevron-left"></span> Retour à la gestion des profils </a> <br/> <br/> <div class="panel panel-info"> <div class="panel-heading"> Information sur le profil sélectionné Loading
module/Application/view/application/profil/index.phtml +2 −2 Changes for module/Application/view/application/profil/index.phtml: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ $canChangePrivilege = true; <h2> Liste des profils </h2> <a href="<?php echo $this->url('profil/editer', [], [], true); ?>" class="btn btn-primary"> <a href="<?php echo $this->url('profil/editer', [], [], true); ?>" class="btn btn-primary ajax-modal" data-event="modification"> <span class="glyphicon glyphicon-plus"></span> Ajouter un nouveau profil </a> Loading @@ -44,7 +44,7 @@ $canChangePrivilege = true; <td> <?php echo count($profil->getRoles()); ?></td> <td> <?php if ($canEdit) : ?> <a href="<?php echo $this->url('profil/editer', ['profil' => $profil->getId()], [], true);?>"> <a href="<?php echo $this->url('profil/editer', ['profil' => $profil->getId()], [], true);?>" class="ajax-modal" data-event="modification"> <span class="glyphicon glyphicon-pencil" title="Éditer les informations du profil"></span> </a> <?php endif; ?> Loading