From d348c45c56d4ac8d0297c370d83dbce5419ed44a Mon Sep 17 00:00:00 2001 From: Simon Holywell Date: Thu, 26 Apr 2012 17:18:35 +0100 Subject: [PATCH] simplify the code in IDF_Views_Issue a little --- src/IDF/Views/Issue.php | 5 ++--- src/IDF/templates/idf/issues/summary.html | 14 +++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/IDF/Views/Issue.php b/src/IDF/Views/Issue.php index 8f1b9f9..0717521 100644 --- a/src/IDF/Views/Issue.php +++ b/src/IDF/Views/Issue.php @@ -127,11 +127,10 @@ class IDF_Views_Issue // Issue due date statistics $overdue = $prj->getIssueCountByDueDate('overdue'); - $undue = $prj->getIssueCountByDueDate('undue'); - $combined_opened = $overdue + $undue; + $combined_opened = $overdue + $opened; $duedateStatistics = array(); if($combined_opened > 0) { - $duedateStatistics['Overdue'] = array($overdue, (int)(100 * $overdue / $combined_opened), 'Overdue'); + $duedateStatistics = array($overdue, (int)(100 * $overdue / $combined_opened)); } // Issue class tag statistics diff --git a/src/IDF/templates/idf/issues/summary.html b/src/IDF/templates/idf/issues/summary.html index dee65a4..bc5f4a1 100644 --- a/src/IDF/templates/idf/issues/summary.html +++ b/src/IDF/templates/idf/issues/summary.html @@ -109,28 +109,24 @@

{blocktrans}Unresolved: By Due Date{/blocktrans}

- {foreach $duedateStatistics as $key => $value} - + - {/foreach}
- {if !empty($value[2])} - {aurl 'url', 'IDF_Views_Issue::listOverdue', array($project.shortname, $value[2], 'due')} - {$key} - {else}{$key}{/if} + {aurl 'url', 'IDF_Views_Issue::listOverdue', array($project.shortname, 'Overdue', 'due')} + {blocktrans}Overdue{/blocktrans} {$value[0]}{$duedateStatistics[0]} - - +
+
{$value[1]}%{$duedateStatistics[1]}%