/
bug_report_page.php
262 lines (218 loc) · 7.35 KB
/
bug_report_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2003 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: bug_report_page.php,v 1.17 2003-01-25 13:52:41 jlatour Exp $
# --------------------------------------------------------
?>
<?php
# This file POSTs data to report_bug.php
?>
<?php
require_once( 'core.php' );
require_once( $g_core_path . 'file_api.php' );
require_once( $g_core_path . 'custom_field_api.php' );
?>
<?php login_cookie_check() ?>
<?php
# this page is invalid for the 'All Project' selection
if ( 0 == helper_get_current_project() ) {
print_header_redirect( 'login_select_proj_page.php?ref=bug_report_page.php' );
}
if ( ADVANCED_ONLY == config_get( 'show_report' ) ) {
print_header_redirect ( 'bug_report_advanced_page.php' );
}
check_access( config_get( 'report_bug_threshold' ) );
$f_category = gpc_get_string( 'category', '' );
$f_reproducibility = gpc_get_int( 'reproducibility', 0 );
$f_severity = gpc_get_int( 'severity', 0 );
$f_priority = gpc_get_int( 'priority', NORMAL );
$f_summary = gpc_get_string( 'summary', '' );
$f_description = gpc_get_string( 'description', '' );
$f_additional_info = gpc_get_string( 'additional_info', '' );
$f_view_state = gpc_get_int( 'view_state', PUBLIC );
$f_report_stay = gpc_get_bool( 'report_stay' );
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
<br />
<div align="center">
<form name="report_bug_form" method="post" <?php if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?> action="bug_report.php">
<table class="width75" cellspacing="1">
<!-- Title -->
<tr>
<td class="form-title">
<input type="hidden" name="handler_id" value="0" />
<?php echo lang_get( 'enter_report_details_title' ) ?>
</td>
<td class="right">
<?php
if ( BOTH == config_get( 'show_report' ) ) {
print_bracket_link( 'bug_report_advanced_page.php', lang_get( 'advanced_report_link' ) );
}
?>
</td>
</tr>
<!-- Category -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category" width="30%">
<?php echo lang_get( 'category' ) ?> <?php print_documentation_link( 'category' ) ?>
</td>
<td width="70%">
<select tabindex="1" name="category">
<?php print_category_option_list( $f_category ) ?>
</select>
</td>
</tr>
<!-- Reproducibility -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'reproducibility' ) ?> <?php print_documentation_link( 'reproducibility' ) ?>
</td>
<td>
<select tabindex="2" name="reproducibility">
<?php print_enum_string_option_list( 'reproducibility', $f_reproducibility ) ?>
</select>
</td>
</tr>
<!-- Severity -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'severity' ) ?> <?php print_documentation_link( 'severity' ) ?>
</td>
<td>
<select tabindex="3" name="severity">
<?php print_enum_string_option_list( 'severity', $f_severity ) ?>
</select>
</td>
</tr>
<!-- Priority (if permissions allow) -->
<?php if ( access_level_check_greater_or_equal( config_get( 'update_bug_threshold' ) ) ) { ?>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'priority' ) ?> <?php print_documentation_link( 'priority' ) ?>
</td>
<td>
<select tabindex="4" name="priority">
<?php print_enum_string_option_list( 'priority', $f_priority ) ?>
</select>
</td>
</tr>
<?php } ?>
<!-- spacer -->
<tr>
<td class="spacer" colspan="2"> </td>
</tr>
<!-- Summary -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<span class="required">*</span><?php echo lang_get( 'summary' ) ?> <?php print_documentation_link( 'summary' ) ?>
</td>
<td>
<input tabindex="5" type="text" name="summary" size="80" maxlength="128" value="<?php echo $f_summary ?>" />
</td>
</tr>
<!-- Description -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<span class="required">*</span><?php echo lang_get( 'description' ) ?> <?php print_documentation_link( 'description' ) ?>
</td>
<td>
<textarea tabindex="6" name="description" cols="60" rows="5" wrap="virtual"><?php echo $f_description ?></textarea>
</td>
</tr>
<!-- Additional information -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'additional_information' ) ?> <?php print_documentation_link( 'additional_information' ) ?>
</td>
<td>
<textarea tabindex="7" name="additional_info" cols="60" rows="5" wrap="virtual"><?php echo $f_additional_info ?></textarea>
</td>
</tr>
<!-- Custom Fields -->
<?php if( ON == config_get( 'use_experimental_custom_fields' ) ) { ?>
<?php
$t_related_custom_field_ids = custom_field_get_linked_ids( helper_get_current_project() );
# insert a spacer as long as we actually have some custom fields
if ( count( $t_related_custom_field_ids ) > 0 ) {
?>
<tr>
<td class="spacer" colspan="2"> </td>
</tr>
<?php
} # if ( size( $t_related_custom_field_ids ) > 0 )
foreach( $t_related_custom_field_ids as $t_id ) {
$t_def = custom_field_get_definition( $t_id );
if( !$t_def['advanced'] ) {
?>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get_defaulted( $t_def['name'] ) ?>
</td>
<td>
<?php print_custom_field_input( $t_def ) ?>
</td>
</tr>
<?php
} # if (!$t_def['advanced'])
} # foreach( $t_related_custom_field_ids as $t_id )
?>
<?php } # if( ON == config_get( 'use_experimental_custom_fields' ) ) ?>
<!-- spacer -->
<tr>
<td class="spacer" colspan="2"> </td>
</tr>
<!-- File Upload (if enabled) -->
<?php if ( file_allow_bug_upload() ) { ?>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'upload_file' ) ?>
</td>
<td>
<input type="hidden" name="max_file_size" value="<?php echo config_get( 'max_file_size' ) ?>" />
<input tabindex="8" name="file" type="file" size="60" />
</td>
</tr>
<?php } ?>
<!-- View Status -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'view_status' ) ?>
</td>
<td>
<input tabindex="9" type="radio" name="view_state" value="<?php echo PUBLIC ?>" <?php check_checked( $f_view_state, PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
<input tabindex="10" type="radio" name="view_state" value="<?php echo PRIVATE ?>" <?php check_checked( $f_view_state, PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
</td>
</tr>
<!-- Report Stay (report more bugs) -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?>
</td>
<td>
<input tabindex="11" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
</td>
</tr>
<!-- Submit Button -->
<tr>
<td class="left">
<span class="required"> * <?php echo lang_get( 'required' ) ?></span>
</td>
<td class="center">
<input tabindex="12" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
</td>
</tr>
</table>
</form>
</div>
<!-- Autofocus JS -->
<script language="JavaScript">
<!--
window.document.report_bug_form.category.focus();
//-->
</script>
<?php print_page_bot1( __FILE__ ) ?>