5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 Standard header to be used on all /project/admin/* pages
34 function frs_admin_header($params) {
40 if (!session_loggedin()) {
44 $project =& group_get_object($group_id);
45 if (!$project || !is_object($project)) {
49 $perm =& $project->getPermission( session_get_user() );
50 if (!$perm || !is_object($perm)) {
55 Are they a release technician?
57 if (!$perm->isReleaseTechnician()) {
58 exit_permission_denied();
64 function frs_admin_footer() {
65 site_project_footer(array());
68 function frs_header($params) {
69 global $group_id,$HTML,$Language,$sys_use_frs;
72 Does this site use FRS?
78 $project =& group_get_object($group_id);
79 if (!$project || !is_object($project)) {
83 $params['toptab']='frs';
84 $params['group']=$group_id;
85 site_project_header($params);
87 if (session_loggedin()) {
88 $perm =& $project->getPermission(session_get_user());
89 if ($perm && is_object($perm) && !$perm->isError() && $perm->isReleaseTechnician()) {
96 '/frs/?group_id='.$group_id,
97 '/frs/admin/?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("SELECT * FROM frs_status");
132 return html_build_select_box ($FRS_STATUS_RES,$name,$checked_val,false);
137 pop-up box of supported frs filetypes
141 function frs_show_filetype_popup ($name='type_id', $checked_val="xzxz") {
143 return a pop-up select box of the available filetypes
145 global $FRS_FILETYPE_RES, $Language;
146 if (!isset($FRS_FILETYPE_RES)) {
147 $FRS_FILETYPE_RES=db_query("SELECT * FROM frs_filetype");
149 return html_build_select_box ($FRS_FILETYPE_RES,$name,$checked_val,true,_('Must Choose One'));
154 pop-up box of supported frs processor options
158 function frs_show_processor_popup ($name='processor_id', $checked_val="xzxz") {
160 return a pop-up select box of the available processors
162 global $FRS_PROCESSOR_RES, $Language;
163 if (!isset($FRS_PROCESSOR_RES)) {
164 $FRS_PROCESSOR_RES=db_query("SELECT * FROM frs_processor");
166 return html_build_select_box ($FRS_PROCESSOR_RES,$name,$checked_val,true,_('Must Choose One'));
171 pop-up box of packages:releases for this group
176 function frs_show_release_popup ($group_id, $name='release_id', $checked_val="xzxz") {
178 return a pop-up select box of releases for the project
180 global $FRS_RELEASE_RES, $sys_database_type;
183 return 'ERROR - GROUP ID REQUIRED';
185 if (!isset($FRS_RELEASE_RES)) {
186 if ($sys_database_type == "mysql") {
187 $sql = "SELECT frs_release.release_id,concat(frs_package.name,' : ',frs_release.name) ";
189 $sql = "SELECT frs_release.release_id,(frs_package.name || ' : ' || frs_release.name) ";
192 "FROM frs_release,frs_package ".
193 "WHERE frs_package.group_id='$group_id' ".
194 "AND frs_release.package_id=frs_package.package_id";
196 $FRS_RELEASE_RES = db_query($sql);
199 return html_build_select_box($FRS_RELEASE_RES,$name,$checked_val,false);
205 pop-up box of packages for this group
209 function frs_show_package_popup ($group_id, $name='package_id', $checked_val="xzxz") {
211 return a pop-up select box of packages for this project
213 global $FRS_PACKAGE_RES;
215 return 'ERROR - GROUP ID REQUIRED';
217 if (!isset($FRS_PACKAGE_RES)) {
218 $FRS_PACKAGE_RES=db_query("SELECT package_id,name
219 FROM frs_package WHERE group_id='$group_id'");
222 return html_build_select_box ($FRS_PACKAGE_RES,$name,$checked_val,false);