[Fusionforge-commits] r16433 - trunk/src/www/activity

Franck VILLAUME nerville at fusionforge.org
Wed Oct 3 23:23:07 CEST 2012


Author: nerville
Date: 2012-10-03 23:23:06 +0200 (Wed, 03 Oct 2012)
New Revision: 16433

Modified:
   trunk/src/www/activity/index.php
Log:
fix strange behavior when no activity is displayed due to permission limits

Modified: trunk/src/www/activity/index.php
===================================================================
--- trunk/src/www/activity/index.php	2012-10-03 19:26:24 UTC (rev 16432)
+++ trunk/src/www/activity/index.php	2012-10-03 21:23:06 UTC (rev 16433)
@@ -251,20 +251,24 @@
 
 	usort($results, 'date_compare');
 
-	$theader = array();
-	$theader[] = _('Time');
-	$theader[] = _('Activity');
-	$theader[] = _('By');
 
-	echo '<br/>';
-	echo $HTML->listTableTop($theader);
-
+	$displayTableTop = 0;
 	$j = 0;
 	$last_day = 0;
 	foreach ($results as $arr) {
 		if (!check_perm_for_activity($arr)) {
 			continue;
 		}
+		if (!$displayTableTop) {
+			$theader = array();
+			$theader[] = _('Time');
+			$theader[] = _('Activity');
+			$theader[] = _('By');
+
+			echo '<br/>';
+			echo $HTML->listTableTop($theader);
+			$displayTableTop = 1;
+		}
 		if ($last_day != strftime($date_format, $arr['activity_date'])) {
 			//	echo $HTML->listTableBottom($theader);
 			echo '<tr class="tableheading"><td colspan="3">'.strftime($date_format, $arr['activity_date']).'</td></tr>';
@@ -333,7 +337,12 @@
 		}
 		echo '</td></tr>';
 	}
-	echo $HTML->listTableBottom($theader);
+	if ($displayTableTop) {
+		echo $HTML->listTableBottom($theader);
+	}
+	if (!$displayTableTop) {
+		echo '<p class="information">' . _('No Activity Found') . '</p>';
+	}
 }
 
 site_project_footer(array());




More information about the Fusionforge-commits mailing list