summaryrefslogtreecommitdiff
path: root/app/Model/Subtask.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-06-20 16:50:52 -0400
committerFrederic Guillot <fred@kanboard.net>2015-06-20 16:50:52 -0400
commitb6b733b22f9e9f38786166c1274b135a99bce02a (patch)
tree6a861a141cefd42ebd7571d2e9f3a649ed19e6c7 /app/Model/Subtask.php
parenta409bf3ff496f9df496bc9eebe7200b9849bd2ee (diff)
Close all subtasks when a task is closed
Diffstat (limited to 'app/Model/Subtask.php')
-rw-r--r--app/Model/Subtask.php12
1 files changed, 12 insertions, 0 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