From a5b35954db549ef10b14866548c4c35dd1548943 Mon Sep 17 00:00:00 2001 From: Lev Lazinskiy Date: Thu, 9 Jun 2016 01:16:47 -0700 Subject: Add total sum of tasks per project in dashboard fix #885 --- app/Model/ProjectModel.php | 2 ++ app/Template/dashboard/projects.php | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'app') 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; diff --git a/app/Template/dashboard/projects.php b/app/Template/dashboard/projects.php index 5bf92980..962e4d83 100644 --- a/app/Template/dashboard/projects.php +++ b/app/Template/dashboard/projects.php @@ -9,6 +9,7 @@ order('Id', 'id') ?> order('', 'is_private') ?> order(t('Project'), \Kanboard\Model\ProjectModel::TABLE.'.name') ?> + getCollection() as $project): ?> @@ -36,12 +37,16 @@ + + + text->e($column['title']) ?> + -- cgit v1.2.3