summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorLev Lazinskiy <lev@levlaz.org>2016-06-09 01:16:47 -0700
committerLev Lazinskiy <lev@levlaz.org>2016-06-09 01:16:47 -0700
commita5b35954db549ef10b14866548c4c35dd1548943 (patch)
tree18221141c7727ba7e9c1908ed2e566f87b0d9aee /app/Model
parenta1e2b0f1b88ed445a9dd960d9431fdbcf983fb33 (diff)
Add total sum of tasks per project in dashboard
fix #885
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/ProjectModel.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/Model/ProjectModel.php b/app/Model/ProjectModel.php
index 34e11c13..7382537e 100644
--- a/app/Model/ProjectModel.php
+++ b/app/Model/ProjectModel.php
@@ -294,10 +294,12 @@ class ProjectModel extends Base
public function getColumnStats(array &$project)
{
$project['columns'] = $this->columnModel->getAll($project['id']);
+ $project['nb_active_tasks'] = 0;
$stats = $this->boardModel->getColumnStats($project['id']);
foreach ($project['columns'] as &$column) {
$column['nb_tasks'] = isset($stats[$column['id']]) ? $stats[$column['id']] : 0;
+ $project['nb_active_tasks'] += $column['nb_tasks'];
}
return $project;