[Fusionforge-commits] r10527 - in trunk/src/www: docman frs/admin include

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Thu Sep 16 22:00:10 CEST 2010


Author: nerville
Date: 2010-09-16 22:00:08 +0200 (Thu, 16 Sep 2010)
New Revision: 10527

Modified:
   trunk/src/www/docman/index.php
   trunk/src/www/frs/admin/qrs.php
   trunk/src/www/include/exit.php
Log:
fix exit functions call

Modified: trunk/src/www/docman/index.php
===================================================================
--- trunk/src/www/docman/index.php	2010-09-16 19:56:32 UTC (rev 10526)
+++ trunk/src/www/docman/index.php	2010-09-16 20:00:08 UTC (rev 10527)
@@ -44,18 +44,20 @@
 $warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
 
 /* validate group */
-if (!$group_id) {
+if (!$group_id)
 	exit_no_group();
-}
+
 $g =& group_get_object($group_id);
-if (!$g || !is_object($g) || $g->isError()) {
+if (!$g || !is_object($g))
 	exit_no_group();
-}
 
 /* is this group using docman ? */
 if (!$g->usesDocman())
 	exit_disabled('home');
 
+if ($g->isError())
+	exit_error(_('Error'),$g->getErrorMessage(),'docman');
+
 $dirid = getIntFromRequest('dirid');
 if (empty($dirid))
 	$dirid = 0;

Modified: trunk/src/www/frs/admin/qrs.php
===================================================================
--- trunk/src/www/frs/admin/qrs.php	2010-09-16 19:56:32 UTC (rev 10526)
+++ trunk/src/www/frs/admin/qrs.php	2010-09-16 20:00:08 UTC (rev 10527)
@@ -2,7 +2,7 @@
 /**
  * FusionForge File Release Facility
  *
- * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 1999-2001 (c) VA Linux Systems , Darrell Brogdon
  * Copyright 2002 (c) GForge, LLC
  * Copyright 2010 (c), FusionForge Team
  * http://fusionforge.org/
@@ -34,15 +34,15 @@
 $group_id = getIntFromRequest('group_id');
 $package_id = getIntFromRequest('package_id');
 
-if (!$group_id) {
+if (!$group_id)
 	exit_no_group();
-}
 
 $g =& group_get_object($group_id);
+
 if (!$g || !is_object($g)) {
     exit_no_group();
 } elseif ($g->isError()) {
-	exit_error('Error',$g->getErrorMessage());
+	exit_error('Error',$g->getErrorMessage(),'frs');
 }
 
 // check the permissions and see if this user is a release manager.
@@ -53,12 +53,6 @@
 
 $upload_dir = forge_get_config('ftp_upload_dir') . "/" . $g->getUnixName();
 
-/*
-	Quick file release system , Darrell Brogdon, SourceForge, Aug, 2000
-
-	With much code horked from editreleases.php
-*/
-
 if (getStringFromRequest('submit')) {
 	$release_name = trim(getStringFromRequest('release_name'));
 	$userfile = getUploadedFile('userfile');
@@ -91,31 +85,31 @@
 		//
 		$frsp = new FRSPackage($g,$package_id);
 		if (!$frsp || !is_object($frsp)) {
-			exit_error('Error','Could Not Get FRSPackage');
+			exit_error(_('Error'),_('Could Not Get FRSPackage'),'frs');
 		} elseif ($frsp->isError()) {
-			exit_error('Error',$frsp->getErrorMessage());
+			exit_error(_('Error'),$frsp->getErrorMessage(),'frs');
 		} else {
 			//
 			//	Create a new FRSRelease in the db
 			//
 			$frsr = new FRSRelease($frsp);
 			if (!$frsr || !is_object($frsr)) {
-				exit_error('Error','Could Not Get FRSRelease');
+				exit_error(_('Error'),_('Could Not Get FRSRelease'),'frs');
 			} elseif ($frsr->isError()) {
-				exit_error('Error',$frsr->getErrorMessage());
+				exit_error(_('Error'),$frsr->getErrorMessage(),'frs');
 			} else {
 				db_begin();
 				if (!$frsr->create($release_name,$release_notes,$release_changes,
 						   $preformatted,$release_date)) {
 					db_rollback();
-					exit_error('Error',$frsr->getErrorMessage());
+					exit_error(_('Error'),$frsr->getErrorMessage(),'frs');
 				}
 
 				$ret = frs_add_file_from_form ($frsr, $type_id, $processor_id, $release_date,
 							       $userfile, $ftp_filename, $manual_filename) ;
 				if ($ret != true) {
 					db_rollback() ;
-					exit_error ($ret) ;
+					exit_error (_('Error'),$ret,'frs') ;
 				}
 				$frsr->sendNotice();
 				

Modified: trunk/src/www/include/exit.php
===================================================================
--- trunk/src/www/include/exit.php	2010-09-16 19:56:32 UTC (rev 10526)
+++ trunk/src/www/include/exit.php	2010-09-16 20:00:08 UTC (rev 10527)
@@ -67,7 +67,7 @@
  * exit_no_group() - Exit with no group chosen error
  */
 function exit_no_group() {
-	exit_error(_('Error - No project was chosen, project does not exist or you can\'t access it.'));
+	exit_error(_('Error'), _('No project was chosen, project does not exist or you can\'t access it.'));
 }
 
 /**
@@ -103,9 +103,10 @@
 
 /**
  * exit_form_double_submit() - Exit with double submit error.
+ * @param   string  toptab needed for navigation
  */
-function exit_form_double_submit() {
-	exit_error(_('Error - You Attempted To Double-submit this item. Please avoid double-clicking.'));
+function exit_form_double_submit($toptab='') {
+	exit_error(_('Error'),_('You Attempted To Double-submit this item. Please avoid double-clicking.'),$toptab);
 }
 
 // Local Variables:




More information about the Fusionforge-commits mailing list