Add total sum of tasks per project in dashboard

fix #885
This commit is contained in:
Lev Lazinskiy
2016-06-09 01:16:47 -07:00
parent a1e2b0f1b8
commit a5b35954db
2 changed files with 7 additions and 0 deletions

View File

@@ -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;