*
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2002-2004 (c) GForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2011, Franck Villaume - Capgemini
* 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.
+ * 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 Licence, 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
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
exit_not_logged_in();
}
- $project =& group_get_object($group_id);
+ $project = group_get_object($group_id);
if (!$project || !is_object($project)) {
return;
}
- session_require_perm ('frs', $group_id, 'write') ;
+ session_require_perm('frs', $group_id, 'write');
frs_header($params);
}
exit_disabled('home');
}
- $project =& group_get_object($group_id);
+ $project = group_get_object($group_id);
if (!$project || !is_object($project)) {
exit_no_group();
}
- $params['toptab']='frs';
- $params['group']=$group_id;
- site_project_header($params);
- echo '<h1>' . $params['title'] . '</h1>';
+ $params['toptab'] = 'frs';
+ $params['group'] = $group_id;
- if (forge_check_perm ('frs', $group_id, 'write')) {
- echo $HTML->subMenu(
+ if (forge_check_perm('frs', $group_id, 'write')) {
+ $params['submenu'] = $HTML->subMenu(
array(
- _('File Release System'),
- _('Admin'),
- _('Reporting')
+ _('View File Releases'),
+ _('Reporting'),
+ _('Administration')
),
array(
'/frs/?group_id='.$group_id,
- '/frs/admin/?group_id='.$group_id,
- '/frs/reporting/downloads.php?group_id='.$group_id
+ '/frs/reporting/downloads.php?group_id='.$group_id,
+ '/frs/admin/?group_id='.$group_id
)
);
}
+ site_project_header($params);
}
function frs_footer() {
The following functions are for the FRS (File Release System)
*/
+/*
+ pop-up box of public / private frs statuses
+*/
+
+function frs_show_public_popup($name='is_public', $checked_val="xzxz") {
+ /*
+ return a pop-up select box of statuses
+ */
+ $FRS_PUBLIC_RES = array('private', 'public');
+ return html_build_select_box_from_array($FRS_PUBLIC_RES, $name, $checked_val, false);
+}
/*
pop-up box of supported frs statuses
*/
-function frs_show_status_popup ($name='status_id', $checked_val="xzxz") {
+function frs_show_status_popup($name='status_id', $checked_val="xzxz") {
/*
return a pop-up select box of statuses
*/
global $FRS_STATUS_RES;
if (!isset($FRS_STATUS_RES)) {
- $FRS_STATUS_RES=db_query_params ('SELECT * FROM frs_status',
+ $FRS_STATUS_RES=db_query_params('SELECT * FROM frs_status',
array());
}
- return html_build_select_box ($FRS_STATUS_RES,$name,$checked_val,false);
+ return html_build_select_box($FRS_STATUS_RES, $name, $checked_val, false);
}
/*
*/
global $FRS_FILETYPE_RES;
if (!isset($FRS_FILETYPE_RES)) {
- $FRS_FILETYPE_RES=db_query_params ('SELECT * FROM frs_filetype ORDER BY type_id',
+ $FRS_FILETYPE_RES=db_query_params('SELECT * FROM frs_filetype ORDER BY type_id',
array());
}
- return html_build_select_box ($FRS_FILETYPE_RES,$name,$checked_val,true,_('Must Choose One'));
+ return html_build_select_box($FRS_FILETYPE_RES, $name, $checked_val, true, _('Must Choose One'));
}
/*
pop-up box of supported frs processor options
*/
-function frs_show_processor_popup ($name='processor_id', $checked_val="xzxz") {
+function frs_show_processor_popup($name='processor_id', $checked_val="xzxz") {
/*
- return a pop-up select box of the available processors
+ return a pop-up select box of the available processors
*/
global $FRS_PROCESSOR_RES;
if (!isset($FRS_PROCESSOR_RES)) {
return 'ERROR - GROUP ID REQUIRED';
} else {
if (!isset($FRS_RELEASE_RES)) {
- $FRS_RELEASE_RES = db_query_params("SELECT frs_release.release_id,(frs_package.name || ' : ' || frs_release.name) FROM frs_release,frs_package
-WHERE frs_package.group_id=$1
-AND frs_release.package_id=frs_package.package_id",
+ $FRS_RELEASE_RES = db_query_params("SELECT frs_release.release_id,(frs_package.name || ' : ' || frs_release.name) FROM frs_release,frs_package
+WHERE frs_package.group_id=$1
+AND frs_release.package_id=frs_package.package_id",
array($group_id));
echo db_error();
}
return 'ERROR - GROUP ID REQUIRED';
} else {
if (!isset($FRS_PACKAGE_RES)) {
- $FRS_PACKAGE_RES=db_query_params ('SELECT package_id,name
+ $FRS_PACKAGE_RES=db_query_params ('SELECT package_id,name
FROM frs_package WHERE group_id=$1',
array($group_id));
echo db_error();
$group_unix_name = $release->getFRSPackage()->getGroup()->getUnixName() ;
- $incoming = "forge_get_config('groupdir_prefix')/$group_unix_name/incoming" ;
+ $incoming = forge_get_config('groupdir_prefix')."/$group_unix_name/incoming" ;
$filechecks = false ;
}
if ($filechecks) {
+ if (strlen($fname) < 3)
+ exit_error('Error',_('FRSFile Name Must Be At Least 3 Characters'));
if (!$move) {
$tmp = tempnam ('', '') ;
copy ($infile, $tmp) ;
}
}
+/* filter utils.php:&ls() output for additional constraints from FRS */
+function frs_filterfiles($in) {
+ $out = array();
+ for ($i = 0; $i < count($in); $i++) {
+ if (strlen($in[$i]) < 3)
+ continue;
+ $out[] = $in[$i];
+ }
+ return $out;
+}
+
// Local Variables:
// mode: php
// c-file-style: "bsd"