[Fusionforge-commits] r10633 - in trunk/src: common/include common/reporting www/admin www/pm/admin www/project www/project/admin www/project/report www/project/stats www/reporting

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Wed Sep 22 16:59:22 CEST 2010


Author: nerville
Date: 2010-09-22 16:59:21 +0200 (Wed, 22 Sep 2010)
New Revision: 10633

Modified:
   trunk/src/common/include/exit.php
   trunk/src/common/reporting/report_utils.php
   trunk/src/www/admin/index.php
   trunk/src/www/admin/pluginman.php
   trunk/src/www/pm/admin/index.php
   trunk/src/www/project/admin/database.php
   trunk/src/www/project/admin/editgroupinfo.php
   trunk/src/www/project/admin/editimages.php
   trunk/src/www/project/admin/group_trove.php
   trunk/src/www/project/admin/history.php
   trunk/src/www/project/admin/index.php
   trunk/src/www/project/admin/project_admin_utils.php
   trunk/src/www/project/admin/roledelete.php
   trunk/src/www/project/admin/roleedit.php
   trunk/src/www/project/admin/tools.php
   trunk/src/www/project/admin/users.php
   trunk/src/www/project/memberlist.php
   trunk/src/www/project/report/index.php
   trunk/src/www/project/request.php
   trunk/src/www/project/showfiles.php
   trunk/src/www/project/stats/index.php
   trunk/src/www/project/stats/project_stats_utils.php
   trunk/src/www/reporting/index.php
   trunk/src/www/reporting/timeadd.php
Log:
exit functions migration

Modified: trunk/src/common/include/exit.php
===================================================================
--- trunk/src/common/include/exit.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/common/include/exit.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -98,7 +98,7 @@
  *
  * @param   string  toptab needed for navigation
  */
-function exit_disabled($toptab='') {
+function exit_disabled($toptab='summary') {
 	exit_error(_('The Site Administrator has turned off this feature.'),$toptab);
 }
 

Modified: trunk/src/common/reporting/report_utils.php
===================================================================
--- trunk/src/common/reporting/report_utils.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/common/reporting/report_utils.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -26,6 +26,12 @@
 function report_header($title) {
 	global $HTML ;
 	echo $HTML->header(array('title'=>" "._('Reporting').": " . $title));
+	if (isset($GLOBALS['error_msg'])) {
+		echo html_error_top($GLOBALS['error_msg']);
+	}
+	if (isset($GLOBALS['warning_msg'])) {
+		echo html_warning_top($GLOBALS['warning_msg']);
+	}
 	if (isset($GLOBALS['feedback'])) {
 		echo html_feedback_top($GLOBALS['feedback']);
 	}

Modified: trunk/src/www/admin/index.php
===================================================================
--- trunk/src/www/admin/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/admin/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -33,6 +33,8 @@
 require_once $gfwww.'include/role_utils.php';
 
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
+$error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
+$warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
 
 site_admin_header(array('title'=>_('Site Admin')));
 echo '<h1>' . _('Site Admin') . '</h1>';

Modified: trunk/src/www/admin/pluginman.php
===================================================================
--- trunk/src/www/admin/pluginman.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/admin/pluginman.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -6,7 +6,6 @@
  * Copyright 2010 FusionForge Team
  * http://fusionforge.org/
  *
- *
  * This file is part of FusionForge.
  *
  * FusionForge is free software; you can redistribute it and/or modify
@@ -31,9 +30,6 @@
 // Skip non compatible plugins.
 $plugins_disabled = array('webcalendar', 'scmccase');
 
-site_admin_header(array('title'=>_('Plugin Manager')));
-echo '<h1>' . _('Plugin Manager') . '</h1>';
-
 ?>
 
 <script type="text/javascript">
@@ -176,9 +172,8 @@
 	}
 }
 
-if (!empty($feedback)) echo '<div class="feedback">' . $feedback . '</div>';
-if (!empty($warning_msg)) echo '<div class="warning">' . $warning_msg . '</div>';
-if (!empty($error_msg)) echo '<div class="error">' . $error_msg . '</div>';
+site_admin_header(array('title'=>_('Plugin Manager')));
+echo '<h1>' . _('Plugin Manager') . '</h1>';
 echo _('Here you can activate / deactivate site-wide plugins which are in the plugins/ folder. Then, you should activate them also per project, per user or whatever the plugin specifically applies to.<br /><span class="important">Be careful because some groups/users can be using the plugin. Deactivating it will remove the plugin from all users/groups.<br />Be <strong>extra</strong> careful not to run the init-script again when the plugin is reactivated, because some scripts have DROP TABLE statements.</span><br /><br />');
 $title_arr = array( _('Plugin Name'),
 		    _('Status'),

Modified: trunk/src/www/pm/admin/index.php
===================================================================
--- trunk/src/www/pm/admin/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/pm/admin/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -288,11 +288,11 @@
 	<input type="radio" name="is_public" value="1" checked="checked" /><?php echo _('Yes') ?><br />
 	<input type="radio" name="is_public" value="0" /><?php echo _('No') ?><p />
 	<p />
-	<h3><?php echo _('New Subproject Name')?></h3>
+	<h3><?php echo _('New Subproject Name').utils_requiredField() ?></h3>
 	<p />
 	<input type="text" name="project_name" value="" size="15" maxlength="30" />
 	<p />
-	<strong><?php echo _('Description')?></strong><br />
+	<strong><?php echo _('Description').utils_requiredField() ?></strong><br />
 	<input type="text" name="description" value="" size="40" maxlength="80" />
 	<p />
 	<strong><?php echo _('Send All Updates To')?>:</strong><br />
@@ -334,13 +334,13 @@
 		</td>
 	</tr> -->
 	<tr>
-		<td><strong><?php echo _('Subproject Name')?>:</strong><br />
+		<td><strong><?php echo _('Subproject Name').utils_requiredField() ?>:</strong><br />
 			<input type="text" name="project_name" value="<?php echo $pg->getName() ?>" />
 		</td>
 	</tr>
 	<tr>
 		<td>
-			<strong><?php echo _('Description')?>:</strong><br />
+			<strong><?php echo _('Description').utils_requiredField() ?>:</strong><br />
 			<input type="text" name="description" value="<?php echo $pg->getDescription(); ?>" size="40" maxlength="80" /><br />
 		</td>
 	</tr>

Modified: trunk/src/www/project/admin/database.php
===================================================================
--- trunk/src/www/project/admin/database.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/database.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -9,22 +9,22 @@
  *
  * Portions Copyright 1999-2001 (c) VA Linux Systems
  * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -42,9 +42,9 @@
 
 $group =& group_get_object($group_id);
 if (!$group || !is_object($group)) {
-	exit_error(_('Error'), _('Error creating group'));
+	exit_no_group();
 } else if ($group->isError()) {
-	exit_error(_('Error'), $group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 if (getStringFromRequest('createdb')) {
@@ -64,14 +64,13 @@
 			VALUES($1, $2, $2, $3, $4, $5, $6 ,2)", array($group_id, $dbname, $randompw, time(), $newdbtypeid, $LUSER->getID()));
 
 	if (!$res || db_affected_rows($res) < 1) {
-		$feedback .= _('Cannot add database entry').': '.db_error();
+		$error_msg .= _('Cannot add database entry').': '.db_error();
 	} else {
 	
 		$feedback .= _('Database scheduled for creation');
 		group_add_history('Created database '.$dbname.' type '.$row_db['dbsoftware'].' ','',$group_id);
 	
 	}
-
 }
 
 if (getStringFromRequest('updatedbrec')) {
@@ -97,7 +96,7 @@
 				$group_id)); 
 
 		if (!$res || db_affected_rows($res) < 1) {
-			$feedback .= "Update failure - ".db_error()."";
+			$error_msg .= "Update failure - ".db_error()."";
 		} else {
 			$res = db_query_params ('
 				SELECT * 
@@ -110,7 +109,7 @@
 		}
 	} else {
 
-		$feedback .= "Operation failed.  Password and Password Confirm are not the same";
+		$error_msg .= "Operation failed.  Password and Password Confirm are not the same";
 
 	}
 
@@ -131,7 +130,7 @@
 				$group_id));
 
 	if (!$res || db_affected_rows($res) < 1) {
-		$feedback .= 'Cannot delete database: '.db_error();
+		$error_msg .= 'Cannot delete database: '.db_error();
 	} else {
 		$feedback .= "Database scheduled for deletion";
 	}

Modified: trunk/src/www/project/admin/editgroupinfo.php
===================================================================
--- trunk/src/www/project/admin/editgroupinfo.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/editgroupinfo.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -33,11 +33,9 @@
 
 $group =& group_get_object($group_id);
 if (!$group || !is_object($group)) {
-	exit_error(_('Error'),
-		_('Error creating group'));
+    exit_no_group();
 } else if ($group->isError()) {
-	exit_error(_('Error'),
-		$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 // If this was a submission, make updates
@@ -89,7 +87,7 @@
 	//100 $logo_image_id
 
 	if (!$res) {
-		$feedback = $group->getErrorMessage();
+		$error_msg = $group->getErrorMessage();
 	} else {
 		$feedback = _('Group information updated');
 	}

Modified: trunk/src/www/project/admin/editimages.php
===================================================================
--- trunk/src/www/project/admin/editimages.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/editimages.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,24 +2,24 @@
 /**
  * Project Admin: Edit Multimedia Data
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -39,13 +39,13 @@
 session_require_perm ('project_admin', $group_id) ;
 
 function check_file_size($size) {
-	global $feedback;
+	global $error_msg;
 
 	if (($size > 20) && ($size < 256000)) {
 		return true;
 	} else {
 		//too big or small
-		$feedback .= _('ERROR - file must be > 20 bytes and < 256000 bytes in length').' <br />';
+		$error_msg .= _('ERROR - file must be > 20 bytes and < 256000 bytes in length').' <br />';
 		return false;
 	}
 }
@@ -54,9 +54,10 @@
 	global $group_id;
 	global $description;
 	global $feedback;
+	global $error_msg;
 
 	if (!util_check_fileupload($input_file)) {
-		exit_error("Error","Invalid filename");
+		exit_error(_('Invalid filename'),'admin');
 	}
 
 	$filename = $input_file['tmp_name'];
@@ -98,8 +99,7 @@
 
 
 		if (!$res || db_affected_rows($res) < 1) {
-			$feedback .= 'ERROR: DB: Cannot store multimedia file<br />';
-			echo db_error();
+			$error_msg .= _('ERROR: DB: Cannot store multimedia file : ').db_error();
 		} else {
 			$feedback .= _('Multimedia File Uploaded');
 		}
@@ -118,7 +118,7 @@
 
 	if (getStringFromRequest('add')) {
 		if (!$input_file['tmp_name'] || $description == "") {
-			$feedback .= _('Both file name and description are required');
+			$error_msg .= _('Both file name and description are required');
 		} else {
 			//see if they have too many data in the system
 			$res=db_query_params ('SELECT sum(filesize) WHERE group_id=$1',
@@ -126,7 +126,7 @@
 			if (db_result($res,0,'sum') < $QUOTA) {
 				store_file(0, $input_file);
 			} else {
-				$feedback .= ' Sorry - you are over your '.$QUOTA.' quota ';
+				$error_msg .= ' Sorry - you are over your '.$QUOTA.' quota ';
 			}
 		}
 
@@ -137,15 +137,14 @@
 				$group_id));
 
 		if (!$res || db_affected_rows($res) < 1) {
-			$feedback .= 'ERROR: DB: Cannot delete multimedia file<br />';
-			echo db_error();
+			$error_msg .= _('ERROR: DB: Cannot delete multimedia file: ').db_error();
 		} else {
 			$feedback .= _('Multimedia File Deleted');
 		}
 
 	} else if (getStringFromRequest("edit")) {
 		if ($description == "") {
-			$feedback .= _('File description is required').'<b />';
+			$error_msg .= _('File description is required');
 		} else {
 			if (!$input_file['tmp_name']) {
 
@@ -162,10 +161,9 @@
 				$id));
 
 				if (!$res || db_affected_rows($res) < 1) {
-					$feedback .= 'ERROR: DB: Cannot update multimedia file<br />';
-					echo db_error();
+					$error_msg .= _('ERROR: DB: Cannot update multimedia file').db_error();
 				} else {
-					$feedback .= _('Multimedia File Properties Updated').'<br />';
+					$feedback .= _('Multimedia File Properties Updated');
 				}
 
 			} else {
@@ -192,7 +190,6 @@
 
 				}
 			}
-
 		}
 	}
 }

Modified: trunk/src/www/project/admin/group_trove.php
===================================================================
--- trunk/src/www/project/admin/group_trove.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/group_trove.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -4,24 +4,24 @@
  *
  * This page is linked from index.php
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -37,7 +37,7 @@
 
 if (getStringFromRequest('submit') && getStringFromRequest('root1')) {
 	 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-		exit_form_double_submit('home');
+		exit_form_double_submit('summary');
 	 }
 	group_add_history ('Changed Trove', '', $group_id);
 

Modified: trunk/src/www/project/admin/history.php
===================================================================
--- trunk/src/www/project/admin/history.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/history.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,24 +2,24 @@
 /**
  * Project Admin page to show audit trail for group
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 

Modified: trunk/src/www/project/admin/index.php
===================================================================
--- trunk/src/www/project/admin/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -42,14 +42,11 @@
 if (!$group || !is_object($group)) {
     exit_no_group();
 } elseif ($group->isError()) {
-	exit_error($group->getErrorMessage(),'home');
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 $group->clearError();
 
-$adminheadertitle=sprintf(_('Project Admin: %1$s'), $group->getPublicName() );
-project_admin_header(array('title'=>$adminheadertitle, 'group'=>$group->getID()));
-
 // If this was a submission, make updates
 if (getStringFromRequest('submit')) {
 	$form_group_name = getStringFromRequest('form_group_name');
@@ -99,18 +96,15 @@
 	//100 $logo_image_id
 
 	if (!$res) {
-		$submit_error = $group->getErrorMessage();
+		$error_msg = $group->getErrorMessage();
 	} else {
-		$submit_feedback = _('Project information updated');
+		$feedback = _('Project information updated');
 	}
 }
 
-if (isset($submit_error)) {
-	echo '<div class="error">'.$submit_error.'</div>';
-}
-if (isset($submit_feedback)) {
-	echo '<div class="feedback">'.$submit_feedback.'</div>';
-}
+$adminheadertitle=sprintf(_('Project Admin: %1$s'), $group->getPublicName() );
+project_admin_header(array('title'=>$adminheadertitle, 'group'=>$group->getID()));
+
 ?>
 
 <table class="my-layout-table">

Modified: trunk/src/www/project/admin/project_admin_utils.php
===================================================================
--- trunk/src/www/project/admin/project_admin_utils.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/project_admin_utils.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,32 +2,30 @@
 /**
  * Project Admin: Module of common functions
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 
 /*
-
 	Standard header to be used on all /project/admin/* pages
-
 */
 
 function project_admin_header($params) {

Modified: trunk/src/www/project/admin/roledelete.php
===================================================================
--- trunk/src/www/project/admin/roledelete.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/roledelete.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -55,7 +55,7 @@
 			$feedback = _('Successfully Deleted Role');
 		}
 	} else {
-		$error_msg = 'Error: Please check "I\'m Sure" to confirm or return to previous page to cancel.';
+		$error_msg = _('Error: Please check "I\'m Sure" to confirm or return to previous page to cancel.');
 	}
 
 	//plugin webcal
@@ -64,7 +64,7 @@
 	plugin_hook('change_cal_permission_auto',$params);
 	
 	if (!isset($error_msg)) {
-		session_redirect('/project/admin/users.php?group_id='.$group_id.'&feedback='.urlencode($feedback));
+		session_redirect('/project/admin/users.php?group_id='.$group_id.'&error_msg='.urlencode($error_msg));
 	}
 }
 

Modified: trunk/src/www/project/admin/roleedit.php
===================================================================
--- trunk/src/www/project/admin/roleedit.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/roleedit.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -50,14 +50,14 @@
 if ($role_id=='observer') {
 	$role = new RoleObserver($group);
 	if (!$role || !is_object($role)) {
-		exit_error('Error','Could Not Get RoleObserver');
+		exit_error(_('Could Not Get RoleObserver'),'admin');
 	} elseif ($role->isError()) {
-		exit_error('Error',$role->getErrorMessage());
+		exit_error($role->getErrorMessage(),'admin');
 	}
 
 	if (getStringFromRequest('submit')) {
 		if (!$role->update($data)) {
-			$feedback = $role->getErrorMessage();
+			$error_msg = $role->getErrorMessage();
 		} else {
 			$feedback = _('Successfully Updated Role');
 		}
@@ -75,9 +75,9 @@
 		$role = new Role($group,$role_id);
 	}
 	if (!$role || !is_object($role)) {
-		exit_error('Error',_('Could Not Get Role'));
+		exit_error(_('Could Not Get Role'),'admin');
 	} elseif ($role->isError()) {
-		exit_error('Error',$role->getErrorMessage());
+		exit_error($role->getErrorMessage(),'admin');
 	}
 
 	$old_data = $role->getSettingsForProject ($group) ;
@@ -106,18 +106,18 @@
 			$role_name = $role->getName() ;
 		}
 		if (!$role_name) {
-			$feedback .= ' Missing Role Name ';
+			$error_msg .= ' Missing Role Name ';
 		} else {
 			if (!$role_id) {
 				$role_id=$role->create($role_name,$data);
 				if (!$role_id) {
-					$feedback .= $role->getErrorMessage();
+					$error_msg .= $role->getErrorMessage();
 				} else {
 					$feedback = _('Successfully Created New Role');
 				}
 			} else {
 				if (!$role->update($role_name,$data)) {
-					$feedback .= $role->getErrorMessage();
+					$error_msg .= $role->getErrorMessage();
 				} else {
 					$feedback = _('Successfully Updated Role');
 				}

Modified: trunk/src/www/project/admin/tools.php
===================================================================
--- trunk/src/www/project/admin/tools.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/tools.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -32,9 +32,9 @@
 
 $group =& group_get_object($group_id);
 if (!$group || !is_object($group)) {
-	exit_error(_('Error'), _('Error creating group object'));
+	exit_error(_('Error creating group object'),'admin');
 } else if ($group->isError()) {
-	exit_error(_('Error'), $group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 // If this was a submission, make updates
@@ -85,7 +85,7 @@
 	//100 $logo_image_id
 
 	if (!$res) {
-		$feedback = $group->getErrorMessage();
+		$error_msg = $group->getErrorMessage();
 	} else {
 		$feedback = _('Project information updated');
 	}

Modified: trunk/src/www/project/admin/users.php
===================================================================
--- trunk/src/www/project/admin/users.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/admin/users.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -7,24 +7,23 @@
  * members, but only admins may perform most functions.
  *
  * Copyright 2004 GForge, LLC
+ * Copyright 2006 federicot
+ * http://fusionforge.org
  *
- * @version   $Id: index.php 5829 2006-10-19 20:02:18Z federicot $
- * @author Tim Perdue tim at gforge.org
+ * This file is part of FusionForge.
  *
- * This file is part of GForge.
- *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -37,6 +36,8 @@
 
 $group_id = getIntFromRequest('group_id');
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
+$warnig_msg = htmlspecialchars(getStringFromRequest('warnig_msg'));
+$error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
 session_require_perm ('project_admin', $group_id) ;
 
 // get current information
@@ -44,7 +45,7 @@
 if (!$group || !is_object($group)) {
     exit_no_group();
 } elseif ($group->isError()) {
-	exit_error('Error',$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 // Add hook to replace users managements by a plugin.
@@ -63,11 +64,11 @@
 		$form_unix_name = getStringFromRequest('form_unix_name');
 		$user_object = &user_get_object_by_name($form_unix_name);
 		if ($user_object === false) {
-			$feedback .= _("<p>No Matching Users Found</p>");
+			$warning .= _('No Matching Users Found');
 		} else {
 			$role_id = getIntFromRequest('role_id');
 			if (!$role_id) {
-				$feedback .= _("Role not selected");
+				$warning .= _('Role not selected');
 			} else {
 				$user_id = $user_object->getID();
 				if (!$group->addUser($form_unix_name,$role_id)) {
@@ -112,7 +113,7 @@
 			*/
 		$role_id = getIntFromRequest('role_id');
 		if (!$role_id) {
-			$feedback .= _("Role not selected");
+			$warning_msg .= _("Role not selected");
 		} else {
 			$form_userid = getIntFromRequest('form_userid');
 			$form_unix_name = getStringFromRequest('form_unix_name');
@@ -121,7 +122,7 @@
 			} else {
 				$gjr=new GroupJoinRequest($group,$form_userid);
 				if (!$gjr || !is_object($gjr) || $gjr->isError()) {
-					$error_msg = 'Error Getting GroupJoinRequest';
+					$error_msg = _('Error Getting GroupJoinRequest');
 				} else {
 					$gjr->delete(true);
 				}
@@ -135,10 +136,10 @@
 		$form_userid = getIntFromRequest('form_userid');
 		$gjr=new GroupJoinRequest($group,$form_userid);
 		if (!$gjr || !is_object($gjr) || $gjr->isError()) {
-			$feedback .= 'Error Getting GroupJoinRequest';
+			$error_msg .= _('Error Getting GroupJoinRequest');
 		} else {
 			if (!$gjr->reject()) {
-				exit_error('Error',$gjr->getErrorMessage());
+				$error_msg = $gjr->getErrorMessage();
 			} else {
 				$feedback .= 'Rejected';
 			}

Modified: trunk/src/www/project/memberlist.php
===================================================================
--- trunk/src/www/project/memberlist.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/memberlist.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,24 +2,24 @@
 /**
  * Project Members Information
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 

Modified: trunk/src/www/project/report/index.php
===================================================================
--- trunk/src/www/project/report/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/report/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,26 +2,27 @@
 /**
  * Project Members Information
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  */
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 
 require_once('../../env.inc.php');
@@ -115,9 +116,9 @@
 }
 if ($group->isError()) {
         if($group->isPermissionDeniedError()) {
-                exit_permission_denied($group->getErrorMessage());
+                exit_permission_denied($group->getErrorMessage(),'admin');
         } else {
-                exit_error(_('Error'), $group->getErrorMessage());
+                exit_error($group->getErrorMessage(),'admin');
         }
 }
 

Modified: trunk/src/www/project/request.php
===================================================================
--- trunk/src/www/project/request.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/request.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,23 +2,23 @@
 /**
  * Project Membership Request
  *
- * The rest Copyright 2005 (c) GForge, L.L.C.
- * http://gforge.org/
+ * Copyright 2005 (c) GForge, L.L.C.
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -45,7 +45,7 @@
 	$gjr=new GroupJoinRequest($group);
 	$usr=&session_get_user();
 	if (!$gjr->create($usr->getId(),$comments)) {
-		exit_error('Error',$gjr->getErrorMessage());
+		exit_error($gjr->getErrorMessage(),'summary');
 	} else {
 		$feedback = _('Your request has been submitted.');
 	}

Modified: trunk/src/www/project/showfiles.php
===================================================================
--- trunk/src/www/project/showfiles.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/showfiles.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -10,10 +10,10 @@
 
 if ($group_id) {
 	if ($release_id) {
-		header ("Location: ".util_make_uri("/frs/?group_id=$group_id&release_id=$release_id")); 
+		session_redirect('/frs/?group_id='.$group_id.'&release_id='.$release_id); 
 	} else {
-		header ("Location: ".util_make_uri("/frs/?group_id=$group_id")); }
+		session_redirect('/frs/?group_id='.$group_id); }
 } else {
-	header ("Location: ".util_make_uri("/")); 
+    session_redirect('/');
 }
 ?>

Modified: trunk/src/www/project/stats/index.php
===================================================================
--- trunk/src/www/project/stats/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/stats/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -1,8 +1,26 @@
 <?php
 /**
  * Project Statistics Page
+ *
  * Copyright 2003 GForge, LLC
+ * http://fusionforge.org/
  *
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('../../env.inc.php');
@@ -19,12 +37,12 @@
 if (!$group || !is_object($group)) {
     exit_no_group();
 } elseif ($group->isError()) {
-	exit_error('Error',$group->getErrorMessage());
+	exit_error($group->getErrorMessage(),'admin');
 }
 
 $report=new Report();
 if ($report->isError()) {
-    exit_error($report->getErrorMessage());
+    exit_error($report->getErrorMessage(),'admin');
 }
 
 $area = getStringFromRequest('area');

Modified: trunk/src/www/project/stats/project_stats_utils.php
===================================================================
--- trunk/src/www/project/stats/project_stats_utils.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/project/stats/project_stats_utils.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,24 +2,24 @@
 /**
  * Project Statistics Page
  *
- * Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
- * http://gforge.org/
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 

Modified: trunk/src/www/reporting/index.php
===================================================================
--- trunk/src/www/reporting/index.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/reporting/index.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -33,8 +33,10 @@
 session_require_global_perm ('forge_stats', 'read') ;
 
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
+$warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
+$error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
 
-echo report_header('Main Page');
+report_header('Main Page');
 
 ?>
 <h2><?php echo _('Users'); ?></h2>
@@ -75,6 +77,6 @@
 }
 
 plugin_hook ("reporting_reference", array());
-echo report_footer();
+report_footer();
 
 ?>

Modified: trunk/src/www/reporting/timeadd.php
===================================================================
--- trunk/src/www/reporting/timeadd.php	2010-09-22 14:52:31 UTC (rev 10632)
+++ trunk/src/www/reporting/timeadd.php	2010-09-22 14:59:21 UTC (rev 10633)
@@ -2,25 +2,23 @@
 /**
  * Reporting System
  *
- * Copyright 2004 (c) GForge LLC
+ * Copyright 2004 (c) GForge LLC - Tim Perdue
+ * http://fusionforge.org
  *
- * @author Tim Perdue tim at gforge.org
- * @date 2003-03-16
+ * This file is part of FusionForge.
  *
- * This file is part of GForge.
- *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * GForge is distributed in the hope that it will be useful,
+ * FusionForge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with GForge; if not, write to the Free Software
+ * along with FusionForge; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
@@ -35,7 +33,7 @@
 
 $report=new Report();
 if ($report->isError()) {
-	exit_error('Error',$report->getErrorMessage());
+	exit_error($report->getErrorMessage());
 }
 
 $week = getIntFromRequest('week');
@@ -59,12 +57,12 @@
 						     $project_task_id,
 						     $old_time_code));
 			if (!$res || db_affected_rows($res) < 1) {
-				exit_error('Error',db_error());
+				exit_error(db_error());
 			} else {
 				$feedback=_('Successfully Deleted');
 			}
 		} else {
-			echo "INTERNAL ERROR: delete: $project_task_id && $report_date && $old_time_code";
+			$error_msg = _('INTERNAL ERROR: delete: ').$project_task_id.' && '.$report_date.' && '.$old_time_code;
 		}
 
 	} elseif (getStringFromRequest('add')) {
@@ -85,14 +83,13 @@
 						       $time_code,
 						       $hours));
 			if (!$res || db_affected_rows($res) < 1) {
-				exit_error('Error',db_error());
+				exit_error(db_error());
 			} else {
 				$feedback.=_('Successfully Added');
 			}
 		} else {
-			exit_error('Error',_('All Fields Are Required.'));
+			exit_error(_('All Fields Are Required.'));
 		}
-
 	}
 }
 
@@ -140,7 +137,8 @@
 
 	echo $HTML->listTableTop ($title_arr);
 
-	while ($r=&db_fetch_array($res)) {
+    $xi = 0;
+	while ($r=db_fetch_array($res)) {
 		echo '<form action="'.getStringFromServer('PHP_SELF').'?week='.$week.'&amp;project_task_id='.$r['project_task_id'].'" method="post">
 			<input type="hidden" name="submit" value="1" />
 			<input type="hidden" name="report_date" value="'.$r['report_date'] .'" />
@@ -172,7 +170,9 @@
 			</tr></form>';
 
 	}
+    if (!isset($total_hours)) $total_hours = '';
 	echo '<tr '.$HTML->boxGetAltRowStyle($xi++).'><td colspan="2"><strong>'._('Total Hours').':</strong></td><td><strong>'.$total_hours.'</strong></td><td colspan="2"></td></tr>';
+
 	echo $HTML->listTableBottom();
 
 }




More information about the Fusionforge-commits mailing list