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 Page
10#
11# $RCSfile: test_page.php,v $  $Revision: 1.10 $
12# ---------------------------------------------------------------------
13
14if( isset($_POST['mass_update_btn']) ) {
15
16	require_once("test_group_action_page.php");
17	exit;
18}
19
20include"./api/include_api.php";
21auth_authenticate_user();
22
23$page                   = basename(__FILE__);
24$action_page            = 'test_action.php';
25$detail_page			= 'test_detail_page.php';
26$test_update_url		= 'test_detail_update_page.php';
27$num                    = 0;
28$bg_color               = '';
29$project_properties     = session_get_project_properties();
30$project_name           = $project_properties['project_name'];
31$project_id				= $project_properties['project_id'];
32
33
34$s_display_options 		= session_set_display_options("test", $_POST);
35$order_by				= $s_display_options['order_by'];
36$order_dir				= $s_display_options['order_dir'];
37$page_number			= $s_display_options['page_number'];
38
39$filter_per_page		= $s_display_options['filter']['per_page'];
40$filter_manual_auto		= $s_display_options['filter']['manual_auto'];
41$filter_test_type		= $s_display_options['filter']['test_type'];
42$filter_ba_owner		= $s_display_options['filter']['ba_owner'];
43$filter_qa_owner		= $s_display_options['filter']['qa_owner'];
44$filter_tester			= $s_display_options['filter']['tester'];
45$filter_area_tested		= $s_display_options['filter']['area_tested'];
46$filter_test_status		= $s_display_options['filter']['test_status'];
47$filter_priority		= $s_display_options['filter']['priority'];
48$filter_search			= $s_display_options['filter']['test_search'];
49
50html_window_title();
51html_print_body();
52html_page_title($project_name ." - ". lang_get('test_page') );
53html_page_header( $db, $project_name );
54html_print_menu();
55test_menu_print ($page);
56
57error_report_check( $_GET );
58
59print"<br>";
60
61print"<form method='post' action='$page' name='tests_form' id='form_order'>". NEWLINE;
62
63print"<div align=center>". NEWLINE;
64
65html_print_tests_filter(	$project_id,
66							$filter_manual_auto,
67							$filter_test_type,
68							$filter_ba_owner,
69							$filter_qa_owner,
70							$filter_tester,
71							$filter_area_tested,
72							$filter_test_status,
73							$filter_priority,
74							$filter_per_page,
75							$filter_search);
76
77print"<br>". NEWLINE;
78
79$g_timer->mark_time( "Load rows to display on page from db into memory" );
80
81$row = test_filter_rows(	$project_id,
82							$filter_manual_auto,
83							$filter_ba_owner,
84							$filter_qa_owner,
85							$filter_tester,
86							$filter_test_type,
87							$filter_area_tested,
88							$filter_test_status,
89							$filter_priority,
90							$filter_per_page,
91							$filter_search,
92							$order_by,
93							$order_dir,
94							$page_number,
95							$csv_name="tests");
96
97print"</div>". NEWLINE;
98
99$g_timer->mark_time( "Finished load rows to display on page from db into memory" );
100if( $row ) {
101	print"<div align=center>". NEWLINE;
102
103	#print"<table id='sortabletable' class='sortable' rules=cols>". NEWLINE;
104	print"<table class='sortable' rules=cols>". NEWLINE;
105	print"<thead>".NEWLINE;
106	print"<tr class=tbl_header>". NEWLINE;
107	print"<th class='unsortable'></th>". NEWLINE;
108	print"<th class='unsortable'></th>". NEWLINE;
109	# html_tbl_print_header( lang_get('test_id'),		TEST_ID,			$order_by, $order_dir );
110	# html_tbl_print_header( lang_get('man_auto') );
111	# html_tbl_print_header( lang_get('file_type') );
112	# html_tbl_print_header( lang_get('autopass'),	TEST_AUTO_PASS,		$order_by, $order_dir );
113	# html_tbl_print_header( lang_get('test_name'),	TEST_NAME,			$order_by, $order_dir );
114	# html_tbl_print_header( lang_get('ba_owner'), 	TEST_BA_OWNER,		$order_by, $order_dir );
115	# html_tbl_print_header( lang_get('qa_owner'), 	TEST_QA_OWNER,		$order_by, $order_dir );
116	# html_tbl_print_header( lang_get('tester'),		TEST_TESTER,		$order_by, $order_dir );
117	# html_tbl_print_header( lang_get('testtype'), 	TEST_TESTTYPE,		$order_by, $order_dir );
118	# html_tbl_print_header( lang_get('area_tested'), TEST_AREA_TESTED,	$order_by, $order_dir );
119	# html_tbl_print_header( lang_get('test_status'), TEST_STATUS,		$order_by, $order_dir );
120	# html_tbl_print_header( lang_get('priority'),    TEST_PRIORITY,	    $order_by, $order_dir );
121
122	html_tbl_print_sortable_header( lang_get('test_id'),TEST_ID,$order_by,$order_dir );
123	html_tbl_print_sortable_header( lang_get('man_auto') );
124	html_tbl_print_sortable_header( lang_get('file_type') );
125	html_tbl_print_sortable_header( lang_get('autopass'),TEST_AUTO_PASS,$order_by,$order_dir );
126	html_tbl_print_sortable_header( lang_get('test_name'),TEST_NAME,$order_by,$order_dir );
127	html_tbl_print_sortable_header( lang_get('ba_owner'),TEST_BA_OWNER,$order_by,$order_dir );
128	html_tbl_print_sortable_header( lang_get('qa_owner'),TEST_QA_OWNER,$order_by,$order_dir );
129	html_tbl_print_sortable_header( lang_get('tester'),TEST_TESTER,$order_by,$order_dir );
130	html_tbl_print_sortable_header( lang_get('testtype'),TEST_TESTTYPE,$order_by,$order_dir );
131	html_tbl_print_sortable_header( lang_get('area_tested'),TEST_AREA_TESTED,$order_by,$order_dir );
132	html_tbl_print_sortable_header( lang_get('test_status'),TEST_STATUS,$order_by,$order_dir );
133	html_tbl_print_sortable_header( lang_get('priority'),TEST_PRIORITY,$order_by,$order_dir );
134	print"</tr>". NEWLINE;
135
136	$g_timer->mark_time( "Outputting main html table to browser" );
137
138	$row_style = '';
139	print"</thead>".NEWLINE;
140	print"<tbody>".NEWLINE;
141	foreach( $row as $row_test_detail ) {
142
143		$test_id         = $row_test_detail[TEST_ID];
144		//$test_version_id = $row_test_detail[TEST_VERS_ID];
145		$test_name       = $row_test_detail[TEST_NAME];
146		$ba_owner        = $row_test_detail[TEST_BA_OWNER];
147		$qa_owner        = $row_test_detail[TEST_QA_OWNER];
148		$tester			 = $row_test_detail[TEST_TESTER];
149		$test_type       = $row_test_detail[TEST_TESTTYPE];
150		$manual          = $row_test_detail[TEST_MANUAL];
151		$automated       = $row_test_detail[TEST_AUTOMATED];
152		$area_tested     = $row_test_detail[TEST_AREA_TESTED];
153		$autopass        = $row_test_detail[TEST_AUTO_PASS];
154		$test_status     = $row_test_detail[TEST_STATUS];
155		$priority		 = $row_test_detail[TEST_PRIORITY];
156
157		$display_test_id = util_pad_id($test_id);
158
159		if($row_test_detail[TEST_AUTO_PASS]=="Y") {
160
161			$autopass = "Yes";
162		} else {
163
164			$autopass = "No";
165		}
166
167		$filename = test_get_filename($test_id);
168
169		#$row_style = html_tbl_alternate_bgcolor($row_style);
170		#print"<tr class='$row_style'>". NEWLINE;
171		$row_style =html_tbl_alternate_bgcolor($row_style);
172		print"<tr class='$row_style'>". NEWLINE;
173		print"<td><input type='checkbox' name='row_test_arr[{$test_id}]'></td>". NEWLINE;
174		print"<td class='tbl-c'><a href='$test_update_url?test_id=$test_id'><img src='".IMG_SRC."update.gif' title='". lang_get('update_test') ."' border=0></a></td>". NEWLINE;
175
176		//$detail_url = $detail_page ."?test_id=". $test_id ."&test_version_id=". $test_version_id;
177		$detail_url = $detail_page ."?test_id=". $test_id ."&project_id=". $project_id;
178
179		print"<td class='tbl-c'><a href='$detail_url' title='". lang_get('test_view_detail') ."'>$display_test_id</a></td>". NEWLINE;
180		print"<td class='tbl-c'>".html_print_testtype_icon( $manual, $automated )."</td>". NEWLINE;
181		print"<td class='tbl-c'>".html_file_type( $filename )."</td>". NEWLINE;
182		print"<td class='tbl-l'>$autopass</td>". NEWLINE;
183		print"<td class='tbl-l'>$test_name</td>". NEWLINE;
184		print"<td class='tbl-l'>$ba_owner</td>". NEWLINE;
185		print"<td class='tbl-l'>$qa_owner</td>". NEWLINE;
186		print"<td class='tbl-l'>$tester</td>". NEWLINE;
187		print"<td class='tbl-l'>$test_type</td>". NEWLINE;
188		print"<td class='tbl-l'>$area_tested</td>". NEWLINE;
189		print"<td class='tbl-l'>$test_status</td>". NEWLINE;
190		print"<td class='tbl-l'>$priority</td>". NEWLINE;
191		print"</tr>". NEWLINE;
192	}
193
194	$g_timer->mark_time( "Finished outputting main html table to browser" );
195
196	print"</tbody>".NEWLINE;
197	print"</table>". NEWLINE;
198	print"</div>". NEWLINE;
199
200
201	if( session_use_javascript() ) {
202		//print"<input type=checkbox name=all_tests value=all onClick=checkall('tests_form', this.form.all_tests.checked)\">Select All&nbsp;&nbsp;";
203		print"<input id=select_all type=checkbox onClick='checkAll( this )'>". NEWLINE;
204		print"<label for=select_all>".lang_get("select_all")."</label>". NEWLINE;
205	}
206	print"<select name=action>";
207	print"<option value=man_auto>". lang_get('man_auto') ."</option>";
208	print"<option value=ba_owner>". lang_get('ba_owner') ."</option>";
209	print"<option value=qa_owner>". lang_get('qa_owner') ."</option>";
210	print"<option value=tester>". lang_get('tester') ."</option>";
211	print"<option value=test_status>". lang_get('test_status') ."</option>";
212	print"<option value=test_priority>". lang_get('priority') ."</option>";
213	print"<option value=auto_pass>". lang_get('autopass') ."</option>";
214	print"<option value=test_type>". lang_get('testtype') ."</option>";
215	print"<option value=area_tested>". lang_get('area_tested') ."</option>";
216	print"<option value=email_ba_owner>". lang_get('email_ba_owner') ."</option>";
217	print"<option value=email_qa_owner>". lang_get('email_qa_owner') ."</option>";
218	print"</select>";
219	print"&nbsp;";
220	print"<input type=submit name=mass_update_btn value='".lang_get("update")."'>";
221
222} else {
223
224	html_no_records_found_message( lang_get('no_tests') );
225}
226
227print"</form>". NEWLINE;
228
229html_print_footer();
230
231# ---------------------------------------------------------------------
232# $Log: test_page.php,v $
233# Revision 1.10  2008/08/04 06:54:58  peter_thal
234# added sorting function to several tables
235#
236# Revision 1.9  2008/07/09 07:13:26  peter_thal
237# added direct linking of test detail by adding project_id link parameter
238# added automated project switching if necessary
239#
240# Revision 1.8  2008/01/22 08:19:15  cryobean
241# bugfixes
242#
243# Revision 1.7  2007/11/19 08:59:00  cryobean
244# bugfixes
245#
246# Revision 1.6  2007/11/15 12:58:48  cryobean
247# bugfixes
248#
249# Revision 1.5  2007/02/12 07:16:35  gth2
250# adding email functionality on test update - gth
251#
252# Revision 1.4  2007/02/03 10:26:19  gth2
253# no message
254#
255# Revision 1.3  2006/08/05 22:09:13  gth2
256# adding NEWLINE constant to support multiple OS newline chars - gth
257#
258# Revision 1.2  2006/02/24 11:36:04  gth2
259# update to div - class=div-c not working in firefox - gth
260#
261# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
262# importing initial version - gth
263#
264# ---------------------------------------------------------------------
265
266?>