[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 1c4428260cdf17c4caa194958084f361b9547538

Franck Villaume nerville at fusionforge.org
Thu Mar 6 11:22:08 CET 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, Branch_5_3 has been updated
       via  1c4428260cdf17c4caa194958084f361b9547538 (commit)
      from  57655dd300e111ccc12363803799c8d5282996b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1c4428260cdf17c4caa194958084f361b9547538
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Wed Mar 5 13:53:53 2014 +0100

    Fix duplicated forums when monitoring several forums in the same project

diff --git a/src/common/widget/Widget_MyMonitoredForums.class.php b/src/common/widget/Widget_MyMonitoredForums.class.php
index a4a9d71..fb3a303 100644
--- a/src/common/widget/Widget_MyMonitoredForums.class.php
+++ b/src/common/widget/Widget_MyMonitoredForums.class.php
@@ -2,6 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2012-2013, Franck Villaume - TrivialDev
+ * Copyright (C) 2014 Alain Peyrat - Alcatel-Lucent
  *
  * This file is a part of FusionForge.
  *
@@ -39,7 +40,8 @@ class Widget_MyMonitoredForums extends Widget {
 
 	function getContent() {
 		$html_my_monitored_forums = '';
-		$sql="SELECT DISTINCT groups.group_id, groups.group_name, forum_group_list.group_forum_id ".
+		$sql="SELECT DISTINCT groups.group_id, groups.group_name,
+			forum_group_list.group_forum_id, forum_group_list.forum_name ".
 		"FROM groups,forum_group_list,forum_monitored_forums ".
 		"WHERE groups.group_id=forum_group_list.group_id ".
 		"AND groups.status = 'A' ".
@@ -59,17 +61,18 @@ class Widget_MyMonitoredForums extends Widget {
 		while ($r = db_fetch_array($result)) {
 			if (forge_check_perm('project', $r['group_id'], 'read')
 					&& forge_check_perm('forum', $r['group_forum_id'], 'read')) {
-				$glist[] = $r;
+				$glist[] = serialize(array($r['group_id'], $r['group_name']));
 			}
 		}
+		$glist = array_unique($glist);
 		$rows=count($glist);
 		if (!$result || $rows < 1) {
 			$html_my_monitored_forums .= '<div class="warning">' . _("You are not monitoring any forums.") . '</div><p>' . _("If you monitor forums, you will be sent new posts in the form of an email, with a link to the new message.") . '</p><p>' . _("You can monitor forums by clicking on the appropriate menu item in the discussion forum itself.") . '</p>';
 		} else {
 			$request =& HTTPRequest::instance();
 			$html_my_monitored_forums .= '<table style="width:100%">';
-			for ($j=0; $j<$rows; $j++) {
-				$group_id = $glist[$j]['group_id'];
+			foreach ($glist as $group) {
+				list($group_id, $group_name) = unserialize($group);
 
 				$sql2="SELECT forum_group_list.group_forum_id,forum_group_list.forum_name ".
 					"FROM groups,forum_group_list,forum_monitored_forums ".
@@ -107,8 +110,7 @@ class Widget_MyMonitoredForums extends Widget {
 				list($hide_now,$count_diff,$hide_url) = my_hide_url('forum',$group_id,$hide_item_id,$rows2,$hide_forum);
 
 				$html_hdr = '<tr class="boxitem"><td colspan="2">'.
-				$hide_url.'<a href="/forum/?group_id='.$group_id.'">'.
-				$glist[$j]['group_name'].'</a>    ';
+				$hide_url.'<a href="/forum/?group_id='.$group_id.'">'.$group_name.'</a>    ';
 
 				$html = '';
 				$count_new = max(0, $count_diff);

-----------------------------------------------------------------------

Summary of changes:
 src/common/widget/Widget_MyMonitoredForums.class.php |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list