summaryrefslogtreecommitdiff
path: root/app/Api/Task.php
diff options
context:
space:
mode:
authorImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
committerImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
commit7459bc1c40af72441ccdaff944ef2dc9465ba9bf (patch)
treefea088cdda93079aee9e719a1bbe8464358efbb0 /app/Api/Task.php
parent99f275e5bb033cca33eee87b0e914645730f13d1 (diff)
parent81a25cbe6328eab7c4de0befc64186610ecc7f49 (diff)
Merge pull request #2 from fguillot/master
merge
Diffstat (limited to 'app/Api/Task.php')
-rw-r--r--app/Api/Task.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/Api/Task.php b/app/Api/Task.php
index 177a09c6..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);
@@ -75,7 +82,7 @@ class Task extends Base
}
public function createTask($title, $project_id, $color_id = '', $column_id = 0, $owner_id = 0, $creator_id = 0,
- $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = 0,
+ $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = 0, $priority = 0,
$recurrence_status = 0, $recurrence_trigger = 0, $recurrence_factor = 0, $recurrence_timeframe = 0,
$recurrence_basedate = 0, $reference = '')
{
@@ -107,6 +114,7 @@ class Task extends Base
'recurrence_timeframe' => $recurrence_timeframe,
'recurrence_basedate' => $recurrence_basedate,
'reference' => $reference,
+ 'priority' => $priority,
);
list($valid, ) = $this->taskValidator->validateCreation($values);
@@ -115,7 +123,7 @@ class Task extends Base
}
public function updateTask($id, $title = null, $color_id = null, $owner_id = null,
- $date_due = null, $description = null, $category_id = null, $score = null,
+ $date_due = null, $description = null, $category_id = null, $score = null, $priority = null,
$recurrence_status = null, $recurrence_trigger = null, $recurrence_factor = null,
$recurrence_timeframe = null, $recurrence_basedate = null, $reference = null)
{
@@ -146,6 +154,7 @@ class Task extends Base
'recurrence_timeframe' => $recurrence_timeframe,
'recurrence_basedate' => $recurrence_basedate,
'reference' => $reference,
+ 'priority' => $priority,
);
foreach ($values as $key => $value) {