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# Project Archive Tests Page
10#
11# $RCSfile: project_archive_tests_page.php,v $  $Revision: 1.5 $
12# ------------------------------------
13
14if( isset($_POST['submit_button']) ) {
15
16	require_once("project_archive_tests_action.php");
17	exit;
18}
19
20include"./api/include_api.php";
21auth_authenticate_user();
22
23$page           		= basename(__FILE__);
24$s_project_properties   = session_get_project_properties();
25$project_name           = $s_project_properties['project_name'];
26$project_id 			= $s_project_properties['project_id'];
27$s_user_properties		= session_get_user_properties();
28$user_id				= $s_user_properties['user_id'];
29$row_style              = '';
30
31$records				= '';
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$selected_project_properties 	= session_set_display_options("project_archive_tests", $_POST);
38$order_by 						= $selected_project_properties['order_by'];
39$order_dir 						= $selected_project_properties['order_dir'];
40$page_number					= $selected_project_properties['page_number'];
41
42session_records(	"archive_tests",
43					admin_get_archived_tests($project_id) );
44
45html_window_title();
46html_print_body();
47html_page_title(project_get_name($selected_project_id) ." - ". lang_get('archive_tests_page') );
48html_page_header( $db, $project_name );
49html_print_menu();
50admin_menu_print( $page, $project_id, $user_id );
51
52
53
54html_project_manage_menu();
55html_project_manage_tests_menu();
56
57if( !user_has_rights( $selected_project_id, $user_id, MANAGER ) ) {
58	print"<div align=center>";
59	error_report_display_msg( NO_RIGHTS_TO_VIEW_PAGE );
60	print"</div>";
61	exit;
62}
63
64error_report_check( $_GET );
65
66print"<div align=center>". NEWLINE;
67print"<form action='project_archive_tests_page.php' method=post>". NEWLINE;
68print"<br>". NEWLINE;
69
70	print"<table class=hide80>". NEWLINE;
71	print"<tr>". NEWLINE;
72	print"<td>". NEWLINE;
73	$row = admin_get_tests(	$selected_project_id, $page_number, $order_by, $order_dir );
74	print"<input type=hidden name='order_dir' value='$order_dir'>";
75	print"<input type=hidden name='order_by' value='$order_by'>";
76	print"</td>". NEWLINE;
77	print"</tr>". NEWLINE;
78	print"</table>". NEWLINE;
79
80########################################################################################
81#
82
83if( empty($row) ) {
84
85	print lang_get('no_archive_tests');
86} else {
87	//print"<form action='project_archive_tests_page.php' method=post>". NEWLINE;
88	print"<input type=hidden name=project_id value=$selected_project_id>";
89
90	print"<table id='sortabletable' class='sortable' rules=cols>". NEWLINE;
91	print"<thead>".NEWLINE;
92	print"<tr>". NEWLINE;
93	#html_tbl_print_header( lang_get('man_auto') );
94	#html_tbl_print_header( lang_get('test_name'), TEST_NAME, 			$order_by, $order_dir );
95	#html_tbl_print_header( lang_get('testtype'), TEST_TESTTYPE, 		$order_by, $order_dir );
96	#html_tbl_print_header( lang_get('area_tested'), TEST_AREA_TESTED, 	$order_by, $order_dir );
97	#html_tbl_print_header( lang_get('status'), TEST_STATUS, 			$order_by, $order_dir );
98	#html_tbl_print_header( lang_get('archive') );
99
100	html_tbl_print_header_not_sortable( lang_get('man_auto') );
101	html_tbl_print_header( lang_get('test_name') );
102	html_tbl_print_header( lang_get('testtype') );
103	html_tbl_print_header( lang_get('area_tested') );
104	html_tbl_print_header( lang_get('status') );
105	html_tbl_print_header_not_sortable( lang_get('archive') );
106	print"</tr>". NEWLINE;
107	print"</thead>".NEWLINE;
108	print"<tbody>".NEWLINE;
109	foreach($row as $test_row) {
110		#$row_style = html_tbl_alternate_bgcolor($row_style);
111		#print"<tr class='$row_style'>". NEWLINE;
112		print"<tr>". NEWLINE;
113		print"<td>".html_print_testtype_icon($test_row[TEST_MANUAL], $test_row[TEST_AUTOMATED])."</td>". NEWLINE;
114		print"<td>".$test_row[TEST_NAME]."</td>". NEWLINE;
115		print"<td>".$test_row[TEST_TESTTYPE]."</td>". NEWLINE;
116		print"<td>".$test_row[TEST_AREA_TESTED]."</td>". NEWLINE;
117		print"<td>".$test_row[TEST_STATUS]."</td>". NEWLINE;
118
119		if( session_records_ischecked("archive_tests", $test_row[TEST_ID]) ) {
120			$checked = "checked";
121		} else {
122			$checked = "";
123		}
124
125		if( empty($records) ) {
126			$records = $test_row[TEST_ID]." => ''";
127		} else {
128			$records .= ", ".$test_row[TEST_ID]." => ''";
129		}
130
131		print"<td><input type=checkbox name=row_".$test_row[TEST_ID]." $checked></td>". NEWLINE;
132		print"</tr>". NEWLINE;
133	}
134	print"</tbody>".NEWLINE;
135	print"</table>". NEWLINE;
136
137	print"<br>". NEWLINE;
138	print"<input type=hidden name=records value=\"$records\">". NEWLINE;
139	print"<input type='hidden' name='record_groups' value=\"\">". NEWLINE;
140
141	print"<input type=submit name=submit_button value='".lang_get("archive")."'>". NEWLINE;
142
143}
144print"</form>". NEWLINE;
145print"</div>". NEWLINE;
146
147html_print_footer();
148
149?>