1<?php 2# --------------------------------------------------------------------- 3# rth is a requirement, test, and bugtracking system 4# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net 5# This program is distributed under the terms and conditions of the GPL 6# See the README and LICENSE files for details 7#---------------------------------------------------------------------- 8# ------------------------------------ 9# Build page 10# 11# $RCSfile: build_page.php,v $ $Revision: 1.5 $ 12# ------------------------------------ 13include"./api/include_api.php"; 14auth_authenticate_user(); 15 16$page = basename(__FILE__); 17$form_name = 'add_build'; 18$action_page = 'build_add_action.php'; 19$build_edit_page = 'build_edit_page.php'; 20$testset_page = 'testset_page.php'; 21$delete_page = 'delete_page.php'; 22$s_project_properties = session_get_project_properties(); 23$project_name = $s_project_properties['project_name']; 24$project_id = $s_project_properties['project_id']; 25$row_style = ''; 26 27# Set release build properties in session and assign all values to variable 28$s_release_properties = session_set_properties( "release", $_GET ); 29$release_id = $s_release_properties['release_id']; 30$release_name = admin_get_release_name($release_id); 31 32$redirect_url = $page ."?release_id=". $release_id; 33 34$display_options = session_set_display_options( "build", $_POST ); 35$order_by = $display_options['order_by']; 36$order_dir = $display_options['order_dir']; 37 38html_window_title(); 39html_print_body( $form_name, 'build_name_required'); 40html_page_title($project_name ." - ". lang_get('build_page') ); 41html_page_header( $db, $project_name ); 42html_print_menu(); 43 44html_release_map( Array("release_link", lang_get("builds")) ); 45 46error_report_check( $_GET ); 47 48print"<div align=center>". NEWLINE; 49print"<span class='required'>*</span> <span class='print'>" . lang_get('must_complete_field') . "</span>". NEWLINE; 50 51print"<table class=width60>". NEWLINE; 52print"<tr>". NEWLINE; 53print"<td>". NEWLINE; 54 55print"<form method=post name=$form_name action=$action_page>". NEWLINE; 56print"<table class='inner'>". NEWLINE; 57 58# FORM TITLE 59print"<tr>". NEWLINE; 60print"<td colspan='2'><h4>". lang_get('add_build') ." - $release_name</h4></td>". NEWLINE; 61print"</tr>". NEWLINE; 62 63 64# BUILD NAME 65print"<tr>". NEWLINE; 66print"<td class='form-lbl-r'>". lang_get('build_name') ." <span class='required'>*</span></td>". NEWLINE; 67print"<td class='form-data-l'><input type='text' maxlength='20' name='build_name_required' size=30 value='". session_validate_form_get_field("build_name_required")."'></td>". NEWLINE; 68print"</tr>". NEWLINE; 69 70# DESCRIPTION 71print"<tr>". NEWLINE; 72print"<td class='form-lbl-r'>". lang_get('description') ."</td>". NEWLINE; 73print"<td class='form-data-l'><textarea name='build_description' rows=5 cols=30>". 74 session_validate_form_get_field("build_description"). "</textarea></td>". NEWLINE; 75print"</tr>". NEWLINE; 76 77# SUBMIT BUTTON 78print"<tr>". NEWLINE; 79print"<td colspan='2' class='form-data-c'><input type='submit' value='". lang_get('add') ."'></td>". NEWLINE; 80print"</tr>". NEWLINE; 81 82print"</table>". NEWLINE; 83print"</form>". NEWLINE; 84 85print"</td>". NEWLINE; 86print"</tr>". NEWLINE; 87print"</table>". NEWLINE; 88 89print"<br><br>". NEWLINE; 90 91$build_details = admin_get_builds( $release_id, $order_by, $order_dir ); 92 93if( !empty( $build_details ) ) { 94 print"<table id='sortabletable' class='sortable' rules=cols>". NEWLINE; 95 print"<thead>".NEWLINE; 96 print"<tr class=tbl_header>". NEWLINE; 97 98 html_tbl_print_header_not_sortable( lang_get('build_name') ); 99 html_tbl_print_header( lang_get('build_date_received') ); 100 html_tbl_print_header_not_sortable( lang_get('build_description') ); 101 html_tbl_print_header_not_sortable( lang_get('edit') ); 102 html_tbl_print_header_not_sortable( lang_get('delete') ); 103 104 print" </tr>". NEWLINE; 105 print"</thead>".NEWLINE; 106 print"<tbody>".NEWLINE; 107 108 for( $i=0; $i < sizeof( $build_details ); $i++ ) { 109 110 extract( $build_details[$i], EXTR_PREFIX_ALL, 'v' ); 111 112 $build_id = ${'v_' . BUILD_ID}; 113 $build_name = ${'v_' . BUILD_NAME}; 114 $build_date_received = ${'v_' . BUILD_DATE_REC}; 115 $build_description = ${'v_' . BUILD_DESCRIPTION}; 116 117 $row_style = html_tbl_alternate_bgcolor( $row_style ); 118 print"<tr class='$row_style'>". NEWLINE; 119 print"<td class='tbl-l'><a href='$testset_page?build_id=$build_id'>$build_name</a></td>". NEWLINE; 120 print"<td class='tbl-c'>$build_date_received</td>". NEWLINE; 121 print"<td class='tbl-l'>$build_description</td>". NEWLINE; 122 print"<td class='tbl-c'><a href='$build_edit_page?build_id=$build_id'>". lang_get('edit') ."</a></td>". NEWLINE; 123 print"<td class='tbl-c'>"; 124 print"<form method=post action='$delete_page'>". NEWLINE; 125 print"<input type='submit' name='delete' value='". lang_get( 'delete' ) ."' class='page-numbers'>"; 126 print"<input type='hidden' name='r_page' value=$redirect_url>". NEWLINE; 127 print"<input type='hidden' name='f' value='delete_build'>". NEWLINE; 128 print"<input type='hidden' name='id' value=$build_id>". NEWLINE; 129 print"<input type='hidden' name='msg' value='30'>". NEWLINE; 130 print"</form>"; 131 print"</td>". NEWLINE; 132 /* 133 print"<td class='tbl-c'><a href='$delete_page?r_page=$page&f=delete_build&id=$build_id&msg=30'>". lang_get('delete') ."</a></td>". NEWLINE; 134 */ 135 print"</tr>". NEWLINE; 136 } 137 print"</tbody>".NEWLINE; 138 print"</table>". NEWLINE; 139 140} else { 141 html_no_records_found_message( lang_get('no_builds') ); 142} 143 144print"</div>". NEWLINE; 145 146html_print_footer(); 147 148session_validate_form_reset(); 149 150# ------------------------------------ 151# $Log: build_page.php,v $ 152# Revision 1.5 2008/04/23 06:31:29 cryobean 153# *** empty log message *** 154# 155# Revision 1.4 2008/01/22 07:55:49 cryobean 156# made the table sortable 157# 158# Revision 1.3 2006/08/05 22:07:59 gth2 159# adding NEWLINE constant to support multiple OS newline chars - gth 160# 161# Revision 1.2 2006/02/24 11:38:20 gth2 162# update to div - class=div-c not working in firefox - gth 163# 164# Revision 1.1.1.1 2005/11/30 23:00:56 gth2 165# importing initial version - gth 166# 167# ------------------------------------ 168?>