[Fusionforge-commits] FusionForge branch master updated. 0deea5d56489197fb26e5885c8ec17ac55b8240c

Franck Villaume nerville at fusionforge.org
Sun Nov 9 18:43:11 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, master has been updated
       via  0deea5d56489197fb26e5885c8ec17ac55b8240c (commit)
       via  0f4f9d3f941d57a9c87f1d3e1ab0cdded206ee23 (commit)
       via  df1babc2fc511d26bf8252ef7f8fbb47ca2be9ca (commit)
       via  bdba70c57748a7d8a39372665f5504ea60dcb3b6 (commit)
       via  3f651f6d16858fb8512663ddeb683cad8f351ac1 (commit)
       via  dfb5310bd59d7f7bacdbd67a7205a19b4f098809 (commit)
      from  9158a60af6ca3c3a182542e3896973d0cd72b8e9 (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 0deea5d56489197fb26e5885c8ec17ac55b8240c
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 18:42:52 2014 +0100

    use proper var name

diff --git a/src/common/widget/Widget_ProjectLatestFileReleases.class.php b/src/common/widget/Widget_ProjectLatestFileReleases.class.php
index 5036e20..473dbb9 100644
--- a/src/common/widget/Widget_ProjectLatestFileReleases.class.php
+++ b/src/common/widget/Widget_ProjectLatestFileReleases.class.php
@@ -49,9 +49,9 @@ class Widget_ProjectLatestFileReleases extends Widget {
 		$project = $pm->getProject($group_id);
 		global $HTML;
 
-		$frspf = new FRSReleaseFactory($project);
-		$frspnrs = $frspf->getFRSRNewReleases();
-		if (count($frspnrs) < 1) {
+		$frsrf = new FRSReleaseFactory($project);
+		$frsrnrs = $frsrf->getFRSRNewReleases();
+		if (count($frsrnrs) < 1) {
 			echo $HTML->warning_msg(_('This project has not released any files.'));
 		} else {
 			use_javascript('/frs/scripts/FRSController.js');
@@ -74,10 +74,10 @@ class Widget_ProjectLatestFileReleases extends Widget {
 			use_javascript('/js/sortable.js');
 			echo $HTML->getJavascripts();
 			echo $HTML->listTableTop($titleArr, false, 'sortable_widget_frs_listpackage full', 'sortable');
-			foreach ($frspnrs as $key => $frspnr) {
-				$rel_date = $frspnr->getReleaseDate();
-				$package_name = $frspnr->FRSPackage->getName();
-				$package_release = $frspnr->getName();
+			foreach ($frsrnrs as $key => $frsrnr) {
+				$rel_date = $frsrnr->getReleaseDate();
+				$package_name = $frsrnr->FRSPackage->getName();
+				$package_release = $frsrnr->getName();
 				$cells = array();
 				$cells[] = array(html_e('strong', array(), $package_name), 'class' => 'align-left');
 				$cells[][] = $package_release;
@@ -86,13 +86,13 @@ class Widget_ProjectLatestFileReleases extends Widget {
 				// -> notes
 				// accessibility: image is a link, so alt must be unique in page => construct a unique alt
 				$tmp_alt = $package_name . " - " . _('Release Notes');
-				$link = '/frs/?group_id=' . $group_id . '&view=shownotes&release_id='.$frspnr->getID();
+				$link = '/frs/?group_id=' . $group_id . '&view=shownotes&release_id='.$frsrnr->getID();
 				$link_content = $HTML->getReleaseNotesPic($tmp_alt, $tmp_alt);
 				$cells[] = array(util_make_link($link, $link_content), 'class' => 'align-center');
 				// -> monitor
 				if (session_loggedin()) {
-					$url = '/frs/?group_id='.$group_id.'&package_id='.$frspnr->FRSPackage->getID().'&action=monitor';
-					if($frspnr->FRSPackage->isMonitoring()) {
+					$url = '/frs/?group_id='.$group_id.'&package_id='.$frsrnr->FRSPackage->getID().'&action=monitor';
+					if($frsrnr->FRSPackage->isMonitoring()) {
 						$title = $package_name . " - " . _('Stop monitoring this package');
 						$url .= '&status=0';
 						$image = $HTML->getStopMonitoringPic($title);
@@ -101,13 +101,13 @@ class Widget_ProjectLatestFileReleases extends Widget {
 						$url .= '&status=1';
 						$image = $HTML->getStartMonitoringPic($title);
 					}
-					$cells[] = array(util_make_link('#', $image, array('id' => 'pkgid'.$frspnr->FRSPackage->getID(), 'onclick' => 'javascript:controllerFRS.doAction({action:\''.$url.'\', id:\'pkgid'.$frspnr->FRSPackage->getID().'\'})'), true), 'class' => 'align-center');
+					$cells[] = array(util_make_link('#', $image, array('id' => 'pkgid'.$frsrnr->FRSPackage->getID(), 'onclick' => 'javascript:controllerFRS.doAction({action:\''.$url.'\', id:\'pkgid'.$frsrnr->FRSPackage->getID().'\'})'), true), 'class' => 'align-center');
 				}
 				// -> download
 				$tmp_alt = $package_name." ".$package_release." - ". _('Download');
 				$link_content = $HTML->getDownloadPic($tmp_alt, $tmp_alt);
 				$t_link_anchor = $HTML->toSlug($package_name)."-".$HTML->toSlug($package_release)."-title-content";
-				$link = '/frs/?group_id=' . $group_id . '&release_id='.$frspnr->getID()."#".$t_link_anchor;
+				$link = '/frs/?group_id=' . $group_id . '&release_id='.$frsrnr->getID()."#".$t_link_anchor;
 				$cells[] = array(util_make_link ($link, $link_content), 'class' => 'align-center');
 				echo $HTML->multiTableRow(array(), $cells);
 			}

commit 0f4f9d3f941d57a9c87f1d3e1ab0cdded206ee23
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 18:42:39 2014 +0100

    fix php warning

diff --git a/src/common/frs/FRSReleaseFactory.class.php b/src/common/frs/FRSReleaseFactory.class.php
index dd1dd95..14586d8 100644
--- a/src/common/frs/FRSReleaseFactory.class.php
+++ b/src/common/frs/FRSReleaseFactory.class.php
@@ -122,9 +122,12 @@ class FRSReleaseFactory extends Error {
 
 		foreach ($ids as $id) {
 			if (forge_check_perm('frs', $id, 'read')) {
+				$frspnr = false;
 				$frsp = frspackage_get_object($id);
 				$frspnr_id = $frsp->getNewestReleaseID();
-				$frspnr = frsrelease_get_object($frspnr_id);
+				if ($frspnr_id) {
+					$frspnr = frsrelease_get_object($frspnr_id);
+				}
 			}
 			if (isset($frspnr) && $frspnr) {
 				$this->FRSNRs[] = $frspnr;

commit df1babc2fc511d26bf8252ef7f8fbb47ca2be9ca
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 17:55:38 2014 +0100

    wrong comment

diff --git a/src/common/frs/FRSReleaseFactory.class.php b/src/common/frs/FRSReleaseFactory.class.php
index 3f16949..dd1dd95 100644
--- a/src/common/frs/FRSReleaseFactory.class.php
+++ b/src/common/frs/FRSReleaseFactory.class.php
@@ -106,7 +106,7 @@ class FRSReleaseFactory extends Error {
 	}
 
 	/**
-	 * getFRSRs - get an array of FRS Newest Release objects for this Group.
+	 * getFRSRNewReleases - get an array of FRS Newest Release objects for this Group.
 	 *
 	 * @param	bool	$status	limite the search to active packages. Default is false.
 	 * @return	array	The array of FRS objects.

commit bdba70c57748a7d8a39372665f5504ea60dcb3b6
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 17:30:07 2014 +0100

    php syntax

diff --git a/src/common/frs/FRSRelease.class.php b/src/common/frs/FRSRelease.class.php
index 4bd1fee..349abb8 100644
--- a/src/common/frs/FRSRelease.class.php
+++ b/src/common/frs/FRSRelease.class.php
@@ -374,7 +374,7 @@ class FRSRelease extends Error {
 		$f =& $this->getFiles();
 		for ($i = 0; $i < count($f); $i++) {
 			if (!is_object($f[$i]) || $f[$i]->isError() || !$f[$i]->delete()) {
-				$this->setError(_('File Error')._(': ').$f[$i]->getName().._(': ').$f[$i]->getErrorMessage());
+				$this->setError(_('File Error')._(': ').$f[$i]->getName()._(': ').$f[$i]->getErrorMessage());
 				return false;
 			}
 		}

commit 3f651f6d16858fb8512663ddeb683cad8f351ac1
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 17:29:38 2014 +0100

    space

diff --git a/src/common/frs/FRSRelease.class.php b/src/common/frs/FRSRelease.class.php
index 1b8fc00..4bd1fee 100644
--- a/src/common/frs/FRSRelease.class.php
+++ b/src/common/frs/FRSRelease.class.php
@@ -42,13 +42,13 @@ function &frsrelease_get_object($release_id, $data = array()) {
 			$res = db_query_params('SELECT * FROM frs_release WHERE release_id=$1',
 						array ($release_id));
 			if (db_numrows($res)<1 ) {
-				$FRSRELEASE_OBJ['_'.$release_id.'_']=false;
+				$FRSRELEASE_OBJ['_'.$release_id.'_'] = false;
 				return false;
 			}
 			$data = db_fetch_array($res);
 		}
 		$FRSPackage = frspackage_get_object($data['package_id']);
-		$FRSRELEASE_OBJ['_'.$release_id.'_']= new FRSRelease($FRSPackage,$data['release_id'],$data);
+		$FRSRELEASE_OBJ['_'.$release_id.'_'] = new FRSRelease($FRSPackage, $data['release_id'], $data);
 	}
 	return $FRSRELEASE_OBJ['_'.$release_id.'_'];
 }
@@ -138,16 +138,16 @@ class FRSRelease extends Error {
 		if (!$release_date) {
 			$release_date=time();
 		}
-		$res = db_query_params ('SELECT * FROM frs_release WHERE package_id=$1 AND name=$2',
+		$res = db_query_params('SELECT * FROM frs_release WHERE package_id=$1 AND name=$2',
 					array ($this->FRSPackage->getID(),
-						   htmlspecialchars($name))) ;
+						   htmlspecialchars($name)));
 		if (db_numrows($res)) {
 			$this->setError(_('Error Adding Release: Name Already Exists'));
 			return false;
 		}
 
 		db_begin();
-		$result=db_query_params('INSERT INTO frs_release(package_id,notes,changes,preformatted,name,release_date,released_by,status_id) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
+		$result = db_query_params('INSERT INTO frs_release(package_id,notes,changes,preformatted,name,release_date,released_by,status_id) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
 					array($this->FRSPackage->getId(),
 						htmlspecialchars($notes),
 						htmlspecialchars($changes),
@@ -183,7 +183,7 @@ class FRSRelease extends Error {
 	 */
 	function fetchData($release_id) {
 		$res = db_query_params('SELECT * FROM frs_release WHERE release_id=$1 AND package_id=$2',
-					array($release_id, $this->FRSPackage->getID())) ;
+					array($release_id, $this->FRSPackage->getID()));
 		if (!$res || db_numrows($res) < 1) {
 			$this->setError(_('Invalid release_id'));
 			return false;
@@ -284,7 +284,7 @@ class FRSRelease extends Error {
 
 		$date = date('Y-m-d H:i',time());
 
-		$subject = sprintf (_('[%1$s Release] %2$s'),
+		$subject = sprintf(_('[%1$s Release] %2$s'),
 					$this->FRSPackage->Group->getUnixName(),
 					$this->FRSPackage->getName());
 		$text = sprintf(_('Project %1$s (%2$s) has released a new version of package “%3$s”.'),
@@ -311,7 +311,7 @@ class FRSRelease extends Error {
 							. util_make_url('/frs/monitor.php?filemodule_id='.$this->FRSPackage->getID()."&group_id=".$this->FRSPackage->Group->getID()."&stop=1");
 //		$text = util_line_wrap($text);
 		if (count($arr)) {
-			util_handle_message(array_unique($arr),$subject,$text);
+			util_handle_message(array_unique($arr), $subject, $text);
 		}
 	}
 
@@ -374,7 +374,7 @@ class FRSRelease extends Error {
 		$f =& $this->getFiles();
 		for ($i = 0; $i < count($f); $i++) {
 			if (!is_object($f[$i]) || $f[$i]->isError() || !$f[$i]->delete()) {
-				$this->setError(_('File Error')._(': ').$f[$i]->getName().':'.$f[$i]->getErrorMessage());
+				$this->setError(_('File Error')._(': ').$f[$i]->getName().._(': ').$f[$i]->getErrorMessage());
 				return false;
 			}
 		}

commit dfb5310bd59d7f7bacdbd67a7205a19b4f098809
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 9 17:25:39 2014 +0100

    widget project latest commits: fix perm check

diff --git a/src/common/widget/Widget_ProjectLatestCommits.class.php b/src/common/widget/Widget_ProjectLatestCommits.class.php
index 242ad8a..bde64f6 100644
--- a/src/common/widget/Widget_ProjectLatestCommits.class.php
+++ b/src/common/widget/Widget_ProjectLatestCommits.class.php
@@ -66,11 +66,11 @@ class Widget_ProjectLatestCommits extends Widget {
 		$pm = ProjectManager::instance();
 		$project = $pm->getProject($request->get('group_id'));
 		$revisions = array();
-		if ($project->usesPlugin('scmsvn') && forge_check_perm('scmsvn', $project->getID(), 'read')) {
+		if ($project->usesPlugin('scmsvn') && forge_check_perm('scm', $project->getID(), 'read')) {
 			$scmPlugin = plugin_get_object('scmsvn');
 			$revisions = $scmPlugin->getCommits($project, null, self::NB_COMMITS_TO_DISPLAY);
 		}
-		if ($project->usesPlugin('scmgit') && forge_check_perm('scmgit', $project->getID(), 'read')) {
+		if ($project->usesPlugin('scmgit') && forge_check_perm('scm', $project->getID(), 'read')) {
 			$scmPlugin = plugin_get_object('scmgit');
 			$revisions = $scmPlugin->getCommits($project, null, self::NB_COMMITS_TO_DISPLAY);
 		}

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

Summary of changes:
 src/common/frs/FRSRelease.class.php                |   18 +++++++--------
 src/common/frs/FRSReleaseFactory.class.php         |    7 ++++--
 .../widget/Widget_ProjectLatestCommits.class.php   |    4 ++--
 .../Widget_ProjectLatestFileReleases.class.php     |   24 ++++++++++----------
 4 files changed, 28 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list