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 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 app/Api/SubtaskTimeTracking.php (limited to 'app/Api') 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); + } +} -- cgit v1.2.3 From 9ba464d52701ff64bb641a01d9b06a17d7d4bbf8 Mon Sep 17 00:00:00 2001 From: ngtech Date: Wed, 8 Jun 2016 10:27:44 +0300 Subject: Update and rename SubtaskTimeTracking.php to SubtaskTimeTrackingApi.php --- app/Api/SubtaskTimeTracking.php | 32 -------------------------------- app/Api/SubtaskTimeTrackingApi.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 app/Api/SubtaskTimeTracking.php create mode 100644 app/Api/SubtaskTimeTrackingApi.php (limited to 'app/Api') diff --git a/app/Api/SubtaskTimeTracking.php b/app/Api/SubtaskTimeTracking.php deleted file mode 100644 index e178dbce..00000000 --- a/app/Api/SubtaskTimeTracking.php +++ /dev/null @@ -1,32 +0,0 @@ -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/Api/SubtaskTimeTrackingApi.php b/app/Api/SubtaskTimeTrackingApi.php new file mode 100644 index 00000000..d84a2762 --- /dev/null +++ b/app/Api/SubtaskTimeTrackingApi.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); + } +} -- cgit v1.2.3 From a37a8d5878e10e091812083bb4f50bf4681ab31f Mon Sep 17 00:00:00 2001 From: Nikolaos Georgakis Date: Wed, 8 Jun 2016 13:34:12 +0300 Subject: Updated namespace to match new API files --- app/Api/SubtaskTimeTrackingApi.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Api') diff --git a/app/Api/SubtaskTimeTrackingApi.php b/app/Api/SubtaskTimeTrackingApi.php index d84a2762..80f5289b 100644 --- a/app/Api/SubtaskTimeTrackingApi.php +++ b/app/Api/SubtaskTimeTrackingApi.php @@ -2,13 +2,15 @@ namespace Kanboard\Api; +Use \Kanboard\Core\Base + /** * Subtask Time Tracking API controller * * @package api * @author Nikolaos Georgakis */ -class SubtaskTimeTrackingApi extends \Kanboard\Core\Base +class SubtaskTimeTrackingApi extends Base { public function hasTimer($subtask_id,$user_id) { -- cgit v1.2.3 From 79088a7f658c15c6399aefed90f318bf54944d23 Mon Sep 17 00:00:00 2001 From: Nikolaos Georgakis Date: Wed, 8 Jun 2016 13:39:41 +0300 Subject: Updated to include "Model" suffix --- app/Api/SubtaskTimeTrackingApi.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/Api') diff --git a/app/Api/SubtaskTimeTrackingApi.php b/app/Api/SubtaskTimeTrackingApi.php index 80f5289b..0e700b31 100644 --- a/app/Api/SubtaskTimeTrackingApi.php +++ b/app/Api/SubtaskTimeTrackingApi.php @@ -2,7 +2,7 @@ namespace Kanboard\Api; -Use \Kanboard\Core\Base +use Kanboard\Core\Base; /** * Subtask Time Tracking API controller @@ -14,21 +14,21 @@ class SubtaskTimeTrackingApi extends Base { public function hasTimer($subtask_id,$user_id) { - return $this->subtaskTimeTracking->hasTimer($subtask_id,$user_id); + return $this->subtaskTimeTrackingModel->hasTimer($subtask_id,$user_id); } public function logStartTime($subtask_id,$user_id) { - return $this->subtaskTimeTracking->logStartTime($subtask_id,$user_id); + return $this->subtaskTimeTrackingModel->logStartTime($subtask_id,$user_id); } public function logEndTime($subtask_id,$user_id) { - return $this->subtaskTimeTracking->logEndTime($subtask_id,$user_id); + return $this->subtaskTimeTrackingModel->logEndTime($subtask_id,$user_id); } public function getTimeSpent($subtask_id,$user_id) { - return $this->subtaskTimeTracking->getTimeSpent($subtask_id,$user_id); + return $this->subtaskTimeTrackingModel->getTimeSpent($subtask_id,$user_id); } } -- cgit v1.2.3