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# $RCSfile: bug_page.php,v $ $Revision: 1.4 $
10# ------------------------------------
11
12if( isset($_POST['mass_update_btn']) ) {
13
14	require_once("bug_group_action_page.php");
15	exit;
16}
17
18include"./api/include_api.php";
19auth_authenticate_user();
20
21$page                   = basename(__FILE__);
22$action_page            = 'test_action.php';
23$detail_page			= 'bug_detail_page.php';
24$bug_update_url			= 'bug_detail_update_page.php';
25$num                    = 0;
26$bg_color               = '';
27$project_properties     = session_get_project_properties();
28$project_name			= $project_properties['project_name'];
29$project_id				= $project_properties['project_id'];
30
31if( isset($_POST['filter_jump'] )  && $_POST['filter_jump'] != '' ) {
32	html_redirect( "$detail_page?bug_id=$_POST[filter_jump]" );
33}
34else {
35	$filter_jump="";
36}
37
38$s_display_options 		= session_set_display_options("bug", $_POST);
39$order_by				= $s_display_options['order_by'];
40$order_dir				= $s_display_options['order_dir'];
41$page_number			= $s_display_options['page_number'];
42
43$filter_per_page		= $s_display_options['filter']['per_page'];
44$filter_bug_status		= $s_display_options['filter']['status'];
45$filter_bug_category	= $s_display_options['filter']['category'];
46$filter_bug_component	= $s_display_options['filter']['component'];
47$filter_reported_by		= $s_display_options['filter']['reported_by'];
48$filter_assigned_to		= $s_display_options['filter']['assigned_to'];
49$filter_assigned_to_dev	= $s_display_options['filter']['assigned_to_developer'];
50$filter_found_in_rel	= $s_display_options['filter']['found_in_release'];
51$filter_assigned_to_rel	= $s_display_options['filter']['assigned_to_release'];
52$filter_view_closed		= $s_display_options['filter']['view_closed'];
53$filter_search			= $s_display_options['filter']['bug_search'];
54
55
56/*
57print"filter_per_page = $filter_per_page<br>";
58print"filter_bug_status = $filter_bug_status<br>";
59print"filter_bug_category = $filter_bug_category<br>";
60print"filter_bug_component = $filter_bug_component<br>";
61print"filter_reported_by = $filter_reported_by<br>";
62print"filter_assigned_to = $filter_assigned_to<br>";
63print"filter_assigned_to_dev = $filter_assigned_to_dev<br>";
64print"filter_found_in_rel = $filter_found_in_rel<br>";
65print"filter_assigned_to_rel = $filter_assigned_to_rel<br>";
66print"filter_view_closed = $filter_view_closed<br>";
67print"filter_search = $filter_search<br>";
68*/
69
70
71html_window_title();
72html_print_body();
73html_page_title( $project_name ." - ". lang_get('bug_page') );
74html_page_header( $db, $project_name );
75html_print_menu();
76bug_menu_print( $page );
77
78error_report_check( $_GET );
79
80print"<br>";
81print"<form method='post' action='$page' name='bug_form'>". NEWLINE;
82print"<div align=center>". NEWLINE;
83
84html_print_bug_filter(	$project_id,
85						$filter_bug_status,
86						$filter_bug_category,
87						$filter_bug_component,
88						$filter_reported_by,
89						$filter_assigned_to,
90						$filter_assigned_to_dev,
91						$filter_found_in_rel,
92						$filter_assigned_to_rel,
93						$filter_per_page,
94						$filter_view_closed,
95						$filter_search,
96						$filter_jump);
97
98
99print"<br>". NEWLINE;
100
101$g_timer->mark_time( "Load rows to display on page from db into memory" );
102
103
104
105$row = bug_get( $project_id,
106				$page_number,
107				$order_by,
108				$order_dir,
109				$filter_bug_status,
110				$filter_bug_category,
111				$filter_bug_component,
112				$filter_reported_by,
113				$filter_assigned_to,
114				$filter_assigned_to_dev,
115				$filter_found_in_rel,
116				$filter_assigned_to_rel,
117				$filter_per_page,
118				$filter_view_closed,
119				$filter_search,
120				$filter_jump,
121				$csv_export="bugs");
122
123
124print"</div>". NEWLINE;
125
126$g_timer->mark_time( "Finished load rows to display on page from db into memory" );
127if( $row ) {
128	print"<div align=center>". NEWLINE;
129
130	print"<table class=width100 rules=cols>". NEWLINE;
131
132	print"<tr class=tbl_header>". NEWLINE;
133	print"<th></th>". NEWLINE;
134	print"<th></th>". NEWLINE;
135	html_tbl_print_header( lang_get('bug_id'), BUG_ID, $order_by, $order_dir );
136	html_tbl_print_header( lang_get('bug_priority'), BUG_PRIORITY,	$order_by, $order_dir );
137	html_tbl_print_header( lang_get('bug_status'), BUG_STATUS, $order_by, $order_dir );
138	html_tbl_print_header( lang_get('bug_category'), BUG_CATEGORY, $order_by, $order_dir  );
139	html_tbl_print_header( lang_get('reported_by'),	BUG_REPORTER, $order_by, $order_dir );
140	html_tbl_print_header( lang_get('assigned_to'),	BUG_ASSIGNED_TO, $order_by, $order_dir );
141	#html_tbl_print_header( lang_get('found_in_release'), BUG_FOUND_IN_RELEASE,	$order_by, $order_dir );
142	#html_tbl_print_header( lang_get('assigned_to_release'), BUG_ASSIGN_TO_RELEASE, $order_by, $order_dir );
143	html_tbl_print_header( lang_get('bug_summary') );
144	print"</tr>". NEWLINE;
145	$g_timer->mark_time( "Outputting main html table to browser" );
146
147	$row_style = '';
148
149	foreach( $row as $row_bug_detail ) {
150
151		$bug_id				= $row_bug_detail[BUG_ID];
152		$priority			= $row_bug_detail[BUG_PRIORITY];
153		$bug_status			= $row_bug_detail[BUG_STATUS];
154		$category			= $row_bug_detail[CATEGORY_NAME];
155		$component			= $row_bug_detail[COMPONENT_NAME];
156		$reported_by	    = $row_bug_detail[BUG_REPORTER];
157		$reported_date		= $row_bug_detail[BUG_REPORTED_DATE];
158		$assigned_to		= $row_bug_detail[BUG_ASSIGNED_TO];
159		$found_in_release   = $row_bug_detail[BUG_FOUND_IN_RELEASE];
160		$assign_to_release  = $row_bug_detail[BUG_ASSIGN_TO_RELEASE];
161		$discovery_period	= $row_bug_detail[BUG_DISCOVERY_PERIOD];
162		$summary			= $row_bug_detail[BUG_SUMMARY];
163
164
165		$display_bug_id = util_pad_id($bug_id);
166
167		#$filename = test_get_filename($bug_id);
168
169		$row_style = html_tbl_alternate_bgcolor($row_style);
170		print"<tr class='$row_style'>". NEWLINE;
171		print"<td><input type='checkbox' name='row_bug_arr[{$bug_id}]'></td>". NEWLINE;
172		print"<td class='tbl-c'><a href='$bug_update_url?bug_id=$bug_id'><img src='".IMG_SRC."update.gif' title='". lang_get('update_bug') ."' border=0></a></td>". NEWLINE;
173
174		//$detail_url = $detail_page ."?bug_id=". $bug_id ."&test_version_id=". $test_version_id;
175		$detail_url = $detail_page ."?bug_id=". $bug_id;
176
177		print"<td class='tbl-c'><a href='$detail_url' title='". lang_get('bug_view_detail') ."'>$display_bug_id</a></td>". NEWLINE;
178		print"<td class='tbl-c'>$priority</td>". NEWLINE;
179		print"<td class='tbl-c'>$bug_status</td>". NEWLINE;
180		print"<td class='tbl-c'>$category</td>". NEWLINE;
181		print"<td class='tbl-c'>$reported_by</td>". NEWLINE;
182		print"<td class='tbl-c'>$assigned_to</td>". NEWLINE;
183		#print"<td class='tbl-c'>$found_in_release</td>". NEWLINE;
184		#print"<td class='tbl-c'>$assign_to_release</td>". NEWLINE;
185		print"<td class='tbl-c' width='35%'>$summary</td>". NEWLINE;
186		print"</tr>". NEWLINE;
187	}
188
189	$g_timer->mark_time( "Finished outputting main html table to browser" );
190
191	print"</table>". NEWLINE;
192	print"</div>". NEWLINE;
193
194
195	if( session_use_javascript() ) {
196		//print"<input type=checkbox name=all_tests value=all onClick=checkall('bug_form', this.form.all_tests.checked)\">Select All&nbsp;&nbsp;";
197		print"<input id=select_all type=checkbox onClick='checkAll( this )'>". NEWLINE;
198		print"<label for=select_all>".lang_get("select_all")."</label>". NEWLINE;
199	}
200	print"<select name=action>";
201	print"<option value=bug_status>". lang_get('bug_status') ."</option>";
202	print"<option value=assign_to>". lang_get('assign_to') ."</option>";
203	print"<option value=assign_to_dev>". lang_get('assign_to_developer') ."</option>";
204	print"<option value=bug_more>". lang_get('bug_move') ."</option>";
205	print"</select>";
206	print"&nbsp;";
207	print"<input type=submit name=mass_update_btn value='".lang_get("update")."'>";
208
209} else {
210
211	html_no_records_found_message( lang_get('no_tests') );
212}
213
214print"</form>". NEWLINE;
215
216html_print_footer();
217
218# ------------------------------------
219# $Log: bug_page.php,v $
220# Revision 1.4  2007/02/25 23:17:39  gth2
221# fixing bugs for release 1.6.1 - gth
222#
223# Revision 1.3  2006/08/05 22:07:59  gth2
224# adding NEWLINE constant to support multiple OS newline chars - gth
225#
226# Revision 1.2  2006/02/24 11:38:20  gth2
227# update to div - class=div-c not working in firefox - gth
228#
229# Revision 1.1.1.1  2005/11/30 23:00:56  gth2
230# importing initial version - gth
231#
232# ------------------------------------
233
234?>
235