[Fusionforge-commits] r12202 - trunk/src/www/tracker/include

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Feb 9 16:44:03 CET 2011


Author: lolando
Date: 2011-02-09 16:44:02 +0100 (Wed, 09 Feb 2011)
New Revision: 12202

Modified:
   trunk/src/www/tracker/include/ArtifactTypeHtml.class.php
Log:
Display average task completion rate

Modified: trunk/src/www/tracker/include/ArtifactTypeHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactTypeHtml.class.php	2011-02-09 15:16:15 UTC (rev 12201)
+++ trunk/src/www/tracker/include/ArtifactTypeHtml.class.php	2011-02-09 15:44:02 UTC (rev 12202)
@@ -303,6 +303,8 @@
 			$is_admin=true;
 		}
 
+		$totalPercentage = 0;
+
 		if ($taskcount > 0) {
 			echo '<tr><td colspan="2">';
 			echo '<b>'._("Related Tasks").':</b>'.'<br/>';
@@ -318,6 +320,7 @@
 			echo '<table cellspacing="0">';
 			for ($i = 0; $i < $taskcount; $i++) {
 				$taskinfo  = db_fetch_array($ah->relatedtasks, $i);
+				$totalPercentage += $taskinfo['percent_complete'];
 				$taskid    = $taskinfo['project_task_id'];
 				$projectid = $taskinfo['group_project_id'];
 				$groupid   = $taskinfo['group_id'];
@@ -335,7 +338,10 @@
 					'</tr>';
 			}
 			echo $GLOBALS['HTML']->listTableBottom();
-			echo '</td></tr>';
+
+			echo "\n<hr /><p style=\"text-align:right;\">";
+			printf(_('Average completion rate: %d%%'), (int)($totalPercentage/$taskcount));
+			echo "</p>\n";			echo '</td></tr>';
 		}
 	}
 




More information about the Fusionforge-commits mailing list