summaryrefslogtreecommitdiff
path: root/app/Model/TaskFinderModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-08 18:36:13 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-08 18:36:13 -0500
commit73dce1279760434e1d1b7a903a0a7500462d6f9c (patch)
tree59a4fa8b6aa0215c658d339e6a31a0ba32b10036 /app/Model/TaskFinderModel.php
parentd3650eaa2582f6224eb5f5549829b7a84cda1ea4 (diff)
Prevent people to remove columns that contains tasks
Diffstat (limited to 'app/Model/TaskFinderModel.php')
-rw-r--r--app/Model/TaskFinderModel.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php
index 3185afb7..e54a613b 100644
--- a/app/Model/TaskFinderModel.php
+++ b/app/Model/TaskFinderModel.php
@@ -367,17 +367,18 @@ class TaskFinderModel extends Base
* Count the number of tasks for a given column and status
*
* @access public
- * @param integer $project_id Project id
- * @param integer $column_id Column id
- * @return integer
+ * @param integer $project_id Project id
+ * @param integer $column_id Column id
+ * @param array $status
+ * @return int
*/
- public function countByColumnId($project_id, $column_id)
+ public function countByColumnId($project_id, $column_id, array $status = array(TaskModel::STATUS_OPEN))
{
return $this->db
->table(TaskModel::TABLE)
->eq('project_id', $project_id)
->eq('column_id', $column_id)
- ->eq('is_active', 1)
+ ->in('is_active', $status)
->count();
}