From 27f947412fcf7b04a55f7118ddd1029ab6db4b66 Mon Sep 17 00:00:00 2001 From: Nikolaos Georgakis Date: Tue, 7 Jun 2016 17:48:03 +0300 Subject: Expose SubTask Time Tracking though the API Also allow users to create Subtasks and Log Time for Subtasks through the User API Rebased to new API code --- app/Api/Middleware/AuthenticationApiMiddleware.php | 7 +++++ app/Api/SubtaskTimeTracking.php | 32 ++++++++++++++++++++++ app/ServiceProvider/ApiProvider.php | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 app/Api/SubtaskTimeTracking.php (limited to 'app') diff --git a/app/Api/Middleware/AuthenticationApiMiddleware.php b/app/Api/Middleware/AuthenticationApiMiddleware.php index 5f63e1a1..b16e10b8 100644 --- a/app/Api/Middleware/AuthenticationApiMiddleware.php +++ b/app/Api/Middleware/AuthenticationApiMiddleware.php @@ -32,13 +32,20 @@ class AuthenticationApiMiddleware extends Base implements MiddlewareInterface 'getDefaultTaskColors', 'getColorList', 'getProjectById', + 'getSubTask', 'getTask', 'getTaskByReference', + 'getTimeSpent', 'getAllTasks', + 'getAllSubTasks', + 'hasTimer', + 'logStartTime', + 'logEndTime', 'openTask', 'closeTask', 'moveTaskPosition', 'createTask', + 'createSubtask', 'updateTask', 'getBoard', 'getProjectActivity', diff --git a/app/Api/SubtaskTimeTracking.php b/app/Api/SubtaskTimeTracking.php new file mode 100644 index 00000000..e178dbce --- /dev/null +++ b/app/Api/SubtaskTimeTracking.php @@ -0,0 +1,32 @@ +subtaskTimeTracking->hasTimer($subtask_id,$user_id); + } + + public function logStartTime($subtask_id,$user_id) + { + return $this->subtaskTimeTracking->logStartTime($subtask_id,$user_id); + } + + public function logEndTime($subtask_id,$user_id) + { + return $this->subtaskTimeTracking->logEndTime($subtask_id,$user_id); + } + + public function getTimeSpent($subtask_id,$user_id) + { + return $this->subtaskTimeTracking->getTimeSpent($subtask_id,$user_id); + } +} diff --git a/app/ServiceProvider/ApiProvider.php b/app/ServiceProvider/ApiProvider.php index 19d945f6..4fb74f45 100644 --- a/app/ServiceProvider/ApiProvider.php +++ b/app/ServiceProvider/ApiProvider.php @@ -18,6 +18,7 @@ use Kanboard\Api\Middleware\AuthenticationApiMiddleware; use Kanboard\Api\ProjectApi; use Kanboard\Api\ProjectPermissionApi; use Kanboard\Api\SubtaskApi; +use Kanboard\Api\SubtaskTimeTracking; use Kanboard\Api\SwimlaneApi; use Kanboard\Api\TaskApi; use Kanboard\Api\TaskLinkApi; @@ -60,6 +61,7 @@ class ApiProvider implements ServiceProviderInterface ->withObject(new ProjectApi($container)) ->withObject(new ProjectPermissionApi($container)) ->withObject(new SubtaskApi($container)) + ->withObject(new SubtaskTimeTracking($container)) ->withObject(new SwimlaneApi($container)) ->withObject(new TaskApi($container)) ->withObject(new TaskLinkApi($container)) -- cgit v1.2.3