[Fusionforge-commits] r8682 - in trunk: gforge gforge/www/forum gforge/www/forum/admin gforge/www/forum/include gforge/www/include gforge/www/themes/gforge gforge/www/themes/gforge/css gforge/www/themes/gforge/images/ic tests/func/Forums tests/func/Testing

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Sun Jan 24 21:39:23 CET 2010


Author: aljeux
Date: 2010-01-24 21:39:23 +0100 (Sun, 24 Jan 2010)
New Revision: 8682

Added:
   trunk/gforge/www/themes/gforge/images/ic/forum_move.gif
Modified:
   trunk/gforge/CHANGES
   trunk/gforge/www/forum/admin/ForumAdmin.class.php
   trunk/gforge/www/forum/admin/index.php
   trunk/gforge/www/forum/attachment.php
   trunk/gforge/www/forum/forum.php
   trunk/gforge/www/forum/include/AttachManager.class.php
   trunk/gforge/www/forum/include/ForumHTML.class.php
   trunk/gforge/www/forum/message.php
   trunk/gforge/www/forum/monitor.php
   trunk/gforge/www/forum/myforums.php
   trunk/gforge/www/include/Layout.class.php
   trunk/gforge/www/themes/gforge/Theme.class.php
   trunk/gforge/www/themes/gforge/css/theme.css
   trunk/tests/func/Forums/forums.php
   trunk/tests/func/Testing/SeleniumGforge.php
Log:
Misc changes in forums: Layout + move option added to move a thread from one forum to another + new tests

Modified: trunk/gforge/CHANGES
===================================================================
--- trunk/gforge/CHANGES	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/CHANGES	2010-01-24 20:39:23 UTC (rev 8682)
@@ -35,6 +35,7 @@
   support for Arch, Bazaar, Darcs, Git, Mercurial.
 * Mediawiki plugin: mostly rewritten.  Now creates independent wikis
   for projects, allowing different sets of permissions.
+* Forums: New 'move' option to move a thread from one forum to another (Alcatel-Lucent).
 
 FusionForge-4.8.2:
 * Maintenance release, security and bugfixes.

Modified: trunk/gforge/www/forum/admin/ForumAdmin.class.php
===================================================================
--- trunk/gforge/www/forum/admin/ForumAdmin.class.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/admin/ForumAdmin.class.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -56,12 +56,20 @@
 	 *	@return  The HTML output
 	 */
 	
-	function PrintAdminMessageOptions($msg_id,$group_id,$thread_id=0,$forum_id=0) {
+	function PrintAdminMessageOptions($msg_id,$group_id,$thread_id=0,$forum_id=0,$return_to_message=0) {
 		global $HTML;
 		
-		$return = '<a href="admin/index.php?editmsg=' . $msg_id  . '&group_id=' . $group_id .  '&thread_id=' . $thread_id. '&forum_id=' . $forum_id . '">' . html_image('ic/forum_edit.gif','37','15',array('alt'=>_("Edit"))) . "</a>";
-		$return .= '    <a href="admin/index.php?deletemsg=' . $msg_id  . '&group_id=' . $group_id . '&thread_id=' . $thread_id. '&forum_id=' . $forum_id . '">' . html_image('ic/forum_delete.gif','16','18',array('alt'=>_("Delete"))) . "</a>";
-		$return .= "<br>";
+		$return = '<a href="admin/index.php?movethread=' . $thread_id  . '&amp;msg_id=' . $msg_id . '&amp;group_id=' . $group_id . '&amp;forum_id=' . $forum_id .
+				  '&amp;return_to_message=' . $return_to_message . '">' . html_image('ic/forum_move.gif','37','15',array('alt'=>_('Move thread'))). "</a>";
+
+		// Following code (if ...) is to keep old implementation but need to be cleaned
+		if ($return_to_message) {
+			$thread_id = 0;
+		}
+
+		$return .= '    <a href="admin/index.php?editmsg=' . $msg_id  . '&amp;group_id=' . $group_id .  '&amp;thread_id=' . $thread_id. '&amp;forum_id=' . $forum_id . '">' . html_image('ic/forum_edit.gif','37','15',array('alt'=>_("Edit"))) . "</a>";
+		$return .= '    <a href="admin/index.php?deletemsg=' . $msg_id  . '&amp;group_id=' . $group_id . '&amp;thread_id=' . $thread_id. '&amp;forum_id=' . $forum_id . '">' . html_image('ic/forum_delete.gif','16','18',array('alt'=>_("Delete"))) . "</a>";
+		//		$return .= "<br />";
 		return $return;
 	}
 	
@@ -366,7 +374,7 @@
 				echo "
 				<tr" . $HTML->boxGetAltRowStyle($i++). ">
 					<td>$onemsg[forum_name]</td>	
-					<td><a href=\"#\" OnClick=\"window.open('pendingmsgdetail.php?msg_id=$onemsg[msg_id]&forum_id=$onemsg[group_forum_id]&group_id=$group_id','PendingMessageDetail','width=800,height=600,status=no,resizable=yes');\">$onemsg[subject]</a></td>
+					<td><a href=\"#\" OnClick=\"window.open('pendingmsgdetail.php?msg_id=$onemsg[msg_id]&amp;forum_id=$onemsg[group_forum_id]&amp;group_id=$group_id','PendingMessageDetail','width=800,height=600,status=no,resizable=yes');\">$onemsg[subject]</a></td>
 					<td><div align=\"right\">" . html_build_select_box_from_assoc($options,"doaction[]",1) . "</div></td>
 				</tr>";
 			}

Modified: trunk/gforge/www/forum/admin/index.php
===================================================================
--- trunk/gforge/www/forum/admin/index.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/admin/index.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -67,8 +67,11 @@
 			if (!form_key_is_valid(getStringFromRequest('form_key'))) {
 				exit_form_double_submit();
 			}
-			$fa = new ForumAdmin($group_id);
-			$feedback .= $fa->ExecuteAction("add_forum");
+
+			if (check_email_available($g, $g->getUnixName() . '-' . getStringFromRequest('forum_name'), $error_msg)) {
+				$fa = new ForumAdmin($group_id);
+				$feedback .= $fa->ExecuteAction("add_forum");
+			}
 		} else if (getStringFromRequest('change_status')) {
 			$fa = new ForumAdmin($group_id);
 			$feedback .= $fa->ExecuteAction("change_status");
@@ -335,6 +338,134 @@
 				exit_permission_denied();
 			}
 		}
+	} elseif (getStringFromRequest("movethread")) {
+		$thread_id = getIntFromRequest("movethread");
+		$msg_id = getStringFromRequest("msg_id");
+		$forum_id = getIntFromRequest("forum_id");
+		$return_to_message = getIntFromRequest("return_to_message");
+		$new_forum_id = getIntFromRequest("new_forum_id");
+		$fa = new ForumAdmin();
+		if ($fa->Authorized($group_id)) {
+			if ($fa->isForumAdmin($forum_id)) {
+				if (getStringFromRequest("ok")) {
+					if ($forum_id == $new_forum_id) {
+						$feedback .= _('Thread not moved');
+					}
+					else {
+						// Move message in another forum
+						$f_from = new Forum ($fa->GetGroupObject(),$forum_id);
+						if (!$f_from || !is_object($f_from)) {
+							exit_error('Error','Could Not Get Forum Object');
+						} elseif ($f_from->isError()) {
+							exit_error('Error',$f_from->getErrorMessage());
+						}
+						$f_to = new Forum ($fa->GetGroupObject(),$new_forum_id);
+						if (!$f_to || !is_object($f_to)) {
+							exit_error('Error','Could Not Get Forum Object');
+						} elseif ($f_to->isError()) {
+							exit_error('Error',$f_to->getErrorMessage());
+						}
+
+						$ff = new ForumFactory($g);
+						if (!$ff || !is_object($ff) || $ff->isError()) {
+							exit_error(_('Error'),$ff->getErrorMessage());
+						}
+
+						if ($ff->moveThread($new_forum_id,$thread_id,$forum_id)) {
+							$feedback .= sprintf(_('Thread successfully moved from %1$s forum to %2$s forum'), $f_from->getName(),$f_to->getName());
+						} else {
+							$feedback .= $ff->getErrorMessage();
+						}
+					}
+					
+					forum_header(array('title'=>_('Edit a Message')));
+					echo '<p><a href="/forum/forum.php?forum_id=' . $new_forum_id . '">Return to the forum</a></p>';
+					echo '<p><a href="/forum/forum.php?thread_id='.$thread_id.'&amp;forum_id=' . $new_forum_id . '">Return to the thread</a></p>';
+					forum_footer(array());
+				} elseif (getStringFromRequest("cancel")) {
+					// the user cancelled the request, go back to forum
+					if ($return_to_message) {
+						header("Location: /forum/message.php?msg_id=$msg_id");
+					} else {
+						header("Location: /forum/forum.php?thread_id=$thread_id&forum_id=$forum_id");
+					}
+					exit;
+				} else { 
+					// Display select box to select new forum
+					
+					forum_header(array('title'=>_('Forums: Administration')));
+					
+					$ff = new ForumFactory($g);
+					if (!$ff || !is_object($ff) || $ff->isError()) {
+						exit_error(_("Error"),$ff->getErrorMessage());
+					}
+
+					$farr =& $ff->getForums();
+
+					if ($ff->isError()) {
+						echo '<h1>'.sprintf(_('No Forums Found For %s'), $g->getPublicName()) .'</h1>';
+						echo $ff->getErrorMessage();
+						forum_footer(array());
+						exit;
+					}
+
+					/*
+						List the existing forums so they can be edited.
+					*/
+
+					$forums = array();
+					for ($j = 0; $j < count($farr); $j++) {
+						if (!is_object($farr[$j])) {
+						//just skip it - this object should never have been placed here
+						} elseif ($farr[$j]->isError()) {
+							echo $farr[$j]->getErrorMessage();
+						} else {
+							$forums[$farr[$j]->getID()] = $farr[$j]->getName();
+						}
+					}
+					
+					$f_from = new Forum ($fa->GetGroupObject(),$forum_id);
+					if (!$f_from || !is_object($f_from)) {
+						exit_error('Error','Could Not Get Forum Object');
+					} elseif ($f_from->isError()) {
+						exit_error('Error',$f_from->getErrorMessage());
+					}
+					
+					echo '<center>
+							<form action="'.getStringFromServer('PHP_SELF').'" method="post">
+							<h3>' . sprintf(_('Move thread from %s forum to the following forum:'), $f_from->getName()) . '</h3>
+							<p>
+							<input type="hidden" name="movethread" value="'.$thread_id.'" />
+							<input type="hidden" name="group_id" value="'.$group_id.'" />
+							<input type="hidden" name="forum_id" value="'.$forum_id.'" />
+							<input type="hidden" name="msg_id" value="'.$msg_id.'" />
+							<input type="hidden" name="return_to_message" value="'.$return_to_message.'" />' .
+							html_build_select_box_from_assoc($forums,'new_forum_id',$forum_id) .
+							'<br /><br />
+							<input type="submit" name="ok" value="' . _("Submit") . '" />
+							<input type="submit" name="cancel" value="' . _("Cancel") . '" />    
+							</p>
+							</form>
+							</center>';
+
+					forum_footer(array());
+				}
+			} else {
+				exit_permission_denied();
+			}
+		} else {
+			//manage auth errors
+			if ($fa->isGroupIdError()) {
+				exit_no_group();
+			}
+			elseif ($fa->isPermissionDeniedError()) {
+				exit_permission_denied();
+			}
+		}
+		
+		
+		
+		
 	} else {
 		/*
 			Show main page for choosing

Modified: trunk/gforge/www/forum/attachment.php
===================================================================
--- trunk/gforge/www/forum/attachment.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/attachment.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -34,9 +34,6 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'forum/include/ForumHTML.class.php';
 
-if (!session_loggedin()) {
-	exit_not_logged_in();	
-}
 
 /**
 	 *  goodbye - Just prints a message and a close button.
@@ -82,9 +79,10 @@
 }
 
 if ($delete == "yes") {
-	if ( ! session_loggedin() ) {
-		exit_not_logged_in();//only logged users can delete attachments
+	if (!$f->userCanPost()) {
+		exit_permission_denied();
 	}
+
 	//only the user that created the attach  or forum admin can delete it (safecheck)
 	if (!$pending) { //pending messages aren't deleted from this page
 		$res = db_query_params ('SELECT userid FROM forum_attachment WHERE attachmentid=$1',
@@ -111,9 +109,10 @@
 
 if ($edit=="yes") {
 	
-	if ( ! session_loggedin() ) {
-		exit_not_logged_in();//only logged users can edit attachments
+	if (!$f->userCanPost()) {
+		exit_permission_denied();
 	}
+
 	//only the user that created the attach  or forum admin can edit it (safecheck)
 	if (!$pending) { //pending messages aren't deleted from this page
 		$res = db_query_params ('SELECT filename FROM forum_attachment WHERE attachmentid=$1',

Modified: trunk/gforge/www/forum/forum.php
===================================================================
--- trunk/gforge/www/forum/forum.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/forum.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -250,8 +250,8 @@
 
 			$ret_val .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($total_rows) .'>
 				<td><a href="'.util_make_url ('/forum/message.php?msg_id='.$msg->getID().
-							      '&ampgroup_id='.$group_id).'">'.
-				html_image('ic/msg.png',"10","12",array("border"=>"0"));
+							      '&amp;group_id='.$group_id).'&amp;reply=0">'.
+				html_image('ic/msg.png',"10","12",array("border"=>"0")).' ';
 			/*
 				See if this message is new or not
 				If so, highlite it in bold
@@ -267,7 +267,7 @@
 				show the subject and poster
 			*/
 			$ret_val .= $bold_begin.$msg->getSubject() .$bold_end.'</a></td>'.
-				'<td>'. $msg->getPosterRealName() .'</td>'.
+				'<td><a href="/users/'.$msg->getPosterName().'/">'.$msg->getPosterRealName().'</a></td>'.
 				'<td>'. date(_('Y-m-d H:i'),$msg->getPostDate()) .'</td></tr>';
 
 			if ($msg->hasFollowups()) {
@@ -340,7 +340,7 @@
 					show the subject and poster
 			*/
 			$ret_val .= $bold_begin.$row['subject'] .$bold_end.'</a></td>'.
-				'<td>'. $row['realname'] .'</td>'.
+				'<td><a href="/users/'.$row['user_name'].'/">'.$row['realname'].'</a></td>'.
 				'<td>'. $row['followups'] .'</td>'.
 				'<td>'.date(_('Y-m-d H:i'),$row['recent']).'</td></tr>';
 			$i++;

Modified: trunk/gforge/www/forum/include/AttachManager.class.php
===================================================================
--- trunk/gforge/www/forum/include/AttachManager.class.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/include/AttachManager.class.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -125,7 +125,7 @@
 		if ($msg->isPending()) {
 			$res = db_query_params ('SELECT attachmentid,filename,userid,counter FROM forum_pending_attachment where msg_id=$1',
 						array ($msg_id));
-			$pend = "&pending=yes";
+			$pend = "&amp;pending=yes";
 		} else {
 			$res = db_query_params ('SELECT attachmentid,filename,userid,counter FROM forum_attachment where msg_id=$1',
 						array ($msg_id));
@@ -137,7 +137,7 @@
 		}
 		if ($attachid) {
 			$attach = "<br/>
-			<a href=\"javascript:manageattachments('".util_make_url("/forum/attachment.php?attachid=$attachid&group_id=$group_id&forum_id=$forum_id$pend")."','no');\">" . html_image('ic/cfolder15.png',"15","13",array("border"=>"0")) . db_result($res,0,'filename') . "</a>  (" . db_result($res,0,'counter') . ") downloads";
+			<a href=\"javascript:manageattachments('".util_make_url("/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id$pend")."','no');\">" . html_image('ic/cfolder15.png',"15","13",array("border"=>"0")) . db_result($res,0,'filename') . "</a>  (" . db_result($res,0,'counter') . ") downloads";
 			$attach_userid = db_result($res,0,'userid');
 			
 			$f = $msg->getForum();
@@ -145,8 +145,8 @@
 			exit_error('Error', _('Could Not Get Forum Object'));
 			} else {
 				if ( ((user_getid() == $attach_userid) || ($f->userIsAdmin())) && (!$msg->isPending()) ) { //only permit the user who created the attach to delete it, or an admin
-					$attach .= "   <a href=\"javascript:manageattachments('".util_make_url ("/forum/attachment.php?attachid=$attachid&group_id=$group_id&forum_id=$forum_id&msg_id=$msg_id&edit=yes")."','no');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_edit.gif','37','15',array('alt'=>_("Edit"))) . "</font></a>";
-					$attach .= "     <a href=\"javascript:manageattachments('".util_make_url("/forum/attachment.php?attachid=$attachid&group_id=$group_id&forum_id=$forum_id&delete=yes")."','yes');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_delete.gif','16','18',array('alt'=>_("Delete"))) . "</font></a>";
+					$attach .= "   <a href=\"javascript:manageattachments('/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$msg_id&amp;edit=yes','no');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_edit.gif','37','15',array('alt'=>_("Edit"))) . "</font></a>";
+					$attach .= "     <a href=\"javascript:manageattachments('/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;delete=yes','yes');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_delete.gif','16','18',array('alt'=>_("Delete"))) . "</font></a>";
 				}
 			}
 		}	else {
@@ -155,9 +155,10 @@
 			if (!$f || !is_object($f)) {
 			exit_error('Error','Could Not Get Forum Object');
 			} else {
-				$attach = html_image('ic/cfolder15.png',"15","13",array("border"=>"0")) . _('No attachment found');
+//				$attach = html_image('ic/cfolder15.png',"15","13",array("border"=>"0")) . _('No attachment found');
+				$attach = '';
 				if ( ((user_getid() == $msg->getPosterID()) || ($f->userIsAdmin())) && (!$msg->isPending()) ) { //only permit an admin or the user who created the message to insert an attach
-					$attach .= "   <a href=\"javascript:manageattachments('".util_make_url ("/forum/attachment.php?attachid=0&group_id=$group_id&forum_id=$forum_id&msg_id=$msg_id&edit=yes")."','no');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_add.gif','37','15',array('alt'=>_("Add"))) . "</font></a>";
+					$attach .= "   <a href=\"javascript:manageattachments('".util_make_url ("/forum/attachment.php?attachid=0&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$msg_id&amp;edit=yes")."','no');\">" .  "<font size=\"-3\">" .  html_image('ic/forum_add.gif','37','15',array('alt'=>_("Add"))) . "</font></a>";
 				}
 			}
 		}

Modified: trunk/gforge/www/forum/include/ForumHTML.class.php
===================================================================
--- trunk/gforge/www/forum/include/ForumHTML.class.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/include/ForumHTML.class.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -24,7 +24,7 @@
 require_once $gfwww.'forum/include/AttachManager.class.php';
 
 function forum_header($params) {
-	global $HTML,$group_id,$forum_name,$forum_id,$sys_news_group,$f,$sys_use_forum,$group_forum_id;
+	global $HTML,$group_id,$forum_name,$forum_id,$sys_news_group,$f,$sys_use_forum,$sys_use_trove,$group_forum_id;
 
 	if ($group_forum_id) {
 		$forum_id=$group_forum_id;
@@ -66,14 +66,30 @@
 				<strong>'._('Posted by').':</strong> '.$user->getRealName().'<br />
 				<strong>'._('Date').':</strong> '. date(_('Y-m-d H:i'),db_result($result,0,'post_date')).'<br />
 				<strong>'._('Summary').':</strong>'.
-					util_make_link ('/forum/forum.php?forum_id='.db_result($result,0,'forum_id').'&group_id='.$group_id,
+					util_make_link ('/forum/forum.php?forum_id='.db_result($result,0,'forum_id').'&amp;group_id='.$group_id,
 							db_result($result,0,'summary')).'<br/>
 				<strong>'._('Project').':</strong>'.
 					util_make_link_g ($group->getUnixName(),db_result($result,0,'group_id'),$group->getPublicName()).'<br />
 				<p>
-				'. (util_make_links(nl2br(db_result($result,0,'details'))));
+				';
+				$body = db_result($result,0,'details');
+				$sanitizer = new TextSanitizer();
+				$body = $sanitizer->purify($body);
+				if (!strstr($body,'<')) {
+					//backwards compatibility for non html messages
+					echo util_make_links(nl2br($body)); 
+				} else {
+					echo util_make_links($body);
+				}
 
 				echo '</p>';
+
+				// display classification
+				if ($params['group'] == $sys_news_group) { 
+				   print stripslashes(trove_news_getcatlisting(db_result($result,0,'forum_id'),0,1));
+				} elseif ($sys_use_trove) {
+				   print stripslashes(trove_getcatlisting($params['group'],0,1));
+				}
 			}
 			echo '</td><td valign="top" width="35%">';
 			echo $HTML->boxTop(_('Latest News'));
@@ -91,14 +107,14 @@
 	$menu_links=array();
 
 	if ($f){
+		if ($forum_id) {
+			$menu_text[]=_('Discussion Forums:') .' '. $f->getName();
+			$menu_links[]='/forum/forum.php?forum_id='.$forum_id;
+		}
 		if ($f->userIsAdmin()) {
 			$menu_text[]=_('Admin');
 			$menu_links[]='/forum/admin/?group_id='.$group_id;
 		} 
-		if ($forum_id) {
-			$menu_text[]=_('Discussion Forums:') .' '. $f->getName();
-			$menu_links[]='/forum/forum.php?forum_id='.$forum_id;
-		}
 	} else {
 			$gg=&group_get_object($group_id);
 			$perm =& $gg->getPermission( session_get_user() );
@@ -126,6 +142,9 @@
 			echo util_make_link ('/forum/save.php?forum_id='.$forum_id.'&amp;group_id='.$group_id,
 					     html_image('ic/save.png','24','24',array()) .' '._('Save Place')).' | ';
 		}
+	} elseif ($f) {
+		echo '<a href="/forum/monitor.php?forum_id='.$forum_id.'&amp;group_id='.$group_id.'&amp;start=1">' .
+			html_image('ic/mail16w.png','20','20',array()).' '._('Monitor Forum').'</a> | ';		
 	}
 
 	if ($f && $forum_id) {
@@ -184,7 +203,7 @@
 		$ret_val .= '
 		<table border="0">
 			<tr>
-				<td class="tablecontent" nowrap="nowrap">'._('By:').
+				<td class="tablecontent" style="white-space: nowrap;">'._('By:').
 		$msg->getPosterRealName().
 		'<br />
 					';
@@ -229,26 +248,27 @@
 		$am = new AttachManager();
 		$fa = new ForumAdmin();
 		$msgforum =& $msg->getForum();
-		$ret_val = '
-		<table border="0">
+		$url = util_make_url('/forum/message.php?msg_id='. $msg->getID() .'&amp;group_id='.$group_id);
+		$ret_val = 		
+		'<table border="0" width="100%" cellspacing="0">
 			<tr>
-				<td class="tablecontent" nowrap="nowrap">';
+				<td class="tablecontent" style="white-space: nowrap;" valign="top">'; 
+		$ret_val .= $bold_begin. $msg->getSubject(). ' <a href="'.$url.'">[ '._("reply").' ]</a>'. $bold_end;
+		$ret_val .= '<br/>'._('By:').' '.util_make_link_u ($msg->getPosterName(),$msg->getPosterID(),$msg->getPosterRealName());
+		$ret_val .= ' on '.date('Y-m-d H:i',$msg->getPostDate());
+		$ret_val .= '</td><td class="tablecontent"  align="right">';
+		$ret_val .= '<a href="'.$url.'">[forum:'.$msg->getID().']</a><br/>';
 		if ($msgforum->userIsAdmin()) {
 			$ret_val .= $fa->PrintAdminMessageOptions($msg->getID(),$group_id,$msg->getThreadID(),$msgforum->getID());
 		} 
-		$ret_val .= _('By:').' '.util_make_link_u ($msg->getPosterName(),$msg->getPosterID(),$msg->getPosterRealName()).'<br />
-';
-		$ret_val .= $am->PrintAttachLink($msg,$group_id,$msgforum->getID()) . '
-					<br />'.util_make_link ('/forum/message.php?msg_id='.$msg->getID() .'&group_id='.$group_id,
-		html_image('ic/msg.png',"10","12",array("border"=>"0")) .
-								$bold_begin. $msg->getSubject() .' [ '._('reply').' ]'. $bold_end) .' &nbsp; '.
-		'<br />'. date(_('Y-m-d H:i'),$msg->getPostDate()) .'
+		$ret_val .= $am->PrintAttachLink($msg,$group_id,$msgforum->getID());
+		$ret_val .= '
 				</td>
 			</tr>
 			<tr>
-				<td>
+				<td colspan="2">
 					'; 
-		if (!strstr($msg->getBody(),'<')) {
+					if (strpos($msg->getBody(),'<') === false) {
 			$ret_val .= nl2br($msg->getBody()); //backwards compatibility for non html messages
 		} else {
 			$ret_val .= $msg->getBody();
@@ -275,7 +295,6 @@
 	function LinkAttachEditForm($filename,$group_id,$forum_id,$attachid,$msg_id) {
 		$return_val = '
 			
-			<p>
 			<form action="' . getStringFromServer('PHP_SELF') . '" method="post" enctype="multipart/form-data">
 			<table>
 			<tr>
@@ -391,7 +410,7 @@
 				$total_rows++;
 
 				$ret_val .= '
-					<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($total_rows) .'><td nowrap="nowrap">';
+					<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($total_rows) .'><td style="white-space: nowrap;">';
 				/*
 					How far should it indent?
 					*/
@@ -403,7 +422,7 @@
 					If it this is the message being displayed, don't show a link to it
 					*/
 				if ($current_message != $msg_arr["$msg_id"][$i]->getID()) {
-					$ah_begin='<a href="'.util_make_url ('/forum/message.php?msg_id='. $msg_arr["$msg_id"][$i]->getID() .'&group_id='.$group_id).'">';
+					$ah_begin='<a href="'.util_make_url ('/forum/message.php?msg_id='. $msg_arr["$msg_id"][$i]->getID() .'&amp;group_id='.$group_id).'">';
 					$ah_end='</a>';
 				} else {
 					$ah_begin='';
@@ -411,7 +430,7 @@
 				}
 
 				$ret_val .= $ah_begin .
-				html_image('ic/msg.png',"10","12",array("border"=>"0"));
+					html_image('ic/msg.png',"10","12",array("border"=>"0")).' ';
 				/*
 					See if this message is new or not
 					*/
@@ -462,29 +481,25 @@
 			echo notepad_func();
 			?>
 <div align="center">
-	 <form enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/admin/index.php') ?>"
-	method="post"><?php $objid = $this->Forum->getID();?> <input
-	type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" /> <input
-	type="hidden" name="forum_id" value="<?php echo $objid; ?>" /> <input
-	type="hidden" name="editmsg" value="<?php echo $msg_id; ?>" /> <input
-	type="hidden" name="is_followup_to"
-	value="<?php echo $is_followup_to; ?>" /> <input type="hidden"
-	name="form_key" value="<?php echo form_generate_key();?>"> <input
-	type="hidden" name="posted_by" value="<?php echo $posted_by;?>"> <input
-	type="hidden" name="post_date" value="<?php echo $post_date;?>"> <input
-	type="hidden" name="has_followups" value="<?php echo $has_followups;?>">
-<input type="hidden" name="most_recent_date"
-	value="<?php echo $most_recent_date;?>"> <input type="hidden"
-	name="group_id" value="<?php echo $group_id;?>">
+	 <form enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/admin/index.php') ?>" method="post">
+	<?php $objid = $this->Forum->getID();?>
+	<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
+	<input type="hidden" name="forum_id" value="<?php echo $objid; ?>" />
+	<input type="hidden" name="editmsg" value="<?php echo $msg_id; ?>" />
+	<input type="hidden" name="is_followup_to" value="<?php echo $is_followup_to; ?>" />
+	<input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
+	<input type="hidden" name="posted_by" value="<?php echo $posted_by;?>">
+	<input type="hidden" name="post_date" value="<?php echo $post_date;?>">
+	<input type="hidden" name="has_followups" value="<?php echo $has_followups;?>">
+	<input type="hidden" name="most_recent_date" value="<?php echo $most_recent_date;?>">
+	<input type="hidden" name="group_id" value="<?php echo $group_id;?>">
 <fieldset class="fieldset">
-<table>
-	<tr>
-		<td valign="top"></td>
-		<td valign="top"><br>
+			<table><tr><td valign="top">
+			</td><td valign="top">
+			<br />
 		<strong><?php echo _('Subject:'); ?></strong><?php echo utils_requiredField(); ?><br />
-		<input type="text" name="subject" value="<?php echo $subject; ?>"
-			size="70" /> <br>
-		<br>
+				<input type="text" name="subject" value="<?php echo $subject; ?>" size="80" maxlength="80" />
+		<br /><br />
 		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms[1].body') ?><?php echo utils_requiredField(); ?><br />
 		<?php
 		$GLOBALS['editor_was_set_up']=false;
@@ -499,24 +514,22 @@
 			echo '<textarea name="body"  rows="10" cols="70">' . $body . '</textarea>';
 		}
 		unset($GLOBALS['editor_was_set_up']);
-		?> <br>
-		<br>
+				?>
+			<br /><br />		
 
-		<p><?php //$this->LinkAttachForm();?>
+				<p>
+				<?php //$this->LinkAttachForm();?>
+				<p>
 		
 		
-		<p><?php
-		?> <br />
-		
-		
-		<center><input type="submit" name="ok"
-			value="<?php echo _('Update'); ?>" /> <input type="submit"
-			name="cancel" value="<?php echo _('Cancel'); ?>" /></center>
+		<?php
+		?>
+		<br />
+		<center><input type="submit" name="ok" value="<?php echo _('Update'); ?>" />
+			<input type="submit" name="cancel" value="<?php echo _('Cancel'); ?>" />
+		</center>
 		</p>
-		</td>
-	</tr>
-</table>
-</fieldset>
+			</td></tr></table></fieldset>
 </form>
 </div>
 		<?php
@@ -538,24 +551,19 @@
 		echo notepad_func();
 		?>
 <div align="center">
-<form "enctype="multipart/form-data"
-	action="<?php echo util_make_url ('/forum/forum.php?forum_id='.$this->Forum->getID().'&group_id='.$group_id); ?>"
-	method="post"><?php $objid = $this->Forum->getID();?> <input
-	type="hidden" name="post_message" value="y" /> <input type="hidden"
-	name="thread_id" value="<?php echo $thread_id; ?>" /> <input
-	type="hidden" name="msg_id" value="<?php echo $is_followup_to; ?>" /> <input
-	type="hidden" name="is_followup_to"
-	value="<?php echo $is_followup_to; ?>" /> <input type="hidden"
-	name="form_key" value="<?php echo form_generate_key();?>">
-<fieldset class="fieldset">
-<table>
-	<tr>
-		<td valign="top"></td>
-		<td valign="top"><br>
+<form enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/forum.php?forum_id='.$this->Forum->getID().'&amp;group_id='.$group_id); ?>" method="post">
+	<?php $objid = $this->Forum->getID();?>
+	<input type="hidden" name="post_message" value="y" />
+	<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
+	<input type="hidden" name="msg_id" value="<?php echo $is_followup_to; ?>" />
+	<input type="hidden" name="is_followup_to" value="<?php echo $is_followup_to; ?>" />
+	<input type="hidden" name="form_key" value="<?php echo form_generate_key();?>" />
+			<fieldset class="fieldset"><table><tr><td valign="top">
+			</td><td valign="top">
+			<br />
 		<strong><?php echo _('Subject:'); ?></strong><?php echo utils_requiredField(); ?><br />
-		<input type="text" name="subject" value="<?php echo $subject; ?>"
-			size="70" /> <br>
-		<br>
+				<input type="text" name="subject" value="<?php echo $subject; ?>" size="80" maxlength="80" />
+			<br /><br />
 		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms[1].body') ?><?php echo utils_requiredField(); ?><br />
 
 		<?php
@@ -598,9 +606,11 @@
 } elseif ($this->Forum->allowAnonymous()) {
 	echo '<span class="error">';
 	printf(_('You could post if you were <a href="%1$s">logged in</a>.'), util_make_url ('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))));
+	echo '</span>';
 } elseif (!session_loggedin()) {
-	echo '
-			<span class="error">'.sprintf(_('Please <a href="%1$s">log in</a>'), util_make_url('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI')))).'</span><br/></p>';
+	echo '<span class="error">';
+	printf(_('Please <a href="%1$s">log in</a>'), util_make_url('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))));
+	echo '</span><br/></p>';
 } else {
 	//do nothing
 }

Modified: trunk/gforge/www/forum/message.php
===================================================================
--- trunk/gforge/www/forum/message.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/message.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -29,6 +29,8 @@
 $msg_id = getIntFromRequest('msg_id');
 $total_rows = getIntFromRequest('total_rows');
 $ret_val = getIntFromRequest('ret_val');
+$reply = getIntFromRequest('reply', 1);
+
 if ($msg_id) {
 
 	/*
@@ -95,34 +97,46 @@
 		exit_error(_('Error'),$fh->getErrorMessage());
 	}
 
+	if ($reply && !$f->userCanPost()) {
+		exit_permission_denied();
+	}
+	
 	forum_header(array('title'=>$fm->getSubject(),'forum_id'=>$forum_id));
 
-	$title_arr=array();
-	$title_arr[]=_('Message').': '.$msg_id;
+//	$title_arr=array();
+//	$title_arr[]=_('Message').': '.$msg_id;
 
-	echo $GLOBALS['HTML']->listTableTop ($title_arr);
+//	echo $GLOBALS['HTML']->listTableTop ($title_arr);
 
-	echo "<tr class=\"tablecontent\"><td>\n";
+	$url = util_make_url('/forum/message.php?msg_id='. $msg_id .'&amp;group_id='.$group_id);
+	
+	echo '<br /><br /><table border="0" width="100%" cellspacing="0">';
+	echo '<tr class="tablecontent"><td valign="top">'."\n";
+	echo '<strong>'.$fm->getSubject() .'</strong>';
+	if (!$reply) {
+		echo ' <a href="'.$url.'&amp;reply=1">[ '._("reply").' ]</a>';
+	}
+	echo '<br />';
+	echo _("By:").' '. util_make_link_u($fm->getPosterName(), $fm->getPosterID(), $fm->getPosterRealName());
+	echo ' on '. date(_('Y-m-d H:i'), $fm->getPostDate()) .'</td><td align="right">';
+	echo '<a href="'.$url.'">[forum:'.$msg_id.']</a><br/>';
 	$fa = new ForumAdmin();
 	if ($f->userIsAdmin()) {
 		echo $fa->PrintAdminMessageOptions($msg_id,$group_id,0,$forum_id); // 0 in thread id because that tells us to go back to message.php instead of forum.php
 	}
-	echo _('BY').': '. $fm->getPosterRealName() .' ('.util_make_link_u($fm->getPosterName(),$fm->getPosterID(),$fm->getPosterName()) .')<br />';
-	echo _('DATE').': '. date(_('Y-m-d H:i'), $fm->getPostDate()) .'<br />';
 	$am = new AttachManager();
 	echo $am->PrintHelperFunctions();
-	echo $am->PrintAttachLink($fm,$group_id,$forum_id) . '<br/>';
+	echo $am->PrintAttachLink($fm,$group_id,$forum_id) . '</td></tr><tr><td colspan="2"><br/><br />';
 	
-	echo _('SUBJECT').': '. $fm->getSubject() .'<p>&nbsp;</p>';
 	
-	if (!strstr('<',$fm->getBody())) { 
-		echo nl2br($fm->getBody()); //backwards compatibility for non html messages
+	if (strpos($fm->getBody(), '>') === false) { 
+		echo util_make_links(nl2br($fm->getBody())); //backwards compatibility for non html messages
 	} else {
-		echo $fm->getBody();
+		echo util_make_links($fm->getBody());
 	}
-	echo "</td></tr>";
+	echo '</td></tr></table>';
 
-	echo $GLOBALS['HTML']->listTableBottom();
+//	echo $GLOBALS['HTML']->listTableBottom();
 
 	/*
 
@@ -167,7 +181,7 @@
 		}
 		$ret_val .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($total_rows) .'>
 			<td>'. $ah_begin .
-			html_image('ic/msg.png',"10","12",array("border"=>"0"));
+			html_image('ic/msg.png',"10","12",array("border"=>"0")).' ';
 		/*
 			See if this message is new or not
 			If so, highlite it in bold
@@ -182,7 +196,7 @@
 			show the subject and poster
 		*/
 		$ret_val .= $bold_begin . $msg->getSubject() . $bold_end.$ah_end.'</td>'.
-			'<td>'. $msg->getPosterRealName() .'</td>'.
+			'<td><a href="/users/'.$msg->getPosterName().'">'. $msg->getPosterRealName() .'</a></td>'.
 			'<td>'. date(_('Y-m-d H:i'),$msg->getPostDate()) .'</td></tr>';
 
 		if ($msg->hasFollowups()) {
@@ -195,15 +209,14 @@
 
 		echo $ret_val;
 
-	/*
-		Show post followup form
-	*/
+	if ($reply) {
+		/*
+			Show post followup form
+		*/
+		echo '<div align="center"><h3>'._('Post a followup to this message').'</h3></div>';
+		$fh->showPostForm($fm->getThreadID(), $msg_id, $fm->getSubject());
+	}
 
-//	echo '<p>&nbsp;<p>';
-	echo '<div align="center"><h3>'._('Post a followup to this message').'</h3></div>';
-
-	$fh->showPostForm($fm->getThreadID(), $msg_id, $fm->getSubject());
-
 } else {
 	forum_header(array('title'=>_('Must Choose A Message First')));
 	echo '<h1>'._('You Must Choose A Message First').'</h1>';

Modified: trunk/gforge/www/forum/monitor.php
===================================================================
--- trunk/gforge/www/forum/monitor.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/monitor.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -43,6 +43,21 @@
 		}
 
 		if (getStringFromRequest('stop')) {
+			$confirm = getStringFromRequest('confirm');
+			$cancel = getStringFromRequest('cancel');
+			if ($cancel) {
+				header ("Location: /forum/forum.php?forum_id=$forum_id&group_id=$group_id");
+				exit;
+			}
+			if (!$confirm) {
+				forum_header(array('title'=>_('My Monitored Forums')));
+				echo $HTML->confirmBox('You are about to stop monitoring the '.$f->getName().
+					' forum.<br/><br/>Do you really want to unsubscribe ?', 
+					array('group_id' => $group_id, 'forum_id' => $forum_id, 'stop' => 1),
+					array('confirm' => 'Unsubscribe', 'cancel' => 'Cancel') );
+				forum_footer(array());
+				exit;
+			}
 			if (!$f->stopMonitor()) {
 				exit_error('Error',$f->getErrorMessage());
 			} else {

Modified: trunk/gforge/www/forum/myforums.php
===================================================================
--- trunk/gforge/www/forum/myforums.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/forum/myforums.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -46,6 +46,16 @@
 
 $user_id = user_getid();
 $group_id = getIntFromRequest("group_id");
+
+// If the link comes from the project, display the project header. If it comes from the user page, display the normal site header
+if ($group_id) {
+    forum_header(array('title'=>_('My Monitored Forums')));
+} else {
+    site_header(array('title'=>_('My Monitored Forums'), 'user_id' => $user_id));
+}
+
+echo "<h1>" . _('My Monitored Forums') . "</h1>";
+
 //get the user monitored forums
 $result = db_query_params ('SELECT mon.forum_id, fg.group_id FROM forum_monitored_forums mon,forum_group_list fg where mon.user_id=$1 and fg.group_forum_id=mon.forum_id',
 			   array ($user_id));
@@ -60,14 +70,6 @@
 	$monitored_forums[$i] = db_fetch_array($result);
 }
 
-//if the link comes from the project, display the project header. If it comes from the user page, display the normal site header
-if ($group_id) {
-	forum_header(array('title'=>_('My Monitored Forums')));
-}	else {
-	site_header(array('title'=>_('My Monitored Forums'), 'user_id' => $user_id));
-}
-
-echo "<h4>" . _('My Monitored Forums') . "</h4>";
 $tablearr=array(_('Project'),_('Forum'),
 				_('Description'),_('Threads'),
 				_('Posts'), _('Last Post'), _('New Content?'));
@@ -75,7 +77,6 @@
 
 $i = 0;
 
-
 $f = array();
 //CHECK : if we won't ever be needing to store each forum/fmf, etc for each pass, don't use an array and use the same variable like $fmf instead of $fmf[$i], etc
 for($i=0;$i<sizeof($monitored_forums);$i++) {

Modified: trunk/gforge/www/include/Layout.class.php
===================================================================
--- trunk/gforge/www/include/Layout.class.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/include/Layout.class.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -1218,6 +1218,41 @@
 		return $ret;
 	}
 
+	function confirmBox($msg, $params, $buttons, $image='*none*') {
+	 	if ($image == '*none*') {
+	 		$image = html_image('stop.png','48','48',array());
+	 	}
+	 	
+	 	foreach ($params as $b => $v) {
+	 		$prms[] = '<input type="hidden" name="'.$b.'" value="'.$v.'" />'."\n";
+	 	}
+	 	$prm = join('	 	', $prms);	 
+	 	
+	 	foreach ($buttons as $b => $v) {
+	 		$btns[] = '<input type="submit" name="'.$b.'" value="'.$v.'" />'."\n";
+	 	}
+		$btn = join('	 	&nbsp;&nbsp;&nbsp;'."\n	 	", $btns);	 	
+	 	
+	 	return '
+	 	<div id="infobox" style="margin-top: 15%; margin-left: 15%; margin-right: 15%; text-align: center;">
+	 	<table align="center">
+	 	<tr>
+	 	<td>'.$image.'</td>
+	 	<td>'.$msg.'<br/></td>
+		</tr>
+		<tr>
+		<td colspan="2" align="center">
+		<br />
+		<form action="' . getStringFromServer('PHP_SELF') . '" method="get" >
+		'.$prm.'
+		'.$btn.'
+		</form>
+		</td>
+		</tr>
+		</table>
+		</div>
+	 	';
+	}
 }
 
 // Local Variables:

Modified: trunk/gforge/www/themes/gforge/Theme.class.php
===================================================================
--- trunk/gforge/www/themes/gforge/Theme.class.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/themes/gforge/Theme.class.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -201,7 +201,7 @@
 
 <table border="0" width="100%" cellspacing="0" cellpadding="0">  
   <tr>
-    <td class="mainCanvas"> <!-- main body area -->
+    <td id="main" class="mainCanvas"> <!-- main body area -->
     <?php
     }
 

Modified: trunk/gforge/www/themes/gforge/css/theme.css
===================================================================
--- trunk/gforge/www/themes/gforge/css/theme.css	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/gforge/www/themes/gforge/css/theme.css	2010-01-24 20:39:23 UTC (rev 8682)
@@ -87,10 +87,6 @@
   font-family: courier, sans-serif
 }
 
-td {
-  text-align: left
-}
-
 /* the style of the label on a box title  */
 .titlebar {
   text-decoration: none;

Added: trunk/gforge/www/themes/gforge/images/ic/forum_move.gif
===================================================================
--- trunk/gforge/www/themes/gforge/images/ic/forum_move.gif	                        (rev 0)
+++ trunk/gforge/www/themes/gforge/images/ic/forum_move.gif	2010-01-24 20:39:23 UTC (rev 8682)
@@ -0,0 +1,7 @@
+GIF89a%  çÇ  ]Œ^Œ_aišh”k›	k›
+lœlœ
+mœ
+mnnqŸo™r t¡u¢w£w¢"y¤#z¥(}§)}§0|¡5„ª6„«6…«7†­8‡­=‰®DŒ°E°EŽ²FŽ²H²c‹ŸM‘²N’³P”µV—¶m“¥Y˜·až¼bž¼~Ÿ°v£¹z¥¹t¨Á{§¼w©Âv«Äx¬Åy¬Å~®Æ~°È€°Ç€°È€°É‚±È‡±Æˆ²Æ«¬¬™¼Í›¼Ì¸¸¸™¿Ñœ¿ÐœÀПÀРÀФÅÕ§ÈتÉØ®ËÙÆÆÅÉÉÉÌÌ˽ÔßÈÖÝÄ×àÊ×ÝÎ×ÛÖÖÕ××Ö×××ØØ×ÙÙÙÏÜàÚÚÚÜÜÜÖÞâÖßäÔáèßßßÕâéÛáåâããÝäèÞäçãããããääããäãäãäããääääãäääåååååææååæåæÞçìåæåàçêåææåæçææåæææææçäçèáèêèèèéèèéèéâêíèéèãêíèééééèéééäëîêêêèëíäìïêëêëëêëëëçìîäíòéìîëìììììèíïëíîìíîíííííîîíîêîðëîïíîííîîîîíîîîíïîïïïðððððññðððñññññòòòóòòòóóóóòóóóôôôôôõõõõõõöõööööõø÷÷ø÷ø÷ø÷÷øøøø÷øøøøøùùùøúúúûúúûúûúûúúûûûûúûûûýüüýüýüýüüýýýýüýýýýýþþýýýþýþþýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!þCreated with GIMP !ù  ÿ ,    %   þ 1@@  *\È°!€Ç <Pq¬¢Å‹3j´È¨€ .œ#&¬˜±bÂR’L9l¥0`)cëÌ°_¾fͺ! É^@ƒîâ¥W.^FqíÚeË–.[LŸÚºÅ«©­V­¨2ˆ-³jõuV¬±:_É2K¬X¯^¹B%Jë•B«ìp !	”°Zå¥Ã`A ¤J•‡âˆ@páIªI“ì:EÀ$$	l,BbáÔ©5,Ñ qŠ…ŽQ¦r´(…bÈ¥%HM¤•Ê¤P}âDÀ§M>yZ çÓ ¢LiBO
+h'àio[Ú!ߤ	y¥M™l¢¤€Ì¤1&aúP„ȇI”t™T	s›6Zaщ#(b Žh 3äCÁÁG ’È	+„‘E
+Šü§•£BÀ ‚ôA ˆØG Ph`€RðÁPPÇ{pa‚ ±‡‡LÑ
+w܁‘E&i‡wÐqw¼r¼Á$nXIÇZ ³”f°a†i QFk¨‘Ff”æeÔi§b”¡% P‚B*è „j¨ ?ôyL/8äè£A ;
\ No newline at end of file

Modified: trunk/tests/func/Forums/forums.php
===================================================================
--- trunk/tests/func/Forums/forums.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/tests/func/Forums/forums.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -49,12 +49,8 @@
 {
 	function testSimplePost()
 	{
-		$this->createProject('ProjectA');
-					
 		// Create the first message (Message1/Text1).
-		$this->open( BASE );
-		$this->click("link=ProjectA");
-		$this->waitForPageToLoad("30000");
+		$this->init();
 		$this->click("link=Forums");
 		$this->waitForPageToLoad("30000");
 		$this->assertFalse($this->isTextPresent("Permission denied."));
@@ -75,5 +71,93 @@
 		$this->waitForPageToLoad("30000");
 		$this->assertTrue($this->isTextPresent("Message1"));
 	}
+
+	/*
+	 * Simulate a click on the link from a mail.
+	 * As the forum is private, the users should be
+	 * redirected to the login prompt saying that he has
+	 * to login to get access to the message. Once logged,
+	 * he should be redirected to the given forum.
+	 */
+	function testSimpleAccessWhenPrivate()
+	{
+		$this->init();
+		$this->logout();
+
+		$this->open( ROOT.'/forum/message.php?msg_id=3' );
+		$this->waitForPageToLoad("30000");
+		$this->type("form_loginname", 'admin');
+		$this->type("form_pw", 'myadmin');
+		$this->click("login");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Welcome to Developers"));
+	}
+
+	/*
+	 * Simulate a user non logged that will reply
+	 * to a message in a forum. He will be redirected
+	 * to the login page, then will reply and then
+	 * we check that his reply is present in the thread.
+	 */
+	function testReplyToMessage()
+	{
+		$this->init();
+		$this->logout();
+
+		$this->open("/projects/projecta/");
+		$this->click("link=Forums");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=open-discussion");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=Welcome to Open-Discussion");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=[ reply ]");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Cookies must be enabled past this point."));
+//		$this->assertEquals("ACOS Forge - Login", $this->getTitle());
+		$this->type("form_loginname", "admin");
+		$this->type("form_pw", 'myadmin');
+		$this->click("login");
+		$this->waitForPageToLoad("30000");
+		$this->type("body", "Here is my 19823 reply");
+		$this->click("submit");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Message Posted Successfully"));
+		$this->click("link=Welcome to Open-Discussion");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Here is my 19823 reply"));
+
+	}
+	
+	/*
+	 * Verify that it is imposible to use name already used by a mailing list
+	 */
+	function testEmailAddressNotAlreadyUsed() {
+		$this->init();
+		$this->click("link=Mailing Lists");
+		$this->waitForPageToLoad("30000");
+		$this->click("//td[@id='main']/p[1]/strong/a");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=Add Mailing List");
+		$this->waitForPageToLoad("30000");
+		$this->type("list_name", "toto");
+		$this->type("description", "Toto mailing list");
+		$this->click("submit");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("List Added"));
+		$this->click("link=Forums");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=open-discussion");
+		$this->waitForPageToLoad("30000");
+		$this->click("//td[@id='main']/p[1]/strong/a[2]");
+		$this->waitForPageToLoad("30000");
+		$this->click("link=Add forum");
+		$this->waitForPageToLoad("30000");
+		$this->type("forum_name", "toto");
+		$this->type("description", "Toto forum");
+		$this->click("submit");
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("Error: a mailing list with the same email address already exists"));
+	}
 }
 ?>

Modified: trunk/tests/func/Testing/SeleniumGforge.php
===================================================================
--- trunk/tests/func/Testing/SeleniumGforge.php	2010-01-24 20:39:13 UTC (rev 8681)
+++ trunk/tests/func/Testing/SeleniumGforge.php	2010-01-24 20:39:23 UTC (rev 8682)
@@ -68,6 +68,14 @@
 //		$this->test->assertFalse($this->isTextPresent("Warning: Missing argument"));
 //	}
 
+    protected function init() {
+		$this->createProject('ProjectA');
+
+		$this->open( BASE );
+		$this->click("link=ProjectA");
+		$this->waitForPageToLoad("30000");
+    }
+
     protected function login($username)
 	{
 		if ($username == 'admin') {




More information about the Fusionforge-commits mailing list