Prevent people to remove columns that contains tasks

This commit is contained in:
Frederic Guillot
2017-02-08 18:36:13 -05:00
parent d3650eaa25
commit 73dce12797
33 changed files with 80 additions and 35 deletions

View File

@@ -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();
}