From d45fa6a33b8ce5258e4eab4c894765f885c16518 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 17 Jan 2016 11:03:33 -0500 Subject: Add dropdown menu on each board column title to close all tasks --- app/Model/TaskStatus.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'app/Model/TaskStatus.php') diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php index a5199ed9..afb5ffb5 100644 --- a/app/Model/TaskStatus.php +++ b/app/Model/TaskStatus.php @@ -61,6 +61,32 @@ class TaskStatus extends Base return $this->changeStatus($task_id, Task::STATUS_OPEN, 0, Task::EVENT_OPEN); } + /** + * Close multiple tasks + * + * @access public + * @param array $task_ids + */ + public function closeMultipleTasks(array $task_ids) + { + foreach ($task_ids as $task_id) { + $this->close($task_id); + } + } + + /** + * Close all tasks within a column/swimlane + * + * @access public + * @param integer $swimlane_id + * @param integer $column_id + */ + public function closeTasksBySwimlaneAndColumn($swimlane_id, $column_id) + { + $task_ids = $this->db->table(Task::TABLE)->eq('swimlane_id', $swimlane_id)->eq('column_id', $column_id)->findAllByColumn('id'); + $this->closeMultipleTasks($task_ids); + } + /** * Common method to change the status of task * -- cgit v1.2.3