[Fusionforge-commits] r8885 - in trunk/gforge: common/include www/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Mar 1 16:45:20 CET 2010


Author: lolando
Date: 2010-03-01 16:45:19 +0100 (Mon, 01 Mar 2010)
New Revision: 8885

Modified:
   trunk/gforge/common/include/Stats.class.php
   trunk/gforge/www/include/features_boxes.php
Log:
Fixed inconsistency in project activity stats between pages

Modified: trunk/gforge/common/include/Stats.class.php
===================================================================
--- trunk/gforge/common/include/Stats.class.php	2010-02-28 14:40:52 UTC (rev 8884)
+++ trunk/gforge/common/include/Stats.class.php	2010-03-01 15:45:19 UTC (rev 8885)
@@ -60,13 +60,13 @@
 	*/
 	function getMostActiveStats($type, $offset) {
 		if ($type == 'week') 	{
-			return db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,project_weekly_metric.ranking,project_weekly_metric.percentile FROM groups,project_weekly_metric WHERE groups.group_id=project_weekly_metric.group_id AND groups.is_public=1 ORDER BY ranking ASC',
-						array(),
+			return db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,project_weekly_metric.ranking,project_weekly_metric.percentile FROM groups,project_weekly_metric WHERE groups.group_id=project_weekly_metric.group_id AND groups.is_public=1 AND groups.type_id=1 AND groups.status = $1 AND groups.use_stats=1 ORDER BY ranking ASC',
+						array('A'),
 						0,
 						$offset) ;
 		} else {
-			return db_query_params ('SELECT g.group_name,g.unix_group_name,g.group_id,s.group_ranking as ranking,s.group_metric as percentile FROM groups g,stats_project_all_vw s WHERE g.group_id=s.group_id AND g.is_public=1 and s.group_ranking > 0 ORDER BY ranking ASC',
-						array(),
+			return db_query_params ('SELECT g.group_name,g.unix_group_name,g.group_id,s.group_ranking as ranking,s.group_metric as percentile FROM groups g,stats_project_all_vw s WHERE g.group_id=s.group_id AND g.is_public=1 AND g.type_id=1 AND g.status = $1 AND g.use_stats=1 AND s.group_ranking > 0 ORDER BY ranking ASC',
+						array('A'),
 						0,
 						$offset) ;
 		}

Modified: trunk/gforge/www/include/features_boxes.php
===================================================================
--- trunk/gforge/www/include/features_boxes.php	2010-02-28 14:40:52 UTC (rev 8884)
+++ trunk/gforge/www/include/features_boxes.php	2010-03-01 15:45:19 UTC (rev 8885)
@@ -9,6 +9,7 @@
 
 require_once $gfcommon.'include/FusionForge.class.php';
 require_once $gfcommon.'include/tag_cloud.php';
+require_once $gfcommon.'include/Stats.class.php';
 
 function show_features_boxes() {
 	GLOBAL $HTML,$sys_use_ratings,$sys_use_frs,$sys_use_project_tags;
@@ -202,21 +203,22 @@
 }
 
 function show_highest_ranked_projects() {
-	$result = db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,project_weekly_metric.ranking,project_weekly_metric.percentile FROM groups,project_weekly_metric WHERE groups.group_id=project_weekly_metric.group_id AND groups.is_public=1 AND groups.type_id=1 AND groups.status != $1 AND groups.use_stats=1 ORDER BY ranking ASC', 
-				   array ('D'),
-				   20);
+	$result = getMostActiveStats ('week', 0) ;
 	if (!$result || db_numrows($result) < 1) {
 		return _('No Stats Available')." ".db_error();
 	} else {
 		$return = '<table summary="">';
-		while ($row=db_fetch_array($result)) {
+		$count = 0 ;
+		while ($row=db_fetch_array($result) && $count < 20) {
 			$t_prj_activity = number_format(substr($row['ranking'],0,5),0);
 			$t_prj_link = util_make_link_g ($row['unix_group_name'],$row['group_id'],$row['group_name']);
 			
 			$return .= "<tr>";
 			$return .= '<td class="width-stat-col1">'. $t_prj_activity . "</td>";
 			$return .= '<td>' . $t_prj_link . '</td>';
-			$return .= "</tr>\n";			
+			$return .= "</tr>\n";
+			
+			$count++ ;
 		}
 		$return .= "</table>";
 		$return .= '<div class="align-center">' . util_make_link ('/top/mostactive.php?type=week', _('All project activities'), array('class' => 'dot-link')) . '</div>';




More information about the Fusionforge-commits mailing list