aboutsummaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-12-22 02:41:05 +0000
committerlpsolit%gmail.com <>2005-12-22 02:41:05 +0000
commit955e61553118fe998670f091de8d3af5c1a91f4b (patch)
treea7d5ec965747509ff7979300a8ec41fb7080c1c1 /buglist.cgi
parenta2a422ca3f0edf77f6aafd064b4e00a5883bb1b8 (diff)
downloadbugs-955e61553118fe998670f091de8d3af5c1a91f4b.tar
bugs-955e61553118fe998670f091de8d3af5c1a91f4b.tar.gz
bugs-955e61553118fe998670f091de8d3af5c1a91f4b.tar.bz2
bugs-955e61553118fe998670f091de8d3af5c1a91f4b.tar.xz
bugs-955e61553118fe998670f091de8d3af5c1a91f4b.zip
Bug 320291: [PostgreSQL] The 'percentage complete' column cannot be displayed - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel a=justdave
Diffstat (limited to 'buglist.cgi')
-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");