summaryrefslogtreecommitdiff
path: root/app/Model/Project.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/Project.php')
-rw-r--r--app/Model/Project.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Model/Project.php b/app/Model/Project.php
index de9408ec..6d8885b1 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -191,11 +191,12 @@ class Project extends Base
public function getStats($project_id)
{
$stats = array();
- $columns = $this->board->getColumns($project_id);
$stats['nb_active_tasks'] = 0;
+ $columns = $this->board->getColumns($project_id);
+ $column_stats = $this->board->getColumnStats($project_id);
foreach ($columns as &$column) {
- $column['nb_active_tasks'] = $this->taskFinder->countByColumnId($project_id, $column['id']);
+ $column['nb_active_tasks'] = isset($column_stats[$column['id']]) ? $column_stats[$column['id']] : 0;
$stats['nb_active_tasks'] += $column['nb_active_tasks'];
}