summaryrefslogtreecommitdiff
path: root/app/Api
diff options
context:
space:
mode:
Diffstat (limited to 'app/Api')
-rw-r--r--app/Api/Auth.php4
-rw-r--r--app/Api/Base.php3
-rw-r--r--app/Api/GroupMember.php5
-rw-r--r--app/Api/Task.php13
4 files changed, 20 insertions, 5 deletions
diff --git a/app/Api/Auth.php b/app/Api/Auth.php
index 6c6e1ebe..1cc6627f 100644
--- a/app/Api/Auth.php
+++ b/app/Api/Auth.php
@@ -2,7 +2,7 @@
namespace Kanboard\Api;
-use JsonRPC\AuthenticationFailure;
+use JsonRPC\Exception\AuthenticationFailureException;
/**
* Base class
@@ -32,7 +32,7 @@ class Auth extends Base
$this->checkProcedurePermission(false, $method);
} else {
$this->logger->error('API authentication failure for '.$username);
- throw new AuthenticationFailure('Wrong credentials');
+ throw new AuthenticationFailureException('Wrong credentials');
}
}
diff --git a/app/Api/Base.php b/app/Api/Base.php
index 0959817e..ea817f7d 100644
--- a/app/Api/Base.php
+++ b/app/Api/Base.php
@@ -2,7 +2,7 @@
namespace Kanboard\Api;
-use JsonRPC\AccessDeniedException;
+use JsonRPC\Exception\AccessDeniedException;
/**
* Base class
@@ -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/GroupMember.php b/app/Api/GroupMember.php
index de62f0c6..9d2a4796 100644
--- a/app/Api/GroupMember.php
+++ b/app/Api/GroupMember.php
@@ -10,6 +10,11 @@ namespace Kanboard\Api;
*/
class GroupMember extends \Kanboard\Core\Base
{
+ public function getMemberGroups($user_id)
+ {
+ return $this->groupMember->getGroups($user_id);
+ }
+
public function getGroupMembers($group_id)
{
return $this->groupMember->getMembers($group_id);
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) {