[Fusionforge-commits] r7547 - in trunk/gforge: common/reporting www/scm/reporting

Christian Bayle cbayle at libremir.placard.fr.eu.org
Thu Apr 30 21:29:51 CEST 2009


Author: cbayle
Date: 2009-04-30 21:29:50 +0200 (Thu, 30 Apr 2009)
New Revision: 7547

Modified:
   trunk/gforge/common/reporting/report_utils.php
   trunk/gforge/www/scm/reporting/commits_graph.php
Log:
Corrected utf8 display problem, removed the .0 at the end of lines number by adding a $format option.
Added translation for "Other"


Modified: trunk/gforge/common/reporting/report_utils.php
===================================================================
--- trunk/gforge/common/reporting/report_utils.php	2009-04-30 14:20:43 UTC (rev 7546)
+++ trunk/gforge/common/reporting/report_utils.php	2009-04-30 19:29:50 UTC (rev 7547)
@@ -214,7 +214,7 @@
 //
 //	Takes an array of labels and an array values and removes vals < 2% and sets up an "other"
 //
-function report_pie_arr($labels, $vals) {
+function report_pie_arr($labels, $vals, $format=1) {
 	global $pie_labels,$pie_vals;
 	//first get sum of all values
 	for ($i=0; $i<count($vals); $i++) {
@@ -226,13 +226,13 @@
 		if (($vals[$i]/$total) < .02) {
 			$rem += $vals[$i];
 		} else {
-			$pie_labels[]=util_unconvert_htmlspecialchars($labels[$i])." (". number_format($vals[$i],1) .") ";
-			$pie_vals[]=number_format($vals[$i],1);
+			$pie_labels[]=utf8_decode(util_unconvert_htmlspecialchars($labels[$i]))." (". number_format($vals[$i],$format) .") ";
+			$pie_vals[]=$vals[$i];
 		}
 	}
 	if ($rem > 0) {
-		$pie_labels[]='Other'." (". number_format($rem,1) .") ";
-		$pie_vals[]=number_format($rem,1);
+		$pie_labels[]=_('Other')." (". number_format($rem,$format) .") ";
+		$pie_vals[]=$rem;
 	}
 	
 }

Modified: trunk/gforge/www/scm/reporting/commits_graph.php
===================================================================
--- trunk/gforge/www/scm/reporting/commits_graph.php	2009-04-30 14:20:43 UTC (rev 7546)
+++ trunk/gforge/www/scm/reporting/commits_graph.php	2009-04-30 19:29:50 UTC (rev 7547)
@@ -98,7 +98,7 @@
 $graph->subtitle->Set($sys_name);
 
 // Create the tracker open plot
-report_pie_arr(util_result_column_to_array($res,0), util_result_column_to_array($res,1));
+report_pie_arr(util_result_column_to_array($res,0), util_result_column_to_array($res,1), 0);
 
 $p1  = new PiePlot3D($pie_vals);
 $p1->ExplodeSlice (0);




More information about the Fusionforge-commits mailing list