5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 Standard header to be used on all /project/admin/* pages
32 function frs_admin_header($params) {
38 if (!session_loggedin()) {
42 $project =& group_get_object($group_id);
43 if (!$project || !is_object($project)) {
47 $perm =& $project->getPermission( session_get_user() );
48 if (!$perm || !is_object($perm)) {
53 Are they a release technician?
55 if (!$perm->isReleaseTechnician()) {
56 exit_permission_denied();
62 function frs_admin_footer() {
63 site_project_footer(array());
66 function frs_header($params) {
67 global $group_id,$HTML,$sys_use_frs;
70 Does this site use FRS?
76 $project =& group_get_object($group_id);
77 if (!$project || !is_object($project)) {
81 $params['toptab']='frs';
82 $params['group']=$group_id;
83 site_project_header($params);
85 if (session_loggedin()) {
86 $perm =& $project->getPermission(session_get_user());
87 if ($perm && is_object($perm) && !$perm->isError() && $perm->isReleaseTechnician()) {
95 '/frs/?group_id='.$group_id,
96 '/frs/admin/?group_id='.$group_id,
97 '/frs/reporting/downloads.php?group_id='.$group_id
104 function frs_footer() {
105 site_project_footer(array());
112 The following functions are for the FRS (File Release System)
120 pop-up box of supported frs statuses
124 function frs_show_status_popup ($name='status_id', $checked_val="xzxz") {
126 return a pop-up select box of statuses
128 global $FRS_STATUS_RES;
129 if (!isset($FRS_STATUS_RES)) {
130 $FRS_STATUS_RES=db_query_params ('SELECT * FROM frs_status',
133 return html_build_select_box ($FRS_STATUS_RES,$name,$checked_val,false);
138 pop-up box of supported frs filetypes
142 function frs_show_filetype_popup ($name='type_id', $checked_val="xzxz") {
144 return a pop-up select box of the available filetypes
146 global $FRS_FILETYPE_RES;
147 if (!isset($FRS_FILETYPE_RES)) {
148 $FRS_FILETYPE_RES=db_query_params ('SELECT * FROM frs_filetype ORDER BY type_id',
151 return html_build_select_box ($FRS_FILETYPE_RES,$name,$checked_val,true,_('Must Choose One'));
156 pop-up box of supported frs processor options
160 function frs_show_processor_popup ($name='processor_id', $checked_val="xzxz") {
162 return a pop-up select box of the available processors
164 global $FRS_PROCESSOR_RES;
165 if (!isset($FRS_PROCESSOR_RES)) {
166 $FRS_PROCESSOR_RES=db_query_params ('SELECT * FROM frs_processor ORDER BY processor_id',
169 return html_build_select_box ($FRS_PROCESSOR_RES,$name,$checked_val,true,_('Must Choose One'));
174 pop-up box of packages:releases for this group
179 function frs_show_release_popup ($group_id, $name='release_id', $checked_val="xzxz") {
181 return a pop-up select box of releases for the project
183 global $FRS_RELEASE_RES, $sys_database_type;
186 return 'ERROR - GROUP ID REQUIRED';
188 if (!isset($FRS_RELEASE_RES)) {
189 $FRS_RELEASE_RES = db_query_params("SELECT frs_release.release_id,(frs_package.name || ' : ' || frs_release.name) FROM frs_release,frs_package
190 WHERE frs_package.group_id=$1
191 AND frs_release.package_id=frs_package.package_id",
195 return html_build_select_box($FRS_RELEASE_RES,$name,$checked_val,false);
201 pop-up box of packages for this group
205 function frs_show_package_popup ($group_id, $name='package_id', $checked_val="xzxz") {
207 return a pop-up select box of packages for this project
209 global $FRS_PACKAGE_RES;
211 return 'ERROR - GROUP ID REQUIRED';
213 if (!isset($FRS_PACKAGE_RES)) {
214 $FRS_PACKAGE_RES=db_query_params ('SELECT package_id,name
215 FROM frs_package WHERE group_id=$1',
219 return html_build_select_box ($FRS_PACKAGE_RES,$name,$checked_val,false);
225 // c-file-style: "bsd"