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 Edit Page 10# 11# $RCSfile: test_step_edit_page.php,v $ $Revision: 1.5 $ 12# --------------------------------------------------------------------- 13 14include"./api/include_api.php"; 15 16$page = basename(__FILE__); 17$update_action_page = 'test_detail_page.php'; 18$test_step_edit_page = 'test_step_edit_action.php'; 19 20$project_properties = session_get_project_properties(); 21$project_name = $project_properties['project_name']; 22$project_id = $project_properties['project_id']; 23//$test_id = $_GET['test_id']; 24//$test_version_id = $_GET['test_version_id']; 25$test_step_id = $_GET['test_step_id']; 26 27$s_test_detail = session_get_properties('test'); 28$test_id = $s_test_detail['test_id']; 29//$test_version_id = $s_test_detail['test_version_id']; 30 31 32 33 34if (isset($_GET['failed'])) { 35 $is_validation_failure = $_GET['failed']; 36} 37else 38 $is_validation_failure = false; 39 40html_window_title(); 41auth_authenticate_user(); 42 43html_page_title($project_name ." - ". lang_get('test_step_edit_page') ); 44html_page_header( $db, $project_name ); 45 46html_print_menu(); 47test_menu_print ($page); 48html_print_body(); 49print"<br><br>"; 50 51$ts_detail = test_get_test_step_detail( $test_step_id ); 52 53$step = $ts_detail[TEST_STEP_NO]; 54$action = $ts_detail[TEST_STEP_ACTION]; 55$expected = $ts_detail[TEST_STEP_EXPECTED]; 56$inputs = $ts_detail[TEST_STEP_TEST_INPUTS]; 57$info_step = $ts_detail[TEST_STEP_INFO_STEP]; 58$checked = ""; 59 60error_report_check( $_GET ); 61 62print"<div align='center'>"; 63print"<span class='required'>*</span> <span class='print'>" . lang_get('must_complete_field') . "</span>". NEWLINE; 64print"<table class='width100'>". NEWLINE; 65print"<tr>". NEWLINE; 66print"<td>". NEWLINE; 67 68 69 print"<form method=post name='test_step_add' action=$test_step_edit_page>". NEWLINE; 70 print"<input type='hidden' name='test_step_id' value='$test_step_id'>"; 71 //print"<td><input type='hidden' name='test_version_id' value='$test_version_id'></td>"; 72 73 print"<table class='inner'>". NEWLINE; 74 75 print"<tr>". NEWLINE; 76 print"<td colspan=2 align=left class='form-lbl-l'>". lang_get('step') ." $step</td>". NEWLINE; 77 print"</tr>"; 78 79 $test_step_tbl = TEST_STEP_TBL; 80 $f_test_id = TEST_STEP_TEST_ID; 81 $f_test_step_no = TEST_STEP_NO; 82 83 # MOVE STEP 84 print"<tr>". NEWLINE; 85 print"<td class='form-lbl-r'>". lang_get('move_step') ."</td>". NEWLINE; 86 print"<td align=left>". NEWLINE; 87 print"<select name='location'>". NEWLINE; 88 print"<option value='none'></option>". NEWLINE; 89 print"<option value='end'>At end of table</option>". NEWLINE; 90 $q = "SELECT * FROM $test_step_tbl WHERE $f_test_id = '$test_id' ORDER BY $f_test_step_no"; 91 $rs = db_query( $db, $q ); 92 while($rw = db_fetch_row( $db, $rs ) ){ 93 print"<option value=$rw[$f_test_step_no]>After Step $rw[$f_test_step_no]</option>". NEWLINE; 94 } 95 print"</select>". NEWLINE; 96 print"</td>". NEWLINE; 97 print"</tr>"; 98 99 # INFO STEP 100 print"<tr>". NEWLINE; 101 print"<td class='form-lbl-r'>". lang_get('info_step') ."</td>". NEWLINE; 102 if( $info_step=="Y" ) { 103 $checked = "checked"; 104 } 105 print"<td align=left><input type=checkbox name=info_step $checked></td>"; 106 print"</tr>"; 107 108 # ACTION 109 $action = session_validate_form_get_field("step_action_required", $action, session_use_FCKeditor()); 110 print"<tr>"; 111 print"<td class='form-lbl-r'>". lang_get('step_action') ." <span class='required'>*</span></td>". NEWLINE; 112 print"<td align=left>"; 113 html_FCKeditor("step_action_required", 600, 200, $action); 114 print"</td>". NEWLINE; 115 print"</tr>"; 116 117 # INPUTS 118 $inputs = session_validate_form_get_field("step_inputs_required", $inputs, session_use_FCKeditor()); 119 print"<tr>"; 120 print"<td class='form-lbl-r'>". lang_get('test_inputs') ."</td>". NEWLINE; 121 print"<td align=left>"; 122 html_FCKeditor("step_input", 600, 200, $inputs); 123 print"</td>". NEWLINE; 124 print"</tr>"; 125 126 # EXPTECTED RESULT 127 $expected_result = session_validate_form_get_field("step_expected_required", $expected, session_use_FCKeditor()); 128 print"<tr>"; 129 print"<td class='form-lbl-r'>". lang_get('step_expected') ." <span class='required'>*</span></td>". NEWLINE; 130 print"<td align=left>"; 131 html_FCKeditor("step_expected_required", 600, 200, $expected_result); 132 print"</td>". NEWLINE; 133 print"</tr>". NEWLINE; 134 135 print"<tr>". NEWLINE; 136 print"<td><input type='hidden' name='test_id' value='$test_id'></td>". NEWLINE; 137 print"</tr>". NEWLINE; 138 139 util_add_spacer(); 140 141 # SUBMIT BUTTON 142 print"<tr>". NEWLINE; 143 print"<td colspan='3' class=center><input type='submit' value='". lang_get('edit_step') ."'></td>". NEWLINE; 144 print"</tr>". NEWLINE; 145 146 util_add_spacer(); 147 148 print"</table>". NEWLINE; 149 print"</form>". NEWLINE; 150 151print"</td>". NEWLINE; 152print"</tr>". NEWLINE; 153print"</table>". NEWLINE; 154print"</div>"; 155 156# --------------------------------------------------------------------- 157# $Log: test_step_edit_page.php,v $ 158# Revision 1.5 2007/03/14 17:23:44 gth2 159# removing Test Input as a required field so that it's consistent witth the 160# test detail page. - gth 161# 162# Revision 1.4 2006/08/05 22:09:13 gth2 163# adding NEWLINE constant to support multiple OS newline chars - gth 164# 165# Revision 1.3 2006/06/24 14:34:14 gth2 166# updating changes lost with cvs problem. 167# 168# Revision 1.2 2005/12/05 15:35:29 gth2 169# Info Step check box was not checked when editing a step - gth 170# 171# Revision 1.1.1.1 2005/11/30 23:00:58 gth2 172# importing initial version - gth 173# 174# --------------------------------------------------------------------- 175 176?>