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("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;
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;
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);
228 // c-file-style: "bsd"