summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-09 21:39:27 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-09 21:39:27 -0400
commit3c394fe92ec3b97d8404f68fd3379cfa6a92a6e1 (patch)
tree2927faea133e55c5aef9b523cb3295f781984062 /app
parent18385b09d64990d8ac3944379ad5c9392e054773 (diff)
parenta5b35954db549ef10b14866548c4c35dd1548943 (diff)
Merge pull-request #2320
Diffstat (limited to 'app')
-rw-r--r--app/Model/ProjectModel.php2
-rw-r--r--app/Template/dashboard/projects.php5
2 files changed, 7 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;
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 @@
<th class="column-5"><?= $paginator->order('Id', 'id') ?></th>
<th class="column-3"><?= $paginator->order('<i class="fa fa-lock fa-fw" title="'.t('Private project').'"></i>', 'is_private') ?></th>
<th class="column-25"><?= $paginator->order(t('Project'), \Kanboard\Model\ProjectModel::TABLE.'.name') ?></th>
+ <th class="column-10"><?= t('Tasks') ?></th>
<th><?= t('Columns') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $project): ?>
@@ -36,12 +37,16 @@
</span>
<?php endif ?>
</td>
+ <td>
+ <?= $project['nb_active_tasks'] ?>
+ </td>
<td class="dashboard-project-stats">
<?php foreach ($project['columns'] as $column): ?>
<strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong>
<span><?= $this->text->e($column['title']) ?></span>
<?php endforeach ?>
</td>
+
</tr>
<?php endforeach ?>
</table>