From 6660c043336cd01edec40845768af95ad561293b Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 6 Sep 2015 16:51:27 -0500 Subject: [PATCH] Issue 83: Project list page issue count --- indefero/src/IDF/Views.php | 23 +++++++++++++++---- .../src/IDF/templates/idf/listProjects.html | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/indefero/src/IDF/Views.php b/indefero/src/IDF/Views.php index 1b7df7d..85e9bca 100644 --- a/indefero/src/IDF/Views.php +++ b/indefero/src/IDF/Views.php @@ -569,11 +569,26 @@ class IDF_Views ); foreach ($what as $key => $model) { - $count = Pluf::factory($model)->getCount(array( - 'filter' => sprintf('project IN (%s)', implode(', ', $projectIds)) - )); - $forgestats[$key] = $count; + if ($key == "issues") { + + $nb_open = Pluf::factory("IDF_Issue")->getCount(array('view'=>'project_find_open', 'filter' => sprintf('indefero_idf_issues.project IN (%s)', implode(', ', $projectIds)))); + $nb_closed = Pluf::factory("IDF_Issue")->getCount(array('view'=>'project_find_closed', 'filter' => sprintf('indefero_idf_issues.project IN (%s)', implode(', ', $projectIds)))); + + $count = $nb_closed + $nb_open; + + $forgestats["openissues"] = $nb_open; + $forgestats["closedissues"] = $nb_closed; + } else { + $count = Pluf::factory($model)->getCount(array( + 'filter' => sprintf('project IN (%s)', implode(', ', $projectIds)) + )); + + $forgestats[$key] = $count; + + } + $forgestats['total'] += $count; + } $forgestats['proj_count'] = count($projects); return $forgestats; diff --git a/indefero/src/IDF/templates/idf/listProjects.html b/indefero/src/IDF/templates/idf/listProjects.html index fcddffe..3f85820 100644 --- a/indefero/src/IDF/templates/idf/listProjects.html +++ b/indefero/src/IDF/templates/idf/listProjects.html @@ -48,7 +48,8 @@ {trans 'Filtered project stats'}
-
{trans 'Issues:'}
{$stats.issues}
+
{trans 'Open Issues:'}
{$stats.openissues}
+
{trans 'Closed Issues:'}
{$stats.closedissues}
{trans 'Commits:'}
{$stats.commits}
{trans 'Documentations:'}
{$stats.docpages}
{trans 'Downloads:'}
{$stats.downloads}