Loading src/UnicaenPrivilege/Controller/PrivilegeController.php +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class PrivilegeController extends AbstractActionController $privilegesByCategorie = $this->privilegeService->listByCategorie($namespace); $title = "Attribution des privilèges"; return compact('title', 'form', 'roles', 'privilegesByCategorie'); return compact('title', 'form', 'roles', 'privilegesByCategorie', 'namespace'); } public function ajouterAction() : ViewModel Loading src/UnicaenPrivilege/Form/Privilege/CategorieFiltreForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class CategorieFiltreForm extends Form 'options' => [ 'empty_option' => "Tous les namespaces", 'value_options' => $this->privilegeCategorieService->getListForSelect( $this->privilegeCategorieService->findAllWithNamespace(), 'namespace', 'namespace' $this->privilegeCategorieService->findAllWithNamespace(['namespace' => 'ASC']), 'namespace', 'namespace' ), ], 'attributes' => [ Loading src/UnicaenPrivilege/Service/Privilege/PrivilegeCategorieService.php +3 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ class PrivilegeCategorieService extends CommonService $qb = $this->getRepo()->createQueryBuilder('c'); $qb ->distinct() ->andWhere($qb->expr()->isNotNull('c.namespace')); foreach ($orderBy as $sort => $order){ $qb = $qb->addOrderBy('c.'.$sort, $order); } return $qb->getQuery()->getResult(); } Loading view/unicaen-privilege/privilege/index.phtml +8 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,15 @@ use UnicaenPrivilege\Provider\Privilege\PrivilegePrivileges; * @var array $privilegesByCategorie * @var CategorieFiltreForm $form * @var ?string $gestion * @var ?string $namespace * * @see AdministrationController::privilegeAction() * @see PrivilegeController::indexAction() */ $this->headTitle("Gestion des privilèges"); ?> <h1 class="page-header"> Loading @@ -25,11 +28,13 @@ $this->headTitle("Gestion des privilèges"); <?php echo $this->messenger()->addMessagesFromFlashMessenger(); ?> <?php if ($gestion === null or $gestion !== 'off') : ?> <?php if (!isset($gestion) or $gestion !== 'off') : ?> <div class="row mb-3"> <div class="col-md-12"> <?php /** @see PrivilegeCategorieController::indexAction() */ ?> <a href="<?php echo $this->url('unicaen-privilege/categorie', [], []); ?>" <?php $url = sprintf("%s%s", $this->url('unicaen-privilege/categorie', [], []) ,(isset($namespace) && !empty($namespace)) ? "?namespace=".$namespace : ""); /** @see PrivilegeCategorieController::indexAction() */ ?> <a href="<?php echo $url; ?>" class="btn btn-primary"> <i class="fas fa-crown"></i> Gestion des privilèges Loading Loading
src/UnicaenPrivilege/Controller/PrivilegeController.php +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class PrivilegeController extends AbstractActionController $privilegesByCategorie = $this->privilegeService->listByCategorie($namespace); $title = "Attribution des privilèges"; return compact('title', 'form', 'roles', 'privilegesByCategorie'); return compact('title', 'form', 'roles', 'privilegesByCategorie', 'namespace'); } public function ajouterAction() : ViewModel Loading
src/UnicaenPrivilege/Form/Privilege/CategorieFiltreForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class CategorieFiltreForm extends Form 'options' => [ 'empty_option' => "Tous les namespaces", 'value_options' => $this->privilegeCategorieService->getListForSelect( $this->privilegeCategorieService->findAllWithNamespace(), 'namespace', 'namespace' $this->privilegeCategorieService->findAllWithNamespace(['namespace' => 'ASC']), 'namespace', 'namespace' ), ], 'attributes' => [ Loading
src/UnicaenPrivilege/Service/Privilege/PrivilegeCategorieService.php +3 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,9 @@ class PrivilegeCategorieService extends CommonService $qb = $this->getRepo()->createQueryBuilder('c'); $qb ->distinct() ->andWhere($qb->expr()->isNotNull('c.namespace')); foreach ($orderBy as $sort => $order){ $qb = $qb->addOrderBy('c.'.$sort, $order); } return $qb->getQuery()->getResult(); } Loading
view/unicaen-privilege/privilege/index.phtml +8 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,15 @@ use UnicaenPrivilege\Provider\Privilege\PrivilegePrivileges; * @var array $privilegesByCategorie * @var CategorieFiltreForm $form * @var ?string $gestion * @var ?string $namespace * * @see AdministrationController::privilegeAction() * @see PrivilegeController::indexAction() */ $this->headTitle("Gestion des privilèges"); ?> <h1 class="page-header"> Loading @@ -25,11 +28,13 @@ $this->headTitle("Gestion des privilèges"); <?php echo $this->messenger()->addMessagesFromFlashMessenger(); ?> <?php if ($gestion === null or $gestion !== 'off') : ?> <?php if (!isset($gestion) or $gestion !== 'off') : ?> <div class="row mb-3"> <div class="col-md-12"> <?php /** @see PrivilegeCategorieController::indexAction() */ ?> <a href="<?php echo $this->url('unicaen-privilege/categorie', [], []); ?>" <?php $url = sprintf("%s%s", $this->url('unicaen-privilege/categorie', [], []) ,(isset($namespace) && !empty($namespace)) ? "?namespace=".$namespace : ""); /** @see PrivilegeCategorieController::indexAction() */ ?> <a href="<?php echo $url; ?>" class="btn btn-primary"> <i class="fas fa-crown"></i> Gestion des privilèges Loading