diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-29 18:44:21 +0100 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-29 18:44:21 +0100 |
commit | 178eda18872f99840937dc3d23629b5d7aa7cee0 (patch) | |
tree | e2e27f289b5620e92b1accddcea9489286a65243 /app/Controller/UserHelper.php | |
parent | b4c5e36ee4cbf34020eb043e54e9b7294062acee (diff) |
Add autocompletion in textarea for user mentions
Diffstat (limited to 'app/Controller/UserHelper.php')
-rw-r--r-- | app/Controller/UserHelper.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/Controller/UserHelper.php b/app/Controller/UserHelper.php index f164d0a6..041ed2c8 100644 --- a/app/Controller/UserHelper.php +++ b/app/Controller/UserHelper.php @@ -21,4 +21,17 @@ class UserHelper extends Base $users = $this->userFilterAutoCompleteFormatter->create($search)->filterByUsernameOrByName()->format(); $this->response->json($users); } + + /** + * User mention autocompletion (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); + } } |