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# Manage Project Page
10#
11# $RCSfile: project_manage_reqareacovered_page.php,v $ $Revision: 1.4 $
12# ------------------------------------
13
14include"./api/include_api.php";
15auth_authenticate_user();
16
17$page                   = basename(__FILE__);
18$project_manage_page	= 'project_manage_page.php';
19$project_add_page     	= 'project_add_page.php';
20$project_edit_page		= 'project_edit_page.php';
21$user_manage_page		= 'user_manage_page.php';
22$user_add_page			= 'user_add_page.php';
23$project_manage_action	= 'project_manage_action.php';
24$add_action_page		= 'project_add_reqareacovered_action.php';
25$delete_page			= 'delete_page.php';
26
27$s_project_properties   = session_get_project_properties();
28$project_name           = $s_project_properties['project_name'];
29$project_id 			= $s_project_properties['project_id'];
30
31$s_user_properties		= session_get_user_properties();
32$user_id				= $s_user_properties['user_id'];
33
34session_set_properties("project_manage", $_GET);
35$selected_project_properties 	= session_get_properties("project_manage");
36$selected_project_id 			= $selected_project_properties['project_id'];
37
38$project_manager		= user_has_rights( $selected_project_id, $user_id, MANAGER );
39
40$redirect_url			= $page ."?project_id=". $selected_project_id;
41
42$s_user_properties		= session_get_user_properties();
43$user_id				= $s_user_properties['user_id'];
44$row_style              = '';
45
46
47$order_by 		= REQ_AREA_COVERAGE;
48$order_dir		= "ASC";
49$page_number	= 1;
50
51util_set_order_by($order_by, $_GET);
52util_set_order_dir($order_dir, $_GET);
53util_set_page_number($page_number, $_GET);
54
55util_set_order_by($order_by, $_POST);
56util_set_order_dir($order_dir, $_POST);
57util_set_page_number($page_number, $_POST);
58
59html_window_title();
60html_print_body();
61html_page_title(project_get_name($selected_project_id) ." - ". lang_get('manage_project_page') );
62html_page_header( $db, $project_name );
63html_print_menu();
64admin_menu_print( $page, $project_id, $user_id );
65
66html_project_manage_menu();
67html_project_manage_reqs_menu();
68
69
70error_report_check( $_GET );
71
72$project_details = project_get_details( $selected_project_id );
73print"<div align=center>". NEWLINE;
74
75print"<br>". NEWLINE;
76
77if( !empty( $project_details ) ) {
78
79	$project_id						= $project_details[PROJ_ID];
80	$project_name					= $project_details[PROJ_NAME];
81	$project_status					= $project_details[PROJ_STATUS];
82	$project_description			= $project_details[PROJ_DESCRIPTION];
83
84	####################################################################################
85	# Required Area Covered
86	# ----------------------------------------------------------------------------------
87
88	# ----------------------------------------------------------------------------------
89	# Required Area Covered Form
90	# ----------------------------------------------------------------------------------
91	if( $project_manager ) {
92		print"<form method=post action=$add_action_page>". NEWLINE;
93		print"<span class='required'>*</span><span class='print'>" . lang_get('must_complete_field') . "</span>". NEWLINE;
94		print"<table class='width70'>". NEWLINE;
95		print"<tr>". NEWLINE;
96		print"<td>". NEWLINE;
97		print"<table class=inner>". NEWLINE;
98		print"<tr>". NEWLINE;
99		print"<td class=form-header-l>".lang_get('add_req_area_covered')."</td>". NEWLINE;
100		print"</tr>". NEWLINE;
101		print"<tr>". NEWLINE;
102  	 	print"<td class='form-lbl-c'>". lang_get('req_area_covered') ." <span class='required'>*</span>". NEWLINE;
103   		print"<input type=text size=60 maxlength=50 name='req_area_covered_required' value='".session_validate_form_get_field( 'req_area_covered_required' )."'>". NEWLINE;
104		print"&nbsp;<input type=submit name='new_area_tested' value='".lang_get("add")."'>";
105		print"</td>". NEWLINE;
106		print"</tr>". NEWLINE;
107		print"</table>". NEWLINE;
108		print"</td>". NEWLINE;
109		print"</tr>". NEWLINE;
110		print"</table>". NEWLINE;
111		print"</form>". NEWLINE;
112	}
113
114	# ----------------------------------------------------------------------------------
115	# Required Area Covered	 Table
116	# ----------------------------------------------------------------------------------
117	print"<br>". NEWLINE;
118    print"<form method=post action='$page?order_by=$order_by&amp;order_dir=$order_dir'>". NEWLINE;
119	print"<table class=hide70>". NEWLINE;
120	print"<tr>". NEWLINE;
121	print"<td>". NEWLINE;
122	$rows_req_areas_covered = project_get_req_areas_covered($selected_project_id, $order_by, $order_dir, $page_number);
123	print"</td>". NEWLINE;
124	print"</tr>". NEWLINE;
125	print"</table>". NEWLINE;
126	print"</form>". NEWLINE;
127
128	if( $rows_req_areas_covered ) {
129		print"<table id='sortabletable' class='sortable' rules=cols>". NEWLINE;
130		print"<thead>".NEWLINE;
131		print"<tr>". NEWLINE;
132		html_tbl_print_header( lang_get('req_area_covered') );
133		if( $project_manager ) {
134			html_tbl_print_header_not_sortable( lang_get('edit') );
135			html_tbl_print_header_not_sortable( lang_get('delete') );
136		}
137		print"\n</tr>". NEWLINE;
138		print"</thead>".NEWLINE;
139		print"<tbody>".NEWLINE;
140
141		foreach($rows_req_areas_covered as $row_req_area_covered) {
142			$id		= $row_req_area_covered[REQ_AREA_COVERAGE_ID];
143			$name 	= $row_req_area_covered[REQ_AREA_COVERAGE];
144
145			#$row_style = html_tbl_alternate_bgcolor($row_style);
146			#print"<tr class='$row_style'>". NEWLINE;
147
148			print"<tr>". NEWLINE;
149			print"<td>$name</td>". NEWLINE;
150			if( $project_manager ) {
151				print"<td><a href='project_edit_reqareacovered_page.php?req_area_covered_id=$id'>".lang_get("edit")."</a></td>". NEWLINE;
152				print"<td>". NEWLINE;
153				print"<form name='remove_req_area_covered' method=post action='$delete_page'>". NEWLINE;
154				print"<input type='submit' name='delete_req_area_covered' value='". lang_get( 'delete' ) ."' class='page-numbers'>". NEWLINE;
155				print"<input type='hidden' name='r_page' value='$redirect_url#req_area_covered'>". NEWLINE;
156				print"<input type='hidden' name='f' value='remove_req_area_covered_from_project'>". NEWLINE;
157				print"<input type='hidden' name='id' value='$id'>". NEWLINE;
158				print"<input type='hidden' name='project_id' value='$selected_project_id'>". NEWLINE;
159				print"<input type='hidden' name='msg' value='". DEL_REQ_AREA_FROM_PROJECT ."'>". NEWLINE;
160				print"</form>". NEWLINE;
161				print"</td>". NEWLINE;
162			}
163			print"</tr>". NEWLINE;
164		}
165		print"</tbody>".NEWLINE;
166		print"</table>". NEWLINE;
167
168	} else {
169
170		html_no_records_found_message( lang_get('no_areas_covered') );
171	}
172}
173
174print"</div>". NEWLINE;
175
176html_print_footer();
177
178# ------------------------------------
179# $Log: project_manage_reqareacovered_page.php,v $
180# Revision 1.4  2008/01/22 07:58:02  cryobean
181# made the table sortable
182#
183# Revision 1.3  2006/08/05 22:08:24  gth2
184# adding NEWLINE constant to support multiple OS newline chars - gth
185#
186# Revision 1.2  2006/02/24 11:37:48  gth2
187# update to div - class=div-c not working in firefox - gth
188#
189# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
190# importing initial version - gth
191#
192# ------------------------------------
193
194?>