diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-04-22 18:49:19 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-04-22 18:49:19 -0400 |
commit | da1725c225c94bcdffe4dba4c068db8e1e11cbe7 (patch) | |
tree | 8e52c9e16faa88bb5931a6a39cde86219c61b0e9 /app/Api | |
parent | 756716766cb33da2c25544918574368b51cca26e (diff) |
Added searchTasks API procedure
Diffstat (limited to 'app/Api')
-rw-r--r-- | app/Api/Base.php | 1 | ||||
-rw-r--r-- | app/Api/Task.php | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/Api/Base.php b/app/Api/Base.php index 0959817e..2cc62da8 100644 --- a/app/Api/Base.php +++ b/app/Api/Base.php @@ -40,6 +40,7 @@ abstract class Base extends \Kanboard\Core\Base 'getBoard', 'getProjectActivity', 'getOverdueTasksByProject', + 'searchTasks', ); public function checkProcedurePermission($is_user, $procedure) diff --git a/app/Api/Task.php b/app/Api/Task.php index 202e9bb5..1d1211f2 100644 --- a/app/Api/Task.php +++ b/app/Api/Task.php @@ -2,6 +2,7 @@ namespace Kanboard\Api; +use Kanboard\Filter\TaskProjectFilter; use Kanboard\Model\Task as TaskModel; /** @@ -12,6 +13,12 @@ use Kanboard\Model\Task as TaskModel; */ class Task extends Base { + public function searchTasks($project_id, $query) + { + $this->checkProjectPermission($project_id); + return $this->taskLexer->build($query)->withFilter(new TaskProjectFilter($project_id))->toArray(); + } + public function getTask($task_id) { $this->checkTaskPermission($task_id); |