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# Manage Project Page 10# 11# $RCSfile: project_manage_testareatested_page.php,v $ $Revision: 1.4 $ 12# ------------------------------------ 13 14include"./api/include_api.php"; 15auth_authenticate_user(); 16 17$page = basename(__FILE__); 18$project_manage_page = 'project_manage_page.php'; 19$project_add_page = 'project_add_page.php'; 20$project_edit_page = 'project_edit_page.php'; 21$user_manage_page = 'user_manage_page.php'; 22$user_add_page = 'user_add_page.php'; 23$project_manage_action = 'project_manage_action.php'; 24$delete_page = 'delete_page.php'; 25 26$s_project_properties = session_get_project_properties(); 27$project_name = $s_project_properties['project_name']; 28$project_id = $s_project_properties['project_id']; 29 30$s_user_properties = session_get_user_properties(); 31$user_id = $s_user_properties['user_id']; 32 33session_set_properties("project_manage", $_GET); 34$selected_project_properties = session_get_properties("project_manage"); 35$selected_project_id = $selected_project_properties['project_id']; 36 37$project_manager = user_has_rights( $selected_project_id, $user_id, MANAGER ); 38 39$redirect_url = $page ."?project_id=". $selected_project_id; 40 41$s_user_properties = session_get_user_properties(); 42$user_id = $s_user_properties['user_id']; 43$row_style = ''; 44 45$order_by = AREA_TESTED_NAME; 46$order_dir = "ASC"; 47$page_number = 1; 48 49util_set_order_by($order_by, $_GET); 50util_set_order_dir($order_dir, $_GET); 51util_set_page_number($page_number, $_GET); 52 53util_set_order_by($order_by, $_POST); 54util_set_order_dir($order_dir, $_POST); 55util_set_page_number($page_number, $_POST); 56 57 58html_window_title(); 59html_print_body(); 60html_page_title(project_get_name($selected_project_id) ." - ". lang_get('manage_project_page') ); 61html_page_header( $db, $project_name ); 62html_print_menu(); 63admin_menu_print( $page, $project_id, $user_id ); 64 65html_project_manage_menu(); 66html_project_manage_tests_menu(); 67 68error_report_check( $_GET ); 69 70$project_details = project_get_details( $selected_project_id ); 71 72print"<div align=center>". NEWLINE; 73 74print"<br>". NEWLINE; 75 76if( !empty( $project_details ) ) { 77 78 $project_id = $project_details[PROJ_ID]; 79 $project_name = $project_details[PROJ_NAME]; 80 $project_status = $project_details[PROJ_STATUS]; 81 $project_description = $project_details[PROJ_DESCRIPTION]; 82 83 #################################################################################### 84 # Areas Tested 85 # --------------------------------------------------------------------- 86 87 # New Area Tested 88 if( $project_manager ) { 89 print"<form method=post action='project_add_area_action.php'>". NEWLINE; 90 print"<span class='required'>*</span><span class='print'>" . lang_get('must_complete_field') . "</span>". NEWLINE; 91 print"<table class='width70'>". NEWLINE; 92 print"<tr>". NEWLINE; 93 print"<td>". NEWLINE; 94 print"<table class=inner>". NEWLINE; 95 print"<tr>". NEWLINE; 96 print"<td class=form-header-l>".lang_get('add_area_tested')."</td>". NEWLINE; 97 print"</tr>". NEWLINE; 98 print"<tr>". NEWLINE; 99 print"<td class='form-lbl-c'>". lang_get('area_tested') ." <span class='required'>*</span>". NEWLINE; 100 print"<input type=text size=60 maxlength=50 name='area_tested_required' value='".session_validate_form_get_field( 'area_tested_required' )."'>". NEWLINE; 101 print" <input type=submit name='new_area_tested' value='".lang_get("add")."'>"; 102 print"</td>". NEWLINE; 103 print"</tr>". NEWLINE; 104 print"</table>". NEWLINE; 105 print"</td>". NEWLINE; 106 print"</tr>". NEWLINE; 107 print"</table>". NEWLINE; 108 print"</form>". NEWLINE; 109 110 print"<br>"; 111 112 } 113 114 # --------------------------------------------------------------------- 115 # Areas Tested Table 116 # --------------------------------------------------------------------- 117 print"<form method=post name='area_tested_table' action='$page?order_by=$order_by&order_dir=$order_dir'>"; 118 print"<table class=hide70>". NEWLINE; 119 print"<tr>". NEWLINE; 120 print"<td>". NEWLINE; 121 $rows_areas_tested = project_get_areas_tested($selected_project_id, $order_by, $order_dir, $page_number); 122 print"<input type=hidden name='order_dir' value='$order_dir'>"; 123 print"<input type=hidden name='order_by' value='$order_by'>"; 124 print"</td>". NEWLINE; 125 print"</tr>". NEWLINE; 126 print"</table>". NEWLINE; 127 print"</form>". NEWLINE; 128 129 if( $rows_areas_tested ) { 130 print"<input type=hidden name=table value=project_manage_areas>". NEWLINE; 131 print"<table id='sortabletable' class='sortable' rules='cols'>". NEWLINE; 132 print"<thead>".NEWLINE; 133 print"<tr>". NEWLINE; 134 html_tbl_print_header( lang_get('area_tested') ); 135 if( $project_manager ) { 136 html_tbl_print_header_not_sortable( lang_get('edit') ); 137 html_tbl_print_header_not_sortable( lang_get('delete') ); 138 } 139 print"\n</tr>". NEWLINE; 140 print"</thead>".NEWLINE; 141 print"<tbody>".NEWLINE; 142 foreach($rows_areas_tested as $row_area) { 143 144 $area_tested = $row_area[AREA_TESTED_NAME]; 145 $area_tested_id = $row_area[AREA_TESTED_ID]; 146 147 #$row_style = html_tbl_alternate_bgcolor($row_style); 148 #print"<tr class='$row_style'>". NEWLINE; 149 print"<tr>". NEWLINE; 150 151 print"<td>$area_tested</td>". NEWLINE; 152 if( $project_manager ) { 153 print"<td><a href='project_edit_area_tested_page.php?area_id=$area_tested_id'>".lang_get("edit")."</a></td>". NEWLINE; 154 print"<td>". NEWLINE; 155 print"<form name='delete_area_tested' method=post action='$delete_page'>". NEWLINE; 156 print"<input type='submit' name='delete_area_tested' value='". lang_get( 'delete' ) ."' class='page-numbers'>". NEWLINE; 157 print"<input type='hidden' name='r_page' value='$redirect_url#area_tested'>". NEWLINE; 158 print"<input type='hidden' name='f' value='remove_area_tested_from_project'>". NEWLINE; 159 print"<input type='hidden' name='id' value='$area_tested_id'>". NEWLINE; 160 print"<input type='hidden' name='project_id' value='$selected_project_id'>". NEWLINE; 161 print"<input type='hidden' name='msg' value='". DEL_AREA_FROM_PROJECT ."'>". NEWLINE; 162 print"</form>". NEWLINE; 163 print"</td>". NEWLINE; 164 } 165 166 print"</tr>". NEWLINE; 167 } 168 print"</tbody>".NEWLINE; 169 print"</table>". NEWLINE; 170 171 } else { 172 173 html_no_records_found_message( lang_get('no_testareatested') ); 174 } 175} 176 177print"</div>". NEWLINE; 178 179html_print_footer(); 180 181# ------------------------------------ 182# $Log: project_manage_testareatested_page.php,v $ 183# Revision 1.4 2008/01/22 07:58:14 cryobean 184# made the table sortable 185# 186# Revision 1.3 2006/08/05 22:08:36 gth2 187# adding NEWLINE constant to support multiple OS newline chars - gth 188# 189# Revision 1.2 2006/02/24 11:37:48 gth2 190# update to div - class=div-c not working in firefox - gth 191# 192# Revision 1.1.1.1 2005/11/30 23:00:57 gth2 193# importing initial version - gth 194# 195# ------------------------------------ 196 197?>