diff options
author | Nikolaos Georgakis <nikos.git@ngtech.gr> | 2016-06-07 17:48:03 +0300 |
---|---|---|
committer | Nikolaos Georgakis <nikos.git@ngtech.gr> | 2016-06-07 17:53:24 +0300 |
commit | 27f947412fcf7b04a55f7118ddd1029ab6db4b66 (patch) | |
tree | d8f2ac28519fe8c0de95b724b50631d48cbb06d3 /app/Api | |
parent | 5e7a812933390d30e714efc3a1ff4a94dbd1702d (diff) |
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
Diffstat (limited to 'app/Api')
-rw-r--r-- | app/Api/Middleware/AuthenticationApiMiddleware.php | 7 | ||||
-rw-r--r-- | app/Api/SubtaskTimeTracking.php | 32 |
2 files changed, 39 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/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 @@ +<?php + +namespace Kanboard\Api; + +/** + * Subtask Time Tracking API controller + * + * @package api + * @author Nikolaos Georgakis + */ +class SubtaskTimeTracking extends \Kanboard\Core\Base +{ + public function hasTimer($subtask_id,$user_id) + { + return $this->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); + } +} |