[Fusionforge-commits] r10553 - in trunk/src/www: admin tracker tracker/admin
Franck VILLAUME
nerville at libremir.placard.fr.eu.org
Mon Sep 20 11:36:11 CEST 2010
Author: nerville
Date: 2010-09-20 11:36:11 +0200 (Mon, 20 Sep 2010)
New Revision: 10553
Modified:
trunk/src/www/admin/admin_table.php
trunk/src/www/admin/edit_frs_filetype.php
trunk/src/www/admin/edit_frs_processor.php
trunk/src/www/admin/edit_licenses.php
trunk/src/www/admin/edit_theme.php
trunk/src/www/tracker/admin/ind.php
trunk/src/www/tracker/admin/index.php
trunk/src/www/tracker/browse.php
Log:
exit function migration
Modified: trunk/src/www/admin/admin_table.php
===================================================================
--- trunk/src/www/admin/admin_table.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/admin/admin_table.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -3,21 +3,22 @@
* Module to render generic HTML tables for Site Admin
*
* Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) Franck Villaume - Capgemini
*
- * 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
*/
@@ -71,11 +72,11 @@
*/
function admin_table_postadd($table, $unit, $primary_key) {
if (!form_key_is_valid(getStringFromRequest('form_key'))) {
- exit_form_double_submit();
+ exit_form_double_submit('home');
}
$field_list = getStringFromRequest('__fields__');
- $fields = split(",", $field_list);
+ $fields = explode(",", $field_list);
$values = array(); $v = array ();
$qpa = db_construct_qpa (false, 'INSERT INTO ' . $table . ' (' . $field_list . ') VALUES (') ;
@@ -86,10 +87,13 @@
$values[] = getStringFromPost($field);
}
- $qpa = db_construct_qpa ($qpa, implode (',', $v), $values) ;
+ $qpa = db_construct_qpa ($qpa, implode (',', $v).')', $values) ;
+ var_dump($qpa);
if (db_query_qpa($qpa)) {
+ print('<div class="feedback">');
printf(_('%1$s successfully added.'), ucfirst(getUnitLabel($unit)));
+ print('</div>');
} else {
form_release_key(getStringFromRequest('form_key'));
echo db_error();
@@ -109,8 +113,8 @@
$result = db_numrows(db_query_params ('SELECT processor_id FROM frs_file WHERE processor_id = $1',
array($id)));
if ($result > 0) {
- echo '<p>'.sprintf(_('You can\'t delete the processor %1$s since it\'s currently referenced in a file release.'), db_result(db_query_params ('select name from frs_processor where processor_id = $1',
- array($id)), 0, 0)).'</p>';
+ echo '<div class="warning">'.sprintf(_('You can\'t delete the processor %1$s since it\'s currently referenced in a file release.'), db_result(db_query_params ('select name from frs_processor where processor_id = $1',
+ array($id)), 0, 0)).'</div>';
return;
}
}
@@ -118,16 +122,16 @@
$result = db_numrows(db_query_params ('SELECT license FROM groups WHERE license = $1',
array($id)));
if ($result > 0) {
- echo '<p>'.sprintf(_('You can\'t delete the license %1$s since it\'s currently referenced in a project.'), db_result(db_query_params ('select license_name from licenses where license_id = $1',
- array($id)), 0, 0)).'</p>';
+ echo '<div class="warning">'.sprintf(_('You can\'t delete the license %1$s since it\'s currently referenced in a project.'), db_result(db_query_params ('select license_name from licenses where license_id = $1',
+ array($id)), 0, 0)).'</div>';
return;
}
}
if ($unit == "supported_language") {
$result = db_numrows(db_query_params("SELECT language FROM users WHERE language=$1", array($id)));
if ($result > 0) {
- echo '<p>'.sprintf(_('You can\'t delete the language %1$s since it\'s currently referenced in a user profile.'), db_result(db_query_params ('select license_name from licenses where license_id = $1',
- array($id)), 0, 0)).'</p>';
+ echo '<div class="warning">'.sprintf(_('You can\'t delete the language %1$s since it\'s currently referenced in a user profile.'), db_result(db_query_params ('select license_name from licenses where license_id = $1',
+ array($id)), 0, 0)).'</div>';
return;
}
}
@@ -165,9 +169,9 @@
*/
function admin_table_delete($table, $unit, $primary_key, $id) {
if (db_query_params("DELETE FROM $table WHERE $primary_key=$1", array($id))) {
- print('<p class="feedback">');
+ print('<div class="feedback">');
printf(_('%1$s successfully deleted.'), ucfirst(getUnitLabel($unit)));
- print('</p>');
+ print('</div>');
} else {
echo db_error();
}
@@ -241,7 +245,9 @@
array ($id)) ;
if (db_query_qpa($qpa)) {
+ print('<div class="feedback">');
printf(_('%1$s successfully modified.'), ucfirst(getUnitLabel($unit)));
+ print('</div>');
} else {
echo db_error();
}
@@ -251,7 +257,7 @@
$field_list = getStringFromRequest('__fields__');
- $fields = split(",", $field_list);
+ $fields = explode(",", $field_list);
$values = array(); $v = array ();
$qpa = db_construct_qpa (false, 'INSERT INTO ' . $table . ' (' . $field_list . ') VALUES (') ;
@@ -265,7 +271,9 @@
$qpa = db_construct_qpa ($qpa, implode (',', $v), $values) ;
if (db_query_qpa($qpa)) {
+ print('<div class="feedback">');
printf(_('%1$s successfully added.'), ucfirst(getUnitLabel($unit)));
+ print('</div>');
} else {
form_release_key(getStringFromRequest('form_key'));
echo db_error();
Modified: trunk/src/www/admin/edit_frs_filetype.php
===================================================================
--- trunk/src/www/admin/edit_frs_filetype.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/admin/edit_frs_filetype.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -4,20 +4,20 @@
*
* Copyright 1999-2001 (c) VA Linux Systems
*
- * 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/admin/edit_frs_processor.php
===================================================================
--- trunk/src/www/admin/edit_frs_processor.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/admin/edit_frs_processor.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -4,20 +4,20 @@
*
* Copyright 1999-2001 (c) VA Linux Systems
*
- * 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/admin/edit_licenses.php
===================================================================
--- trunk/src/www/admin/edit_licenses.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/admin/edit_licenses.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -2,24 +2,24 @@
/**
* Site Admin page to edit licenses
*
- * 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/admin/edit_theme.php
===================================================================
--- trunk/src/www/admin/edit_theme.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/admin/edit_theme.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -4,20 +4,20 @@
*
* Copyright 1999-2001 (c) VA Linux Systems
*
- * 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/tracker/admin/ind.php
===================================================================
--- trunk/src/www/tracker/admin/ind.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/tracker/admin/ind.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -1,109 +1,126 @@
<?php
+/**
+ * FusionForge Tracker Listing
+ *
+ * Copyright 2000, Quentin Cregan/Sourceforge
+ * Copyright 2002-2003, Tim Perdue/GForge, LLC
+ * Copyright 2010, FusionForge Team
+ *
+ * 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
+ */
- //
- //
- // This page lists the available trackers as well as a
- // form to create a new tracker
- //
- //
- if (getStringFromRequest('post_changes')) {
- $name = getStringFromRequest('name');
- $description = getStringFromRequest('description');
- $is_public = getStringFromRequest('is_public');
- $allow_anon = getStringFromRequest('allow_anon');
- $email_all = getStringFromRequest('email_all');
- $email_address = getStringFromRequest('email_address');
- $due_period = getStringFromRequest('due_period');
- $use_resolution = getStringFromRequest('use_resolution');
- $submit_instructions = getStringFromRequest('submit_instructions');
- $browse_instructions = getStringFromRequest('browse_instructions');
+if (getStringFromRequest('post_changes')) {
+ $name = getStringFromRequest('name');
+ $description = getStringFromRequest('description');
+ $is_public = getStringFromRequest('is_public');
+ $allow_anon = getStringFromRequest('allow_anon');
+ $email_all = getStringFromRequest('email_all');
+ $email_address = getStringFromRequest('email_address');
+ $due_period = getStringFromRequest('due_period');
+ $use_resolution = getStringFromRequest('use_resolution');
+ $submit_instructions = getStringFromRequest('submit_instructions');
+ $browse_instructions = getStringFromRequest('browse_instructions');
- if (!forge_check_perm ('tracker_admin', $group->getID())) {
- exit_permission_denied();
+ if (!forge_check_perm ('tracker_admin', $group->getID())) {
+ exit_permission_denied('','tracker');
+ }
+
+ if (getStringFromRequest('add_at')) {
+ $res=new ArtifactTypeHtml($group);
+ if (!$res->create($name,$description,$is_public,$allow_anon,$email_all,$email_address,
+ $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
+ exit_error($res->getErrorMessage(),'tracker');
+ } else {
+ $feedback = _('Tracker created successfully');
+ $feedback .= '<br/>';
+ $feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
}
- if (getStringFromRequest('add_at')) {
- $res=new ArtifactTypeHtml($group);
- if (!$res->create($name,$description,$is_public,$allow_anon,$email_all,$email_address,
- $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
- exit_error('Error',$res->getErrorMessage());
- } else {
- $feedback .= _('Tracker created successfully');
- $feedback .= '<br />';
- $feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
- }
-
- }
}
+}
- //
- // Display existing artifact types
- //
- $atf = new ArtifactTypeFactory($group);
- if (!$atf || !is_object($atf) || $atf->isError()) {
- exit_error('Error','Could Not Get ArtifactTypeFactory');
- }
+//
+// Display existing artifact types
+//
+$atf = new ArtifactTypeFactory($group);
+if (!$atf || !is_object($atf) || $atf->isError()) {
+ exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
+}
- // Only keep the Artifacts where the user has admin rights.
- $arr =& $atf->getArtifactTypes();
- $i=0;
- for ($j = 0; $j < count($arr); $j++) {
- if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
- $at_arr[$i++] =& $arr[$j];
- }
+// Only keep the Artifacts where the user has admin rights.
+$arr =& $atf->getArtifactTypes();
+$i=0;
+for ($j = 0; $j < count($arr); $j++) {
+ if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
+ $at_arr[$i++] =& $arr[$j];
}
- // If no more tracker now,
- if ($i==0 && $j>0) {
- exit_permission_denied();
- }
+}
+// If no more tracker now,
+if ($i==0 && $j>0) {
+ exit_permission_denied();
+}
- //required params for site_project_header();
- $params['group']=$group_id;
- $params['toptab']='tracker';
- if(isset($page_title)){
- $params['title'] = $page_title;
- } else {
- $params['title'] = '';
- }
+//required params for site_project_header();
+$params['group']=$group_id;
+$params['toptab']='tracker';
+if(isset($page_title)){
+ $params['title'] = $page_title;
+} else {
+ $params['title'] = '';
+}
- echo site_project_header($params);
- echo $HTML->subMenu(
- array(
- _('Report'),
- _('Admin')
- ),
- array(
- '/tracker/reporting/?group_id='.$group_id,
- '/tracker/admin/?group_id='.$group_id
- )
- );
+echo site_project_header($params);
+echo $HTML->subMenu(
+ array(
+ _('Report'),
+ _('Admin')
+ ),
+ array(
+ '/tracker/reporting/?group_id='.$group_id,
+ '/tracker/admin/?group_id='.$group_id
+ )
+);
- if (!$at_arr || count($at_arr) < 1) {
- echo '<div class="error">'._('No trackers found').'</div>';
- } else {
+if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
+ echo '<div class="warning">'._('No trackers found').'</div>';
+} else {
- echo '
- <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
+ echo '
+ <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
- /*
- Put the result set (list of forums for this group) into a column with folders
- */
- $tablearr=array(_('Tracker'),_('Description'));
- echo $HTML->listTableTop($tablearr);
+ /*
+ Put the result set (list of forums for this group) into a column with folders
+ */
+ $tablearr=array(_('Tracker'),_('Description'));
+ echo $HTML->listTableTop($tablearr);
- for ($j = 0; $j < count($at_arr); $j++) {
- echo '
- <tr '. $HTML->boxGetAltRowStyle($j) . '>
- <td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
- html_image("ic/tracker20w.png","20","20") . ' '.
- $at_arr[$j]->getName() .'</a>
- </td>
- <td>'.$at_arr[$j]->getDescription() .'
- </td>
- </tr>';
- }
+ for ($j = 0; $j < count($at_arr); $j++) {
+ echo '
+ <tr '. $HTML->boxGetAltRowStyle($j) . '>
+ <td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
+ html_image("ic/tracker20w.png","20","20") . ' '.
+ $at_arr[$j]->getName() .'</a>
+ </td>
+ <td>'.$at_arr[$j]->getDescription() .'
+ </td>
+ </tr>';
+ }
echo $HTML->listTableBottom();
}
Modified: trunk/src/www/tracker/admin/index.php
===================================================================
--- trunk/src/www/tracker/admin/index.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/tracker/admin/index.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -1,8 +1,27 @@
<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
+/**
+ * FusionForge Tracker Listing
+ *
+ * Copyright 1999-2000 (c) The SourceForge Crew
+ * Copyright 2010, FusionForge Team
+ * 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');
require_once $gfcommon.'include/pre.php';
@@ -29,9 +48,9 @@
}
if ($group->isError()) {
if($group->isPermissionDeniedError()) {
- exit_permission_denied($group->getErrorMessage());
+ exit_permission_denied($group->getErrorMessage(),'tracker');
} else {
- exit_error(_('Error'), $group->getErrorMessage());
+ exit_error($group->getErrorMessage(),'home');
}
}
@@ -47,10 +66,10 @@
//
$ath = new ArtifactTypeHtml($group,$atid);
if (!$ath || !is_object($ath)) {
- exit_error('Error','ArtifactType could not be created');
+ exit_error(_('ArtifactType could not be created'),'tracker');
}
if ($ath->isError()) {
- exit_error(_('Error').'',$ath->getErrorMessage());
+ exit_error($ath->getErrorMessage(),'tracker');
}
$next = '';
Modified: trunk/src/www/tracker/browse.php
===================================================================
--- trunk/src/www/tracker/browse.php 2010-09-19 17:57:10 UTC (rev 10552)
+++ trunk/src/www/tracker/browse.php 2010-09-20 09:36:11 UTC (rev 10553)
@@ -6,7 +6,23 @@
* Copyright 2010 Roland Mas
* Copyright 2010 Alain Peyrat, Alcatel-Lucent
*
+ * 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 $gfcommon.'tracker/ArtifactFactory.class.php';
require_once $gfcommon.'tracker/ArtifactQuery.class.php';
//
@@ -16,6 +32,7 @@
$query_id = getIntFromRequest('query_id');
$start = getIntFromRequest('start');
+$paging = 0;
//
// The browse page can be powered by a pre-saved query
More information about the Fusionforge-commits
mailing list