diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-06-09 21:34:02 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-06-09 21:34:02 -0400 |
commit | 0152f533cf205f577726f9b46e5d094b32a984d4 (patch) | |
tree | 3c9294879916c6d3d34e18825f19175653128db6 | |
parent | a1e2b0f1b88ed445a9dd960d9431fdbcf983fb33 (diff) | |
parent | 79088a7f658c15c6399aefed90f318bf54944d23 (diff) |
Merge pull-request #2312
-rw-r--r-- | app/Api/Middleware/AuthenticationApiMiddleware.php | 7 | ||||
-rw-r--r-- | app/Api/SubtaskTimeTrackingApi.php | 34 | ||||
-rw-r--r-- | app/ServiceProvider/ApiProvider.php | 2 |
3 files changed, 43 insertions, 0 deletions
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/SubtaskTimeTrackingApi.php b/app/Api/SubtaskTimeTrackingApi.php new file mode 100644 index 00000000..0e700b31 --- /dev/null +++ b/app/Api/SubtaskTimeTrackingApi.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\Api; + +use Kanboard\Core\Base; + +/** + * Subtask Time Tracking API controller + * + * @package api + * @author Nikolaos Georgakis + */ +class SubtaskTimeTrackingApi extends Base +{ + public function hasTimer($subtask_id,$user_id) + { + return $this->subtaskTimeTrackingModel->hasTimer($subtask_id,$user_id); + } + + public function logStartTime($subtask_id,$user_id) + { + return $this->subtaskTimeTrackingModel->logStartTime($subtask_id,$user_id); + } + + public function logEndTime($subtask_id,$user_id) + { + return $this->subtaskTimeTrackingModel->logEndTime($subtask_id,$user_id); + } + + public function getTimeSpent($subtask_id,$user_id) + { + return $this->subtaskTimeTrackingModel->getTimeSpent($subtask_id,$user_id); + } +} diff --git a/app/ServiceProvider/ApiProvider.php b/app/ServiceProvider/ApiProvider.php index 19d945f6..93b3c7f5 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\SubtaskTimeTrackingApi; 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 SubtaskTimeTrackingApi($container)) ->withObject(new SwimlaneApi($container)) ->withObject(new TaskApi($container)) ->withObject(new TaskLinkApi($container)) |