diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Subtask.php | 12 | ||||
-rw-r--r-- | app/Model/TaskStatus.php | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/app/Model/Subtask.php b/app/Model/Subtask.php index 65fa0f0c..a869ae91 100644 --- a/app/Model/Subtask.php +++ b/app/Model/Subtask.php @@ -228,6 +228,18 @@ class Subtask extends Base } /** + * Close all subtasks of a task + * + * @access public + * @param integer $task_id + * @return boolean + */ + public function closeAll($task_id) + { + return $this->db->table(self::TABLE)->eq('task_id', $task_id)->update(array('status' => self::STATUS_DONE)); + } + + /** * Get subtasks with consecutive positions * * If you remove a subtask, the positions are not anymore consecutives diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php index 30a65e1e..3f62667c 100644 --- a/app/Model/TaskStatus.php +++ b/app/Model/TaskStatus.php @@ -62,6 +62,7 @@ class TaskStatus extends Base */ public function close($task_id) { + $this->subtask->closeAll($task_id); return $this->changeStatus($task_id, Task::STATUS_CLOSED, time(), Task::EVENT_CLOSE); } @@ -113,7 +114,7 @@ class TaskStatus extends Base } /** - * Check the status of task + * Check the status of a task * * @access private * @param integer $task_id Task id |