Loading config/merged/utilisateur.config.php +17 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,13 @@ return [ UtilisateurPrivileges::UTILISATEUR_RECHERCHER, ], ], [ 'controller' => UtilisateurController::class, 'action' => [ 'rechercher-interne', ], 'roles' => [], ], ], ], ], Loading Loading @@ -163,6 +170,16 @@ return [ ], ], ], 'rechercher-interne' => [ 'type' => Segment::class, 'options' => [ 'route' => '/rechercher-interne', 'defaults' => [ 'controller' => UtilisateurController::class, 'action' => 'rechercher-interne', ], ], ], 'rechercher-with-role' => [ 'type' => Segment::class, 'options' => [ Loading src/UnicaenUtilisateur/Controller/UtilisateurController.php +18 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,24 @@ class UtilisateurController extends AbstractActionController return new JsonModel($result); } function rechercherInterneAction() : JsonModel { $term = $this->params()->fromQuery('term'); $result = $this->getUserService()->findByTerm($term); $users = []; foreach ($result as $item) { $users[] = [ 'id' => $item->getId(), 'label' => $item->getDisplayName(), 'extra' => $item->getEmail(), ]; } usort($users, function ($a, $b) { return strcmp($a['label'], $b['label']); }); return new JsonModel($users); } public function rechercherWithRoleAction() : JsonModel { $term = $this->params()->fromQuery('term'); Loading Loading
config/merged/utilisateur.config.php +17 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,13 @@ return [ UtilisateurPrivileges::UTILISATEUR_RECHERCHER, ], ], [ 'controller' => UtilisateurController::class, 'action' => [ 'rechercher-interne', ], 'roles' => [], ], ], ], ], Loading Loading @@ -163,6 +170,16 @@ return [ ], ], ], 'rechercher-interne' => [ 'type' => Segment::class, 'options' => [ 'route' => '/rechercher-interne', 'defaults' => [ 'controller' => UtilisateurController::class, 'action' => 'rechercher-interne', ], ], ], 'rechercher-with-role' => [ 'type' => Segment::class, 'options' => [ Loading
src/UnicaenUtilisateur/Controller/UtilisateurController.php +18 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,24 @@ class UtilisateurController extends AbstractActionController return new JsonModel($result); } function rechercherInterneAction() : JsonModel { $term = $this->params()->fromQuery('term'); $result = $this->getUserService()->findByTerm($term); $users = []; foreach ($result as $item) { $users[] = [ 'id' => $item->getId(), 'label' => $item->getDisplayName(), 'extra' => $item->getEmail(), ]; } usort($users, function ($a, $b) { return strcmp($a['label'], $b['label']); }); return new JsonModel($users); } public function rechercherWithRoleAction() : JsonModel { $term = $this->params()->fromQuery('term'); Loading