summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-10 22:10:32 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-10 22:10:32 -0500
commitefbf679385773e76cbb436691f63e931c17172d4 (patch)
treee2d15b3a0afa15e2a5532ad8f2d2c110665ffb98 /app/Model
parent57613d18539a2cf5970dcc0c4f50e023df9eea73 (diff)
Add subtask time tracking in the task view
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/SubtaskTimeTracking.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php
index 5b58dfe2..8093cf80 100644
--- a/app/Model/SubtaskTimeTracking.php
+++ b/app/Model/SubtaskTimeTracking.php
@@ -44,6 +44,35 @@ class SubtaskTimeTracking extends Base
}
/**
+ * Get query for task (pagination)
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return \PicoDb\Table
+ */
+ public function getTaskQuery($task_id)
+ {
+ return $this->db
+ ->table(self::TABLE)
+ ->columns(
+ self::TABLE.'.id',
+ self::TABLE.'.subtask_id',
+ self::TABLE.'.end',
+ self::TABLE.'.start',
+ self::TABLE.'.user_id',
+ Subtask::TABLE.'.task_id',
+ Subtask::TABLE.'.title AS subtask_title',
+ Task::TABLE.'.project_id',
+ User::TABLE.'.username',
+ User::TABLE.'.name AS user_fullname'
+ )
+ ->join(Subtask::TABLE, 'id', 'subtask_id')
+ ->join(Task::TABLE, 'id', 'task_id', Subtask::TABLE)
+ ->join(User::TABLE, 'id', 'user_id', self::TABLE)
+ ->eq(Task::TABLE.'.id', $task_id);
+ }
+
+ /**
* Get all recorded time slots for a given user
*
* @access public