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# Requirement Group Action Page
10#
11# $RCSfile: requirement_group_action_page.php,v $  $Revision: 1.3 $
12# ---------------------------------------------------------------------
13
14include"./api/include_api.php";
15auth_authenticate_user();
16
17$page                   = basename(__FILE__);
18$action_page			= 'requirement_group_action.php';
19$redirect_on_error		= 'requirement_page.php';
20$project_properties     = session_get_project_properties();
21$project_name           = $project_properties['project_name'];
22$project_id				= $project_properties['project_id'];
23
24html_window_title();
25html_print_body();
26html_page_title($project_name ." - ". lang_get('req_mass_update_page'));
27html_page_header( $db, $project_name );
28html_print_menu();
29requirement_menu_print($page);
30
31$ids = "";
32$version_ids = "";
33
34
35# if submit from test_page.php
36if( isset($_POST['mass_req_update']) && isset($_POST['row_req_arr']) ) {
37
38	$field = $_POST['action'];
39	$post_ids = $_POST['row_req_arr'];
40	//print_r($ids);
41
42	foreach($post_ids as $req_id => $value) {
43
44		$version_array = $_POST['row_req_arr'][$req_id];
45
46		foreach( $version_array as $vers_id => $vers_val ) {
47			$version_ids .= $vers_id . "|";
48		}
49
50		$ids .= $req_id ."|";
51	}
52
53}
54else {
55	error_report_show( $redirect_on_error, NO_REQ_SELECTED);
56}
57
58# Trim off last "|"
59$version_ids = trim($version_ids, "|");
60$ids = trim($ids, "|");
61
62
63switch( $field ) {
64
65	case 'status':
66		$form_title = lang_get( 'update_req_status' );
67		$possible_values = requirement_get_statuses();
68		break;
69	case 'assigned_release':
70		$form_title = lang_get( 'update_req_release' );
71		$possible_values = admin_get_all_release_names( $project_id, $blank=true );
72		break;
73}
74
75
76print"<br>". NEWLINE;
77
78print"<div align=center>". NEWLINE;
79
80print"<form method=post action=$action_page>". NEWLINE;
81print"<input type='hidden' name='ids' value='$ids'>". NEWLINE;
82print"<input type='hidden' name='version_ids' value='$version_ids'>". NEWLINE;
83print"<input type='hidden' name=field value='$field'>". NEWLINE;
84
85print"<table class=width50>". NEWLINE;
86print"<tr>". NEWLINE;
87print"<td>". NEWLINE;
88
89print"<table class=inner>". NEWLINE;
90
91# FORM TITLE
92print"<tr>". NEWLINE;
93print"<td class='form-data-l'><h4>$form_title</h4></td>". NEWLINE;
94print"</tr>". NEWLINE;
95
96# VALUE
97print"<tr>". NEWLINE;
98print"<td class='form-data-c'>";
99print"<select name=field_value size=1>". NEWLINE;
100switch( $field ) {
101	case 'status':
102		html_print_list_box_from_array(	$possible_values );
103		break;
104	case 'assigned_release':
105		html_print_list_box_from_key_array(	$possible_values );
106		break;
107}
108print"</select>". NEWLINE;
109print"</td>". NEWLINE;
110print"</tr>". NEWLINE;
111
112util_add_spacer();
113
114# SUBMIT BUTTON
115print"<tr>". NEWLINE;
116print"<td class='form-data-c'><input type='submit' name=submit_status value='". lang_get('update') ."'></td>". NEWLINE;
117print"</tr>". NEWLINE;
118
119print"</table>". NEWLINE;
120
121print"</td>". NEWLINE;
122print"</tr>". NEWLINE;
123print"</table>". NEWLINE;
124
125print"</form>". NEWLINE;
126
127print"</div>". NEWLINE;
128
129html_print_footer();
130
131# ---------------------------------------------------------------------
132# $Log: requirement_group_action_page.php,v $
133# Revision 1.3  2006/08/05 22:08:37  gth2
134# adding NEWLINE constant to support multiple OS newline chars - gth
135#
136# Revision 1.2  2006/02/24 11:37:48  gth2
137# update to div - class=div-c not working in firefox - gth
138#
139# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
140# importing initial version - gth
141#
142# ---------------------------------------------------------------------
143?>