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# Test Step Import Page 10# 11# $RCSfile: test_step_import_csv_page.php,v $ $Revision: 1.8 $ 12# --------------------------------------------------------------------- 13 14include"./api/include_api.php"; 15auth_authenticate_user(); 16 17$page = basename(__FILE__); 18$update_action_page = 'test_detail_update_page.php'; 19$test_detail_page = 'test_detail_page.php'; 20$add_version_page = 'test_add_version_page.php'; 21$delete_page = 'delete_page.php'; 22$new_upload_action_page = 'test_detail_new_upload_action.php'; 23$row_test_step_add_action_page = 'test_step_add_action.php'; 24$row_test_step_renumber_page = 'test_step_renumber_action.php'; 25$row_test_step_edit_page = 'test_step_edit_page.php'; 26$delete_page = 'delete_page.php'; 27$active_version_page = 'test_version_make_active_action.php'; 28$test_page = 'test_page.php'; 29 30$s_user_properties = session_get_user_properties(); 31$s_project_properties = session_get_project_properties(); 32$s_show_options = session_get_show_options(); 33$s_test_details = session_set_properties("test", $_GET); 34 35$s_user_id = $s_user_properties['user_id']; 36$s_username = $s_user_properties['username']; 37$s_tempest_admin = $s_user_properties['tempest_admin']; 38$s_project_rights = $s_user_properties['project_rights']; 39$s_delete_rights = $s_user_properties['delete_rights']; 40$s_email = $s_user_properties['email']; 41 42$project_name = $s_project_properties['project_name']; 43$project_id = $s_project_properties['project_id']; 44 45$project_details = project_get_details($project_id); 46$s_show_test_input = $project_details[PROJ_SHOW_TEST_INPUT]; 47 48$test_id = util_pad_id( $s_test_details['test_id'] ); 49$test_version_id = $s_test_details['test_version_id']; 50 51html_window_title(); 52html_print_body(); 53html_page_title($project_name ." - ". lang_get('test_import_csv_page') ); 54html_page_header( $db, $project_name ); 55html_print_menu(); 56 57$row = test_get_detail( $test_id ); 58 59$test_name = $row[TEST_NAME]; 60$test_purpose = $row[TEST_PURPOSE]; 61//$test_comments = $row[TEST_COMMENTS]; 62$ba_owner = $row[TEST_BA_OWNER]; 63$qa_owner = $row[TEST_QA_OWNER]; 64$test_type = $row[TEST_TESTTYPE]; 65$area_tested = $row[TEST_AREA_TESTED]; 66$test_priority = $row[TEST_PRIORITY]; 67$manual = $row[TEST_MANUAL]; 68$automated = $row[TEST_AUTOMATED]; 69$performance = $row[TEST_LR]; 70$autopass = $row[TEST_AUTO_PASS]; 71$assigned_to = $row[TEST_ASSIGNED_TO]; 72$assigned_by = $row[TEST_ASSIGNED_BY]; 73$dateassigned = $row[TEST_DATE_ASSIGNED]; 74$dateexpcomplete = $row[TEST_DATE_EXPECTED]; 75$dateactcomplete = $row[TEST_DATE_COMPLETE]; 76$duration = $row[TEST_DURATION]; 77$test_status = $row[TEST_STATUS]; 78$signoff_by = $row[TEST_SIGNOFF_BY]; 79$signoff_date = $row[TEST_SIGNOFF_DATE]; 80$last_updated_date = $row[TEST_LAST_UPDATED]; 81$last_updated_by = $row[TEST_LAST_UPDATED_BY]; 82 83print"<br>". NEWLINE; 84print"<table class=width100 rules='cols' border='1'>". NEWLINE; 85print"<tr>". NEWLINE; 86html_tbl_print_header( lang_get('test_id') ); 87html_tbl_print_header( lang_get('test_name') ); 88print"</tr>". NEWLINE; 89 90print"<tr>". NEWLINE; 91print"<td><a href='$test_detail_page?test_id=$test_id&project_id=$project_id'>$test_id</a></td>". NEWLINE; 92print"<td>$test_name</td>". NEWLINE; 93print"</tr>". NEWLINE; 94print"</table>". NEWLINE; 95 96//print"<b>Import Test Steps for Test: $test_name</b>"; 97/* 98if( IMPORT_EXPORT_TO_EXCEL ) { 99 print"<font color=red><br><br><b>Warning: Make sure the excel file is in the following format:</b></font>"; 100} 101else { 102 print"<font color=red><br><br><b>Warning: Make sure the csv file is in the following format:</b></font>"; 103} 104*/ 105 106print"<br><br>"; 107 108# EXAMPLE TEMPLATE 109print"<table border=0 width='90%' align=center>"; 110print"<tr colspan='4'>". NEWLINE; 111print"<td><b>". lang_get('correct_file_format') .":</b></td>". NEWLINE; 112print"</tr>". NEWLINE; 113print"</table>". NEWLINE; 114 115 116print"<table border=1 width='90%' align=center>"; 117 118print"<tr style='font-weight:bold'>". NEWLINE; 119print"<td nowrap>". lang_get('test_step_no') ."</td>". NEWLINE; 120print"<td nowrap>". lang_get('action') ."</td>". NEWLINE; 121print"<td nowrap>". lang_get('step_inputs') ."</td>". NEWLINE; 122print"<td nowrap>". lang_get('expected_result') ."</td>". NEWLINE; 123print"<td nowrap>". lang_get('info_step') ." (Y)</td>". NEWLINE; 124print"</tr>". NEWLINE; 125 126print"<tr>". NEWLINE; 127print"<td>1</td>". NEWLINE; 128print"<td>The actor enters the URL</td>"; 129print"<td>url: http://www.rth.net</td>"; 130print"<td>The system displays a request for a User ID and Password.</td>". NEWLINE; 131print"<td>Y</td>". NEWLINE; 132print"</tr>". NEWLINE; 133 134print"<tr>". NEWLINE; 135print"<td>2</td>". NEWLINE; 136print"<td>The actor enters their User Id and Password.</td>". NEWLINE; 137print"<td>username: johnnyrotten password: punk</td>". NEWLINE; 138print"<td>The system displays the home page</td>". NEWLINE; 139print"<td>Y</td>". NEWLINE; 140print"</tr>"; 141 142print"<tr>". NEWLINE; 143print"<td>3</td>". NEWLINE; 144print"<td>Verify that the Client's name and address appears as the first listed location.</td>". NEWLINE; 145print"<td> </td>". NEWLINE; 146print"<td>The Client's name and addressappears as the first listed location.". NEWLINE; 147print"Name: Johnny Rotten Address: 10 Downing Street City: London</td>". NEWLINE; 148print"<td> </td>". NEWLINE; 149print"</tr>"; 150 151print"<tr>". NEWLINE; 152print"<td>4</td>". NEWLINE; 153print"<td>Verify that the Radio Button is selected on the Yellow Line.</td>"; 154print"<td> </td>"; 155print"<td>Radio Button is selected on the Yellow Line</td>". NEWLINE; 156print"<td> </td>". NEWLINE; 157print"</tr>"; 158 159print"<tr>". NEWLINE; 160print"<td>...</td>". NEWLINE; 161print"<td>...</td>". NEWLINE; 162print"<td>...</td>". NEWLINE; 163print"<td>...</td>". NEWLINE; 164print"<td>...</td>". NEWLINE; 165print"</tr>". NEWLINE; 166print"</table>". NEWLINE; 167 168 169 170print"<br>"; 171print"<br>"; 172print"<br>"; 173 174error_report_check( $_GET ); 175 176print"<br>"; 177if( IMPORT_EXPORT_TO_EXCEL ) { 178 print"<a href='import_test_steps_example.xls' target='_blank'>Download Template</a>"; 179} 180else { 181 print"<a href='import_test_steps_example.csv' target='_blank'>Download Template</a>"; 182} 183//print" (Right click: \"Save Target As...\")"; 184print"<br>"; 185print"<br>"; 186 187 188print"<b>". lang_get('upload_file') .": </b>"; 189print"<form enctype='multipart/form-data' name='upload' method=post action='test_step_import_csv_action.php'>"; 190print"<input type=hidden name=test_id value=$test_id>"; 191print"<input type=hidden name=test_version_id value=$test_version_id>"; 192 193print"<input type=file name=upload_file size=45>"; 194 195print"<input type='submit' value='Upload'>"; 196 197print"</form>"; 198 199html_print_footer(); 200 201# --------------------------------------------------------------------- 202# $Log: test_step_import_csv_page.php,v $ 203# Revision 1.8 2008/07/21 07:42:34 peter_thal 204# small bug fixes for test_detail_page linking parameter 205# 206# Revision 1.7 2006/08/05 22:09:13 gth2 207# adding NEWLINE constant to support multiple OS newline chars - gth 208# 209# Revision 1.6 2006/06/24 14:34:14 gth2 210# updating changes lost with cvs problem. 211# 212# Revision 1.5 2006/04/11 12:11:03 gth2 213# create a test version when uploading test steps - gth 214# 215# Revision 1.4 2006/04/09 17:33:30 gth2 216# removing unnecessary code - gth 217# 218# Revision 1.3 2006/02/09 12:35:22 gth2 219# cleaning up page for csv/excel import - gth 220# 221# Revision 1.2 2006/01/05 23:30:35 gth2 222# changing upload file name - gth 223# 224# Revision 1.1.1.1 2005/11/30 23:00:58 gth2 225# importing initial version - gth 226# 227# --------------------------------------------------------------------- 228 229?>