summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-12-22 03:41:05 +0100
committerlpsolit%gmail.com <>2005-12-22 03:41:05 +0100
commit955e61553118fe998670f091de8d3af5c1a91f4b (patch)
treea7d5ec965747509ff7979300a8ec41fb7080c1c1
parenta2a422ca3f0edf77f6aafd064b4e00a5883bb1b8 (diff)
downloadbugzilla-955e61553118fe998670f091de8d3af5c1a91f4b.tar.gz
bugzilla-955e61553118fe998670f091de8d3af5c1a91f4b.tar.xz
Bug 320291: [PostgreSQL] The 'percentage complete' column cannot be displayed - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel a=justdave
-rwxr-xr-xbuglist.cgi8
1 files changed, 7 insertions, 1 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 2fda33611..fb72cc790 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -560,7 +560,13 @@ DefineColumn("keywords" , "bugs.keywords" , "Keywords"
DefineColumn("estimated_time" , "bugs.estimated_time" , "Estimated Hours" );
DefineColumn("remaining_time" , "bugs.remaining_time" , "Remaining Hours" );
DefineColumn("actual_time" , "(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time", "Actual Hours");
-DefineColumn("percentage_complete","(100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))/((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete", "% Complete");
+DefineColumn("percentage_complete",
+ "(CASE WHEN (SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) " .
+ " + bugs.remaining_time = 0.0 " .
+ "THEN 0.0 " .
+ "ELSE 100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) " .
+ " /((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) + bugs.remaining_time)) " .
+ "END) AS percentage_complete" , "% Complete");
DefineColumn("relevance" , "relevance" , "Relevance" );
DefineColumn("deadline" , $dbh->sql_date_format('bugs.deadline', '%Y-%m-%d') . " AS deadline", "Deadline");