summaryrefslogtreecommitdiff
path: root/models/board.php
diff options
context:
space:
mode:
Diffstat (limited to 'models/board.php')
-rw-r--r--models/board.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/models/board.php b/models/board.php
index 3bff8d56..af1f4f7a 100644
--- a/models/board.php
+++ b/models/board.php
@@ -181,10 +181,24 @@ class Board extends Base
$this->db->startTransaction();
$columns = $this->getColumns($project_id);
+
+ $filters = array(
+ array('column' => 'project_id', 'operator' => 'eq', 'value' => $project_id),
+ array('column' => 'is_active', 'operator' => 'eq', 'value' => Task::STATUS_OPEN),
+ );
+
$taskModel = new Task($this->db, $this->event);
+ $tasks = $taskModel->find($filters);
foreach ($columns as &$column) {
- $column['tasks'] = $taskModel->getAllByColumnId($project_id, $column['id'], array(1));
+
+ $column['tasks'] = array();
+
+ foreach ($tasks as &$task) {
+ if ($task['column_id'] == $column['id']) {
+ $column['tasks'][] = $task;
+ }
+ }
}
$this->db->closeTransaction();