[Fusionforge-commits] FusionForge branch master updated. 9c9befd63a0d3e8f7b4dc16d72678410f173fcc0

Franck VILLAUME nerville at fusionforge.org
Sun Aug 25 20:06:40 CEST 2013


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, master has been updated
       via  9c9befd63a0d3e8f7b4dc16d72678410f173fcc0 (commit)
       via  41561963cc8df2c79297aa004ace074f199ad98c (commit)
       via  ac87815561283c45dc92b584b756a9ebae32e5d3 (commit)
      from  bbd5aada1e4d6d31f3c0691938e216583b03ec3b (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 9c9befd63a0d3e8f7b4dc16d72678410f173fcc0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Aug 25 20:05:56 2013 +0200

    account: better display user preferences with plugin interaction

diff --git a/src/common/include/Plugin.class.php b/src/common/include/Plugin.class.php
index 6ef7f90..898de85 100644
--- a/src/common/include/Plugin.class.php
+++ b/src/common/include/Plugin.class.php
@@ -315,8 +315,7 @@ class Plugin extends Error {
 		}
 		if ($display) {
 			$flag = strtolower('use_'.$this->name);
-			echo '<tr>';
-			echo '<td>';
+			echo '<div>';
 			echo ' <input type="checkbox" name="'.$flag.'" value="1" ';
 			// checked or unchecked?
 			if ($user->usesPlugin($this->name)) {
@@ -324,8 +323,7 @@ class Plugin extends Error {
 			}
 			echo ' />    '. sprintf(_('Use %s Plugin'), $this->text);
 			echo html_image($imgStatus, '16', '16',array('alt'=>$title, 'title'=>$title));
-			echo '</td>';
-			echo '</tr>';
+			echo '</div';
 		}
 	}
 
diff --git a/src/www/account/index.php b/src/www/account/index.php
index 478ec31..c8ceced 100644
--- a/src/www/account/index.php
+++ b/src/www/account/index.php
@@ -276,12 +276,11 @@ echo "\n</div>";
 		<?php echo _('Enable tooltips. Small help texts displayed on mouse over links, images.');
 ?>
 </div>
-</td></tr>
-
 <?php
 // displays a "Use xxxx Plugin" checkbox
 plugin_hook("userisactivecheckbox", $hookParams);
 ?>
+</td></tr>
 <tr><td colspan="2">
 
 <?php

commit 41561963cc8df2c79297aa004ace074f199ad98c
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Aug 25 20:04:39 2013 +0200

    news: partial patch #462 + cleanup

diff --git a/src/www/news/submit.php b/src/www/news/submit.php
index e167736..bfbc8a4 100644
--- a/src/www/news/submit.php
+++ b/src/www/news/submit.php
@@ -5,6 +5,7 @@
  * Copyright (C) 1999-2001 VA Linux Systems
  * Copyright (C) 2002-2004 GForge Team
  * Copyright (C) 2008-2010 Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
  *
  * http://fusionforge.org/
  *
@@ -61,7 +62,7 @@ $group = group_get_object($group_id);
 if (!$group || !is_object($group)) {
 	exit_no_group();
 } elseif ($group->isError()) {
-	exit_error($group->getErrorMessage(),'news');
+	exit_error($group->getErrorMessage(), 'news');
 }
 
 $summary = getStringFromRequest('summary');
@@ -71,11 +72,11 @@ $details = getHtmlTextFromRequest('details');
 if (session_loggedin()) {
 
 	if (!forge_check_perm('project_admin', $group_id)) {
-		exit_permission_denied(_('You cannot submit news for a project unless you are an admin on that project'),'home');
+		exit_permission_denied(_('You cannot submit news for a project unless you are an admin on that project.'), 'home');
 	}
 
 	if ($group_id == forge_get_config('news_group')) {
-		exit_permission_denied(_('Submitting news from the news group is not allowed.'),'home');
+		exit_permission_denied(_('Submitting news from the news group is not allowed.'), 'home');
 	}
 
 	if (getStringFromRequest('post_changes')) {
@@ -92,27 +93,27 @@ if (session_loggedin()) {
 
 			db_begin();
 			$f = new Forum($group, false, false, true);
-			if (!$f->create(preg_replace('/[^_\.0-9a-z-]/','-', strtolower($summary)),$details,'')) {
+			if (!$f->create(preg_replace('/[^_\.0-9a-z-]/', '-', strtolower($summary)), $details, '')) {
 				db_rollback();
-				exit_error($f->getErrorMessage(),'news');
-			}
-			$group->normalizeAllRoles();
-			$new_id=$f->getID();
-			$sql='INSERT INTO news_bytes (group_id,submitted_by,is_approved,post_date,forum_id,summary,details)
- VALUES ($1, $2, $3, $4, $5, $6, $7)';
-			$result=db_query_params($sql,
-				array($group_id, user_getid(), 0, time(), $new_id, htmlspecialchars($summary), $details));
-			if (!$result) {
-				db_rollback();
-				form_release_key(getStringFromRequest('form_key'));
-				$error_msg = _('ERROR doing insert');
+				$error_msg = $f->getErrorMessage();
 			} else {
-				db_commit();
-				$feedback = _('News Added.');
+				$group->normalizeAllRoles();
+				$new_id = $f->getID();
+				$sql = 'INSERT INTO news_bytes (group_id, submitted_by, is_approved, post_date, forum_id, summary,details)
+						VALUES ($1, $2, $3, $4, $5, $6, $7)';
+				$result = db_query_params($sql, array($group_id, user_getid(), 0, time(), $new_id, htmlspecialchars($summary), $details));
+				if (!$result) {
+					db_rollback();
+					form_release_key(getStringFromRequest('form_key'));
+					$error_msg = _('Error: insert failed.');
+				} else {
+					db_commit();
+					$feedback = _('News Added.');
+				}
 			}
 		} else {
 			form_release_key(getStringFromRequest('form_key'));
-			$error_msg = _('ERROR - both subject and body are required');
+			$error_msg = _('Error: both subject and body are required.');
 		}
 	}
 
@@ -147,13 +148,13 @@ if (session_loggedin()) {
 		<p>
 		<strong>'._('Details').':</strong>'.notepad_button('document.forms.newssubmitform.details').utils_requiredField().'</p>';
 
-	$params = array() ;
+	$params = array();
 	$params['name'] = 'details';
 	$params['width'] = "800";
 	$params['height'] = "500";
 	$params['body'] = $details;
 	$params['group'] = $group_id;
-	$params['content'] = '<textarea name="details" rows="5" cols="50">'.$details.'</textarea>';
+	$params['content'] = '<textarea required="required" name="details" rows="5" cols="50">'.$details.'</textarea>';
 	plugin_hook_by_reference("text_editor",$params);
 
 	echo $params['content'].'<br />';

commit ac87815561283c45dc92b584b756a9ebae32e5d3
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Aug 25 20:00:47 2013 +0200

    Forum: cleanup, use tab/space, add dot, when needed

diff --git a/src/common/forum/Forum.class.php b/src/common/forum/Forum.class.php
index cb7fad9..2c7285d 100644
--- a/src/common/forum/Forum.class.php
+++ b/src/common/forum/Forum.class.php
@@ -44,7 +44,7 @@ function &forum_get_object($forum_id) {
 	}
 
 	$data = db_fetch_array($res);
-	$Group = group_get_object($data["group_id"]);
+	$Group = group_get_object($data['group_id']);
 	$f = new Forum($Group, $forum_id);
 
 	$f->fetchData($forum_id);
@@ -91,18 +91,18 @@ class Forum extends Error {
 	 */
 	var $is_news;
 
-    /**
-     * Constructor.
-     *
-     * @param $Group
-     * @param bool $group_forum_id
-     * @param bool $arr
-     * @internal param \The $object Group object to which this forum is associated.
-     * @internal param \The $int group_forum_id.
-     * @internal param \The $array associative array of data.
-     * @return \Forum success.
-     */
-	function __construct(&$Group, $group_forum_id = false, $arr = false) {
+	/**
+	 * Constructor.
+	 *
+	 * @param $Group
+	 * @param bool $group_forum_id
+	 * @param bool $arr
+	 * @internal param \The $object Group object to which this forum is associated.
+	 * @internal param \The $int group_forum_id.
+	 * @internal param \The $array associative array of data.
+	 * @return \Forum success.
+	 */
+	function __construct(&$Group, $group_forum_id = false, $arr = false, $is_news = false) {
 		$this->Error();
 		if (!$Group || !is_object($Group)) {
 			$this->setError(_('No Valid Group Object'));
@@ -112,7 +112,7 @@ class Forum extends Error {
 			$this->setError('Forums: '.$Group->getErrorMessage());
 			return;
 		}
-		$is_news = 0;
+
 		if ($group_forum_id) {
 			//
 			//	Is this a news posting (or a real forum)?
@@ -123,8 +123,7 @@ class Forum extends Error {
 			$is_news = $res && db_numrows($res) >= 1;
 		}
 		if (!$is_news && !$Group->usesForum()) {
-			$this->setError(sprintf(_('%s does not use the Forum tool'),
-			    $Group->getPublicName()));
+			$this->setError(sprintf(_('%s does not use the Forum tool.'), $Group->getPublicName()));
 			return false;
 		}
 		$this->Group =& $Group;
@@ -137,7 +136,7 @@ class Forum extends Error {
 			} else {
 				$this->data_array =& $arr;
 				if ($this->data_array['group_id'] != $this->Group->getID()) {
-					$this->setError(_('Group_id in db result does not match Group Object'));
+					$this->setError(_('Group_id in db result does not match Group Object.'));
 					$this->data_array = null;
 					return;
 				}
@@ -168,20 +167,20 @@ class Forum extends Error {
 	 * @param	int	Pass (1) if a welcome message should be created (0) for no welcome message.
 	 * @return	boolean	success.
 	 */
-	function create($forum_name,$description,$send_all_posts_to='',$create_default_message=1) {
+	function create($forum_name, $description, $send_all_posts_to = '', $create_default_message = 1) {
 		if (!$this->is_news && strlen(trim($forum_name)) < 3) {
-			$this->setError(_('Forum Name Must Be At Least 3 Characters'));
+			$this->setError(_('Forum name must be at least 3 characters.'));
 			return false;
 		}
 		if (!$this->is_news && strlen(trim($description)) < 10) {
-			$this->setError(_('Forum Description Must Be At Least 10 Characters'));
+			$this->setError(_('Forum description must be at least 10 characters.'));
 			return false;
 		}
 		if (!preg_match('/^([_\.0-9a-z-])*$/i',$forum_name)) {			
 			if (preg_match('/ /',$forum_name)){
-				$this->setError(_('Illegal Characters in Forum Name').' - '._('No space'));
+				$this->setError(_('Illegal characters in Forum name').' - '._('No space allowed.'));
 			}else{
-				$this->setError(_('Illegal Characters in Forum Name'));
+				$this->setError(_('Illegal characters in Forum name.'));
 			}
 			return false;
 		}
@@ -201,7 +200,7 @@ class Forum extends Error {
 								$this->Group->getID()));
 
 		if (db_numrows($result_list_samename) > 0){
-			$this->setError(_('Mailing List Exists with same name'));
+			$this->setError(_('Mailing List exists with same name.'));
 			return false;
 		}
 
@@ -264,7 +263,7 @@ class Forum extends Error {
 		$res=db_query_params('SELECT * FROM forum_group_list_vw	WHERE group_forum_id=$1 AND group_id=$2',
 			array($group_forum_id, $this->Group->getID()));
 		if (!$res || db_numrows($res) < 1) {
-			$this->setError(_('Invalid forum group identifier'));
+			$this->setError(_('Invalid forum group identifier.'));
 			return false;
 		}
 		$this->data_array = db_fetch_array($res);
@@ -438,7 +437,7 @@ class Forum extends Error {
 	function setMonitor($u = -1) {
 		if ($u == -1) {
 			if (!session_loggedin()) {
-				$this->setError(_('You can only monitor if you are logged in'));
+				$this->setError(_('You can only monitor if you are logged in.'));
 				return false;
 			}
 			$u = user_getid() ;
@@ -464,16 +463,16 @@ class Forum extends Error {
 		return true;
 	}
 
-    /**
-     * stopMonitor - Remove the current user from the list of people monitoring the forum.
-     *
-     * @param $u
-     * @return    boolean    success.
-     */
+	/**
+	 * stopMonitor - Remove the current user from the list of people monitoring the forum.
+	 *
+	 * @param $u
+	 * @return    boolean    success.
+	 */
 	function stopMonitor($u = -1) {
 		if ($u == -1) {
 			if (!session_loggedin()) {
-				$this->setError(_('You can only monitor if you are logged in'));
+				$this->setError(_('You can only monitor if you are logged in.'));
 				return false;
 			}
 			$u = user_getid();
@@ -506,7 +505,7 @@ class Forum extends Error {
 	 */
 	function savePlace() {
 		if (!session_loggedin()) {
-			$this->setError(_('You Can Only Save Your Place If You Are Logged In'));
+			$this->setError(_('You can only save your place if you are logged in.'));
 			return false;
 		}
 		$result = db_query_params('SELECT * FROM forum_saved_place WHERE user_id=$1 AND forum_id=$2',
@@ -552,18 +551,18 @@ class Forum extends Error {
 	 */
 	function update($forum_name, $description, $send_all_posts_to = '') {
 		if (strlen($forum_name) < 3) {
-			$this->setError(_('Forum Name Must Be At Least 3 Characters'));
+			$this->setError(_('Forum name must be at least 3 characters.'));
 			return false;
 		}
 		if (strlen($description) < 10) {
-			$this->setError(_('Forum Description Must Be At Least 10 Characters'));
+			$this->setError(_('Forum Description Must Be At Least 10 Characters.'));
 			return false;
 		}
 		if (!preg_match('/^([_\.0-9a-z-])*$/i',$forum_name)) {
 			if (preg_match('/ /',$forum_name)){
-				$this->setError(_('Illegal Characters in Forum Name').' - '._('No space'));
-			}else{
-				$this->setError(_('Illegal Characters in Forum Name'));
+				$this->setError(_('Illegal characters in Forum name').' - '._('No space allowed.'));
+			} else {
+				$this->setError(_('Illegal characters in Forum name.'));
 			}
 			return false;
 		}
@@ -588,7 +587,7 @@ class Forum extends Error {
 								$this->Group->getID()));
 
 		if (db_numrows($result_list_samename) > 0){
-			$this->setError(_('Mailing List Exists with same name'));
+			$this->setError(_('Mailing List exists with same name.'));
 			return false;
 		}
 		

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

Summary of changes:
 src/common/forum/Forum.class.php    |   77 +++++++++++++++++------------------
 src/common/include/Plugin.class.php |    6 +--
 src/www/account/index.php           |    3 +-
 src/www/news/submit.php             |   43 +++++++++----------
 4 files changed, 63 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list