From 4514bc1d4b4abff23902e46da76e70f13a3647eb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 16 May 2016 20:55:21 -0400 Subject: Improve user controllers and views --- app/Controller/UserAjaxController.php | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Controller/UserAjaxController.php (limited to 'app/Controller/UserAjaxController.php') diff --git a/app/Controller/UserAjaxController.php b/app/Controller/UserAjaxController.php new file mode 100644 index 00000000..7b365667 --- /dev/null +++ b/app/Controller/UserAjaxController.php @@ -0,0 +1,52 @@ +request->getStringParam('term'); + $filter = $this->userQuery->withFilter(new UserNameFilter($search)); + $filter->getQuery()->asc(UserModel::TABLE.'.name')->asc(UserModel::TABLE.'.username'); + $this->response->json($filter->format(new UserAutoCompleteFormatter($this->container))); + } + + /** + * User mention auto-completion (Ajax) + * + * @access public + */ + public function mention() + { + $project_id = $this->request->getStringParam('project_id'); + $query = $this->request->getStringParam('q'); + $users = $this->projectPermission->findUsernames($project_id, $query); + $this->response->json($users); + } + + /** + * Check if the user is connected + * + * @access public + */ + public function status() + { + $this->response->text('OK'); + } +} -- cgit v1.2.3