[Fusionforge-commits] FusionForge branch master updated. 6.0.4-553-g7134b48

Franck Villaume nerville at libremir.placard.fr.eu.org
Fri Jun 17 19:57:13 CEST 2016


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  7134b48ed80e4a13ee5fc2629c16a001c82af81d (commit)
       via  94c2f6e03efbd7e3d0af7c7925eb3c643224de61 (commit)
      from  ebde70b2c204bde19e1c9263d538d704f860ab51 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7134b48ed80e4a13ee5fc2629c16a001c82af81d

commit 7134b48ed80e4a13ee5fc2629c16a001c82af81d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Jun 17 19:52:03 2016 +0200

    clean-up. remove useless vars, use HTML helpers, simplify code

diff --git a/src/common/docman/DocumentFactory.class.php b/src/common/docman/DocumentFactory.class.php
index 1120900..1892af1 100644
--- a/src/common/docman/DocumentFactory.class.php
+++ b/src/common/docman/DocumentFactory.class.php
@@ -329,8 +329,7 @@ class DocumentFactory extends FFError {
 
 		if (count($return) === 0) {
 			$this->setError(_('No Documents Found'));
-			$return = NULL;
-			return $return;
+			return NULL;
 		}
 
 		return $return;
diff --git a/src/common/docman/DocumentManager.class.php b/src/common/docman/DocumentManager.class.php
index 7d0a502..729e488 100644
--- a/src/common/docman/DocumentManager.class.php
+++ b/src/common/docman/DocumentManager.class.php
@@ -361,7 +361,6 @@ class DocumentManager extends FFError {
 			} else {
 				$df = new DocumentFactory($doc_group->getGroup());
 				$df->setDocGroupID($doc_group->getID());
-				$stateidArr = array(1);
 				if (forge_check_perm('docman', $this->getGroup()->getID(), 'approve')) {
 					$stateIdDg = 5;
 				}
diff --git a/src/common/docman/engine/parser_pdf.inc.php b/src/common/docman/engine/parser_pdf.inc.php
index 9d552ac..025faa4 100644
--- a/src/common/docman/engine/parser_pdf.inc.php
+++ b/src/common/docman/engine/parser_pdf.inc.php
@@ -36,7 +36,7 @@ function parser_pdf($fichin) {
 
 	$fichout = tempnam(forge_get_config('data_path'),'tmp');
 	$cmd = '/usr/bin/pdftotext '.$fichin.' '.$fichout;
-	$res = shell_exec($cmd);
+	shell_exec($cmd);
 
 	return parser_text($fichout);
 	unlink ($fichout);
diff --git a/src/common/forum/AttachManager.class.php b/src/common/forum/AttachManager.class.php
index 57dd169..9a0f498 100644
--- a/src/common/forum/AttachManager.class.php
+++ b/src/common/forum/AttachManager.class.php
@@ -238,8 +238,6 @@ class AttachManager extends FFError {
 	 *
 	 */
 	function attach($attach, $group_id, $update = 0, $msg_id = 0) {
-		global $_FILES;
-
 		$attachment = trim($attach['tmp_name']);
 		$attachment_name = trim($attach['name']);
 		$attachment_size = trim($attach['size']);
diff --git a/src/common/forum/ForumAdmin.class.php b/src/common/forum/ForumAdmin.class.php
index f3f945d..a7d9808 100644
--- a/src/common/forum/ForumAdmin.class.php
+++ b/src/common/forum/ForumAdmin.class.php
@@ -74,7 +74,7 @@ class ForumAdmin extends FFError {
 	 *
 	 */
 	function PrintAdminOptions() {
-		global $group_id, $forum_id;
+		global $group_id;
 		echo html_e('p', array(), util_make_link('/forum/admin/?group_id='.$group_id.'&add_forum=1', _('Add Forum')).
 			' | '.util_make_link('/forum/admin/pending.php?action=view_pending&group_id='.$group_id, _('Manage Pending Messages')).'<br />');
 	}
@@ -359,7 +359,6 @@ class ForumAdmin extends FFError {
 				$this->PrintAdminOptions();
 			}*/
 
-			$results = array(); //messages
 			for($i=0;$i<count($msgids);$i++) {
 				switch ($doaction[$i]) {
 					case 1 : {
@@ -421,7 +420,6 @@ class ForumAdmin extends FFError {
 						$is_followup_to = db_result($res1,0,"is_followup_to");
 						$posted_by = db_result($res1,0,"posted_by");
 						$has_followups = db_result($res1,0,"has_followups");
-						$most_recent_date = db_result($res1,0,"most_recent_date");
 						if ($fm->insertreleasedmsg($group_forum_id,$subject, $body,$post_date, $thread_id, $is_followup_to,$posted_by,$has_followups,time())) {
 							$feedback .= "($subject) " . _('Pending message released') . "<br />";
 							if (db_numrows($res2)>0) {
@@ -495,7 +493,6 @@ class ForumAdmin extends FFError {
 				}
 			}
 			html_feedback_top($feedback);
-			$page = 0;
 			$this->ExecuteAction("view_pending");
 		}
 	}
diff --git a/src/common/forum/ForumFactory.class.php b/src/common/forum/ForumFactory.class.php
index 7d72abe..b9eaba6 100644
--- a/src/common/forum/ForumFactory.class.php
+++ b/src/common/forum/ForumFactory.class.php
@@ -152,7 +152,7 @@ class ForumFactory extends FFError {
 
 		$rows = db_numrows($result);
 
-		if (!$result) {
+		if (!$result || ($rows < 1)) {
 			$this->setError(_('Forum not found')._(': ').db_error());
 			$this->forums = false;
 		} else {
diff --git a/src/common/forum/ForumHTML.class.php b/src/common/forum/ForumHTML.class.php
index 9b28f7d..e145013 100644
--- a/src/common/forum/ForumHTML.class.php
+++ b/src/common/forum/ForumHTML.class.php
@@ -249,8 +249,7 @@ class ForumHTML extends FFError {
 		$msgforum =& $msg->getForum();
 		$fa = new ForumAdmin($msgforum->Group->getID());
 		$url = util_make_uri('/forum/message.php?msg_id='. $msg->getID() .'&group_id='.$group_id);
-		$ret_val =
-		'<table class="fullwidth">
+		$ret_val = $HTML->listTableTop().'
 			<tr>
 				<td class="tablecontent top" style="white-space: nowrap;">';
 
@@ -282,8 +281,7 @@ class ForumHTML extends FFError {
 					}
 					$ret_val .= '
 				</td>
-			</tr>
-		</table>';
+			</tr>'.$HTML->listTableBottom();
 		return $ret_val;
 	}
 
@@ -404,7 +402,7 @@ class ForumHTML extends FFError {
 			If there are, it calls itself, incrementing $level
 			$level is used for indentation of the threads.
 		*/
-		global $total_rows,$forum_id,$current_message,$group_id;
+		global $total_rows,$current_message,$group_id, $HTML;
 
 		if (!isset($msg_arr["$msg_id"]))
 			return "";
@@ -420,7 +418,7 @@ class ForumHTML extends FFError {
 				$total_rows++;
 
 				$ret_val .= '
-					<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($total_rows) .'><td style="white-space: nowrap;">';
+					<tr '. $HTML->boxGetAltRowStyle($total_rows) .'><td style="white-space: nowrap;">';
 				/*
 					How far should it indent?
 				*/
diff --git a/src/common/forum/ForumMessage.class.php b/src/common/forum/ForumMessage.class.php
index db2665d..1db8404 100644
--- a/src/common/forum/ForumMessage.class.php
+++ b/src/common/forum/ForumMessage.class.php
@@ -599,7 +599,7 @@ class ForumMessage extends FFError {
 		}
 		ForumStorage::instance()->commit();
 
-		$toss = db_query_params('DELETE FROM forum WHERE msg_id=$1 AND group_forum_id=$2',
+		db_query_params('DELETE FROM forum WHERE msg_id=$1 AND group_forum_id=$2',
 								array ($msg_id, $this->Forum->getID()));
 
 		return $count;
@@ -771,8 +771,6 @@ Or reply to this e-mail entering your response between the following markers:
 		}
 
 		$BCC = implode(util_result_column_to_array($bccres),',').','.$this->Forum->getSendAllPostsTo();
-		$User = user_get_object($this->getPosterID());
-		//util_send_message('',$subject,$body,$User->getEmail(),$BCC,$this->getPosterRealName(),$extra_headers);
 		util_send_message('',$subject,$body,"noreply@".forge_get_config('web_host'),$BCC,'Forum',$extra_headers);
 //		util_handle_message(array_unique($ids),$subject,$body,$this->Forum->getSendAllPostsTo(),'','forumgateway@'.forge_get_config('web_host'));
 		return true;
@@ -877,7 +875,6 @@ Or reply to this e-mail entering your response between the following markers:
 								  db_int_array_to_any_clause ($ids))) ;
 			}
 			$BCC = implode(util_result_column_to_array($bccres),',').','.$this->Forum->getSendAllPostsTo();
-			$User = user_get_object($this->getPosterID());
 			util_send_message('',$subject,$body,"noreply@".forge_get_config('web_host'),$BCC,'Forum',$extra_headers);
 			return true;
 		}
diff --git a/src/common/frs/FRSRelease.class.php b/src/common/frs/FRSRelease.class.php
index b268be8..4720107 100644
--- a/src/common/frs/FRSRelease.class.php
+++ b/src/common/frs/FRSRelease.class.php
@@ -278,8 +278,6 @@ class FRSRelease extends FFError {
 	function sendNotice() {
 		$arr =& $this->FRSPackage->getMonitorIDs();
 
-		$date = date('Y-m-d H:i',time());
-
 		$subject = sprintf(_('[%1$s Release] %2$s'),
 					$this->FRSPackage->Group->getUnixName(),
 					$this->FRSPackage->getName());
diff --git a/src/common/frs/actions/deletefile.php b/src/common/frs/actions/deletefile.php
index 73fb47d..418d4b5 100644
--- a/src/common/frs/actions/deletefile.php
+++ b/src/common/frs/actions/deletefile.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * FusionForge FRS: Add release Action
+ * FusionForge FRS: Delete File Action
  *
  * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org/
@@ -39,9 +39,7 @@ if (!forge_check_perm('frs', $package_id, 'file')) {
 		$frsf = frsfile_get_object($file_id);
 		if (!$frsf || !is_object($frsf)) {
 			$result[$key]['html'] = $HTML->error_msg(_('Error Getting FRSPackage'));
-		} elseif ($frsf->isError()) {
-			$result[$key]['html'] = $HTML->error_msg($frsf->getErrorMessage());
-		} elseif (!$frsf->delete()) {
+		} elseif ($frsf->isError() || !$frsf->delete()) {
 			$result[$key]['html'] = $HTML->error_msg($frsf->getErrorMessage());
 		} else {
 			$result[$key]['html'] = $HTML->feedback(_('File successfully deleted.'));
diff --git a/src/common/search/DocsSearchQuery.class.php b/src/common/search/DocsSearchQuery.class.php
index ff9cfca..bee3eb5 100644
--- a/src/common/search/DocsSearchQuery.class.php
+++ b/src/common/search/DocsSearchQuery.class.php
@@ -66,7 +66,6 @@ class DocsSearchQuery extends SearchQuery {
 	 */
 	function addCommonQPA($qpa) {
 		$options = $this->options;
-		$groupIdArr = $this->groupIdArr;
 		$sections = $this->sections;
 		$params['groupIdArr'] = $this->groupIdArr;
 		$params['options'] = $options;
diff --git a/src/plugins/scmhook/www/committracker/newcommit.php b/src/plugins/scmhook/www/committracker/newcommit.php
index 7542aa7..4dc52b7 100644
--- a/src/plugins/scmhook/www/committracker/newcommit.php
+++ b/src/plugins/scmhook/www/committracker/newcommit.php
@@ -89,7 +89,6 @@ function parseConfig(&$Config)
 		$Config['FileName'] = substr($Config['FileName'],strlen($Repository)); //get only the filename relative to the repo
 	} else {
 		$GroupName = $Repository;
-		$Config['FileName'] = $Config['FileName'];
 	}
 
 	$Result['group']    = group_get_object_by_name($GroupName);
diff --git a/src/plugins/scmhook/www/committracker/newcommitgit.php b/src/plugins/scmhook/www/committracker/newcommitgit.php
index 77604e0..de688e8 100644
--- a/src/plugins/scmhook/www/committracker/newcommitgit.php
+++ b/src/plugins/scmhook/www/committracker/newcommitgit.php
@@ -92,7 +92,6 @@ function parseConfig(&$Config)
 		$Config['FileName'] = substr($Config['FileName'],strlen($Repository)); //get only the filename relative to the repo
 	} else {
 		$GroupName = trim(str_replace($repos_path,'',$repo_root),"/");
-		$Config['FileName'] = $Config['FileName'];
 	}
 
 	$Result['group']    = group_get_object_by_name($GroupName);

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=94c2f6e03efbd7e3d0af7c7925eb3c643224de61

commit 94c2f6e03efbd7e3d0af7c7925eb3c643224de61
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Jun 17 19:18:26 2016 +0200

    coding style

diff --git a/src/www/project/showfiles.php b/src/www/project/showfiles.php
index d1af2c0..7a4e3df 100644
--- a/src/www/project/showfiles.php
+++ b/src/www/project/showfiles.php
@@ -12,7 +12,8 @@ if ($group_id) {
 	if ($release_id) {
 		session_redirect('/frs/?group_id='.$group_id.'&release_id='.$release_id);
 	} else {
-		session_redirect('/frs/?group_id='.$group_id); }
+		session_redirect('/frs/?group_id='.$group_id);
+	}
 } else {
 	session_redirect('/');
 }

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

Summary of changes:
 src/common/docman/DocumentFactory.class.php            |  3 +--
 src/common/docman/DocumentManager.class.php            |  1 -
 src/common/docman/engine/parser_pdf.inc.php            |  2 +-
 src/common/forum/AttachManager.class.php               |  2 --
 src/common/forum/ForumAdmin.class.php                  |  5 +----
 src/common/forum/ForumFactory.class.php                |  2 +-
 src/common/forum/ForumHTML.class.php                   | 10 ++++------
 src/common/forum/ForumMessage.class.php                |  5 +----
 src/common/frs/FRSRelease.class.php                    |  2 --
 src/common/frs/actions/deletefile.php                  |  6 ++----
 src/common/search/DocsSearchQuery.class.php            |  1 -
 src/plugins/scmhook/www/committracker/newcommit.php    |  1 -
 src/plugins/scmhook/www/committracker/newcommitgit.php |  1 -
 src/www/project/showfiles.php                          |  3 ++-
 14 files changed, 13 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list