/
bug_view_page.php
349 lines (325 loc) · 9.39 KB
/
bug_view_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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 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_view_page.php,v 1.12 2002-12-06 09:12:56 vboctor Exp $
# --------------------------------------------------------
?>
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
$f_bug_id = gpc_get_int( 'f_bug_id' );
$f_history = gpc_get_bool( 'f_history' );
if ( ADVANCED_ONLY == config_get( 'show_view' ) ) {
print_header_redirect ( 'bug_view_advanced_page.php?f_bug_id=' . $f_bug_id );
}
project_access_check( $f_bug_id );
# if bug is private, make sure user can view private bugs
access_bug_check( $f_bug_id );
$t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) );
compress_start();
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
<br />
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="3">
<?php echo lang_get( 'viewing_bug_simple_details_title' ) ?>
<span class="small"><?php print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) ) ?></span>
</td>
<td class="right" colspan="3">
<?php if ( BOTH == config_get( 'show_view' ) ) { ?>
<span class="small"><?php print_bracket_link( 'bug_view_advanced_page.php?f_bug_id=' . $f_bug_id, lang_get( 'view_advanced_link' ) )?></span>
<?php }?>
<span class="small"><?php print_bracket_link( 'bug_view_page.php?f_bug_id=' . $f_bug_id . '&f_history=1#history', lang_get( 'bug_history' ) ) ?></span>
<span class="small"><?php print_bracket_link( 'print_bug_page.php?f_bug_id=' . $f_bug_id, lang_get( 'print' ) ) ?></span>
</td>
</tr>
<tr class="row-category">
<td width="16%">
<?php echo lang_get( 'id' ) ?>
</td>
<td width="16%">
<?php echo lang_get( 'category' ) ?>
</td>
<td width="16%">
<?php echo lang_get( 'severity' ) ?>
</td>
<td width="16%">
<?php echo lang_get( 'reproducibility' ) ?>
</td>
<td width="16%">
<?php echo lang_get( 'date_submitted' ) ?>
</td>
<td width="16%">
<?php echo lang_get( 'last_update' ) ?>
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td>
<?php echo bug_format_id( $f_bug_id ) ?>
</td>
<td>
<?php echo $t_bug->category ?>
</td>
<td>
<?php echo get_enum_element( 'severity', $t_bug->severity ) ?>
</td>
<td>
<?php echo get_enum_element( 'reproducibility', $t_bug->reproducibility ) ?>
</td>
<td>
<?php print_date( config_get( 'normal_date_format' ), $t_bug->date_submitted ) ?>
</td>
<td>
<?php print_date( config_get( 'normal_date_format' ), $t_bug->last_updated ) ?>
</td>
</tr>
<tr>
<td class="spacer" colspan="6">
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'reporter' ) ?>
</td>
<td>
<?php print_user_with_subject( $t_bug->reporter_id, $f_bug_id ) ?>
</td>
<td class="category">
<?php echo lang_get( 'view_status' ) ?>
</td>
<td>
<?php echo get_enum_element( 'project_view_state', $t_bug->view_state ) ?>
</td>
<td colspan="2">
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'assigned_to' ) ?>
</td>
<td colspan="5">
<?php print_user_with_subject( $t_bug->handler_id, $f_bug_id ) ?>
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'priority' ) ?>
</td>
<td>
<?php echo get_enum_element( 'priority', $t_bug->priority ) ?>
</td>
<td class="category">
<?php echo lang_get( 'resolution' ) ?>
</td>
<td>
<?php echo get_enum_element( 'resolution', $t_bug->resolution ) ?>
</td>
<td colspan="2">
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'status' ) ?>
</td>
<td bgcolor="<?php echo get_status_color( $t_bug->status ) ?>">
<?php echo get_enum_element( 'status', $t_bug->status ) ?>
</td>
<td class="category">
<?php echo lang_get( 'duplicate_id' ) ?>
</td>
<td>
<?php print_duplicate_id( $t_bug->duplicate_id ) ?>
</td>
<td colspan="2">
</td>
</tr>
<?php if( ON == config_get( 'use_experimental_custom_fields' ) ) { ?>
<?php
$t_related_custom_field_ids = custom_field_get_ids( helper_get_current_project() );
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 $t_def['name'] ?>
</td>
<td colspan="5">
<?php
$t_custom_field_value = custom_field_get_value( $t_id, $f_bug_id );
if( CUSTOM_FIELD_TYPE_EMAIL == $t_def['type'] ) {
echo "<a href=\"mailto:$t_custom_field_value\">$t_custom_field_value</a>";
} else {
echo $t_custom_field_value;
}
?>
</td>
</tr>
<?php
} // !$t_def['advanced']
} // foreach
?>
<?php } // ON = config_get( 'use_experimental_custom_fields' ) ?>
<tr>
<td class="spacer" colspan="6">
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'summary' ) ?>
</td>
<td colspan="5">
<?php echo $t_bug->summary ?>
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'description' ) ?>
</td>
<td colspan="5">
<?php echo $t_bug->description ?>
</td>
</tr>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'additional_information' ) ?>
</td>
<td colspan="5">
<?php echo $t_bug->additional_information ?>
</td>
</tr>
<?php
$t_show_attachments = ( ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_level_check_greater_or_equal( config_get( 'view_attachments_threshold' ) ) );
if ( $t_show_attachments ) {
?>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'attached_files' ) ?>
</td>
<td colspan="5">
<?php file_list_attachments ( $f_bug_id ); ?>
</td>
</tr>
<?php } ?>
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'bug_relationships' ) ?>
</td>
<td colspan="5">
<?php
$result = relationship_fetch_all_src( $f_bug_id );
$relationship_count = db_num_rows( $result );
for ($i=0;$i<$relationship_count;$i++) {
$row = db_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, 'v2' );
$t_bug_link = string_get_bug_view_link( $t_bug->destination_bug_id );
switch ( $t_bug->relationship_type ) {
case BUG_DUPLICATE: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'duplicate_of' ) );
break;
case BUG_RELATED: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'related_to' ) );
break;
case BUG_DEPENDANT: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'dependant_on' ) );
break;
default: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'duplicate_of' ) );
}
PRINT "$t_description<br />";
}
?>
<?php
$result = relationship_fetch_all_dest( $f_bug_id );
$relationship_count = db_num_rows( $result );
for ($i=0;$i<$relationship_count;$i++) {
$row = db_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, 'v2' );
$t_bug_link = string_get_bug_view_link( $t_bug->source_bug_id );
switch ( $t_bug->relationship_type ) {
case BUG_DUPLICATE: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'has_duplicate' ) );
break;
case BUG_RELATED: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'related_to' ) );
break;
case BUG_DEPENDANT: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'blocks' ) );
break;
default: $t_description = str_replace( '%id', $t_bug_link, lang_get( 'has_duplicate' ) );
}
PRINT "$t_description<br />";
}
?>
</td>
</tr>
<tr align="center">
<td colspan="6">
<table width="100%">
<tr align="center">
<?php
# UPDATE button
if ( $t_bug->status < RESOLVED ) {
echo '<td class="center">';
html_button_bug_update( $f_bug_id );
echo '</td>';
}
# ASSIGN button
if ( $t_bug->status < RESOLVED ) {
echo '<td class="center">';
html_button_bug_assign( $f_bug_id );
echo '</td>';
}
# RESOLVE button
if ( $t_bug->status < RESOLVED ) {
echo '<td class="center">';
html_button_bug_resolve( $f_bug_id );
echo '</td>';
}
# REOPEN button
if ( $t_bug->status >= RESOLVED ) {
echo '<td class="center">';
html_button_bug_reopen( $f_bug_id );
echo '</td>';
}
# REOPEN button
if ( $t_bug->status == RESOLVED ) {
echo '<td class="center">';
html_button_bug_close( $f_bug_id );
echo '</td>';
}
# MONITOR/UNMONITOR button
if ( user_is_monitoring_bug( auth_get_current_user_id(), $f_bug_id ) ) {
echo '<td class="center">';
html_button_bug_unmonitor( $f_bug_id );
echo '</td>';
} else {
echo '<td class="center">';
html_button_bug_monitor( $f_bug_id );
echo '</td>';
}
# DELETE button
echo '<td class="center">';
html_button_bug_delete( $f_bug_id );
echo '</td>';
?>
</tr>
</table>
</td>
</tr>
</table>
<?php
if ( is_blank( $f_check ) && $t_show_attachments && $t_bug->status < RESOLVED && access_level_check_greater_or_equal( REPORTER ) ) {
include( config_get( 'bug_file_upload_inc' ) );
}
include( config_get( 'bugnote_include_file' ) );
if ( $f_history ) {
include( config_get( 'history_include_file' ) );
}
?>
<?php print_page_bot1( __FILE__ ) ?>
<?php compress_stop(); ?>