SOAP API: do not try to unserialize an invalid filter
[mantis.git] / bug_update_advanced_page.php
blob4b807f7ade69a3f634f209924c5310deb4e98417
1 <?php
2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * @package MantisBT
19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
23 * @uses core.php
24 * @uses access_api.php
25 * @uses authentication_api.php
26 * @uses bug_api.php
27 * @uses columns_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
30 * @uses custom_field_api.php
31 * @uses error_api.php
32 * @uses event_api.php
33 * @uses form_api.php
34 * @uses gpc_api.php
35 * @uses helper_api.php
36 * @uses html_api.php
37 * @uses lang_api.php
38 * @uses last_visited_api.php
39 * @uses prepare_api.php
40 * @uses print_api.php
41 * @uses project_api.php
42 * @uses string_api.php
43 * @uses user_api.php
44 * @uses version_api.php
47 /**
48 * MantisBT Core API's
50 require_once( 'core.php' );
51 require_api( 'access_api.php' );
52 require_api( 'authentication_api.php' );
53 require_api( 'bug_api.php' );
54 require_api( 'columns_api.php' );
55 require_api( 'config_api.php' );
56 require_api( 'constant_inc.php' );
57 require_api( 'custom_field_api.php' );
58 require_api( 'error_api.php' );
59 require_api( 'event_api.php' );
60 require_api( 'form_api.php' );
61 require_api( 'gpc_api.php' );
62 require_api( 'helper_api.php' );
63 require_api( 'html_api.php' );
64 require_api( 'lang_api.php' );
65 require_api( 'last_visited_api.php' );
66 require_api( 'prepare_api.php' );
67 require_api( 'print_api.php' );
68 require_api( 'project_api.php' );
69 require_api( 'string_api.php' );
70 require_api( 'user_api.php' );
71 require_api( 'version_api.php' );
73 require_css( 'status_config.php' );
75 $g_allow_browser_cache = 1;
77 $f_bug_id = gpc_get_int( 'bug_id' );
79 $tpl_bug = bug_get( $f_bug_id, true );
81 if ( $tpl_bug->project_id != helper_get_current_project() ) {
82 # in case the current project is not the same project of the bug we are viewing...
83 # ... override the current project. This to avoid problems with categories and handlers lists etc.
84 $g_project_override = $tpl_bug->project_id;
85 $tpl_changed_project = true;
86 } else {
87 $tpl_changed_project = false;
90 if ( bug_is_readonly( $f_bug_id ) ) {
91 error_parameters( $f_bug_id );
92 trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
95 access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id );
97 $t_fields = config_get( 'bug_update_page_fields' );
98 $t_fields = columns_filter_disabled( $t_fields );
100 $tpl_bug_id = $f_bug_id;
102 $t_action_button_position = config_get( 'action_button_position' );
104 $tpl_top_buttons_enabled = $t_action_button_position == POSITION_TOP || $t_action_button_position == POSITION_BOTH;
105 $tpl_bottom_buttons_enabled = $t_action_button_position == POSITION_BOTTOM || $t_action_button_position == POSITION_BOTH;
107 $tpl_show_id = in_array( 'id', $t_fields );
108 $tpl_show_project = in_array( 'project', $t_fields );
109 $tpl_show_category = in_array( 'category_id', $t_fields );
110 $tpl_show_view_state = in_array( 'view_state', $t_fields );
111 $tpl_view_state = $tpl_show_view_state ? string_display_line( get_enum_element( 'view_state', $tpl_bug->view_state ) ) : '';
112 $tpl_show_date_submitted = in_array( 'date_submitted', $t_fields );
113 $tpl_show_last_updated = in_array( 'last_updated', $t_fields );
114 $tpl_show_reporter = in_array( 'reporter', $t_fields );
115 $tpl_show_handler = in_array( 'handler', $t_fields );
116 $tpl_show_priority = in_array( 'priority', $t_fields );
117 $tpl_show_severity = in_array( 'severity', $t_fields );
118 $tpl_show_reproducibility = in_array( 'reproducibility', $t_fields );
119 $tpl_show_status = in_array( 'status', $t_fields );
120 $tpl_show_resolution = in_array( 'resolution', $t_fields );
121 $tpl_show_projection = in_array( 'projection', $t_fields ) && config_get( 'enable_projection' ) == ON;
122 $tpl_show_eta = in_array( 'eta', $t_fields ) && config_get( 'enable_eta' ) == ON;
123 $t_show_profiles = config_get( 'enable_profiles' ) == ON;
124 $tpl_show_platform = $t_show_profiles && in_array( 'platform', $t_fields );
125 $tpl_show_os = $t_show_profiles && in_array( 'os', $t_fields );
126 $tpl_show_os_version = $t_show_profiles && in_array( 'os_version', $t_fields );
127 $tpl_show_versions = version_should_show_product_version( $tpl_bug->project_id );
128 $tpl_show_product_version = $tpl_show_versions && in_array( 'product_version', $t_fields );
129 $tpl_show_product_build = $tpl_show_versions && in_array( 'product_build', $t_fields ) && ( config_get( 'enable_product_build' ) == ON );
130 $tpl_product_build_attribute = $tpl_show_product_build ? string_attribute( $tpl_bug->build ) : '';
131 $tpl_show_target_version = $tpl_show_versions && in_array( 'target_version', $t_fields ) && access_has_bug_level( config_get( 'roadmap_update_threshold' ), $tpl_bug_id );
132 $tpl_show_fixed_in_version = $tpl_show_versions && in_array( 'fixed_in_version', $t_fields );
133 $tpl_show_due_date = in_array( 'due_date', $t_fields ) && access_has_bug_level( config_get( 'due_date_view_threshold' ), $tpl_bug_id );
134 $tpl_show_summary = in_array( 'summary', $t_fields );
135 $tpl_summary_attribute = $tpl_show_summary ? string_attribute( $tpl_bug->summary ) : '';
136 $tpl_show_description = in_array( 'description', $t_fields );
137 $tpl_description_textarea = $tpl_show_description ? string_textarea( $tpl_bug->description ) : '';
138 $tpl_show_additional_information = in_array( 'additional_info', $t_fields );
139 $tpl_additional_information_textarea = $tpl_show_additional_information ? string_textarea( $tpl_bug->additional_information ) : '';
140 $tpl_show_steps_to_reproduce = in_array( 'steps_to_reproduce', $t_fields );
141 $tpl_steps_to_reproduce_textarea = $tpl_show_steps_to_reproduce ? string_textarea( $tpl_bug->steps_to_reproduce ) : '';
142 $tpl_handler_name = string_display_line( user_get_name( $tpl_bug->handler_id ) );
144 $tpl_can_change_view_state = $tpl_show_view_state && access_has_project_level( config_get( 'change_view_status_threshold' ) );
146 if ( $tpl_show_product_version ) {
147 $tpl_product_version_released_mask = VERSION_RELEASED;
149 if ( access_has_project_level( config_get( 'report_issues_for_unreleased_versions_threshold' ) ) ) {
150 $tpl_product_version_released_mask = VERSION_ALL;
154 $tpl_formatted_bug_id = $tpl_show_id ? bug_format_id( $f_bug_id ) : '';
155 $tpl_project_name = $tpl_show_project ? string_display_line( project_get_name( $tpl_bug->project_id ) ) : '';
157 if ( $tpl_show_due_date ) {
158 require_js( 'jscalendar/calendar.js' );
159 require_js( 'jscalendar/lang/calendar-en.js' );
160 require_js( 'jscalendar/calendar-setup.js' );
161 require_css( 'calendar-blue.css' );
164 html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
166 print_recently_visited();
168 echo '<br />';
169 echo '<form name="update_bug_form" method="post" action="bug_update.php">';
170 echo form_security_field( 'bug_update' );
171 echo '<table class="width100" cellspacing="1">';
172 echo '<tr>';
173 echo '<td class="form-title" colspan="3">';
174 echo '<input type="hidden" name="bug_id" value="', $tpl_bug_id, '" />';
175 echo lang_get( 'updating_bug_advanced_title' );
176 echo '</td><td class="right" colspan="3">';
177 print_bracket_link( string_get_bug_view_url( $tpl_bug_id ), lang_get( 'back_to_bug_link' ) );
178 echo '</td></tr>';
180 # Submit Button
181 if ( $tpl_top_buttons_enabled ) {
182 echo '<tr><td class="center" colspan="6">';
183 echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
184 echo '</td></tr>';
188 event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $tpl_bug_id, true ) );
190 if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted | $tpl_show_last_updated ) {
192 # Titles for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated
195 echo '<tr>';
196 echo '<td width="15%" class="category">', $tpl_show_id ? lang_get( 'id' ) : '', '</td>';
197 echo '<td width="20%" class="category">', $tpl_show_project ? lang_get( 'email_project' ) : '', '</td>';
198 echo '<td width="15%" class="category">', $tpl_show_category ? '<label for="category_id">' . lang_get( 'category' ) . '</label>' : '', '</td>';
199 echo '<td width="20%" class="category">', $tpl_show_view_state ? '<label for="view_state">' . lang_get( 'view_status' ) . '</label>' : '', '</td>';
200 echo '<td width="15%" class="category">', $tpl_show_date_submitted ? lang_get( 'date_submitted' ) : '', '</td>';
201 echo '<td width="15%" class="category">', $tpl_show_last_updated ? lang_get( 'last_update' ) : '', '</td>';
202 echo '</tr>';
205 # Values for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated
208 echo '<tr ', helper_alternate_class(), '>';
210 # Bug ID
211 echo '<td>', $tpl_formatted_bug_id, '</td>';
213 # Project Name
214 echo '<td>', $tpl_project_name, '</td>';
216 # Category
217 echo '<td>';
219 if ( $tpl_show_category ) {
220 echo '<select ' . helper_get_tab_index() . ' id="category_id" name="category_id">';
221 print_category_option_list( $tpl_bug->category_id, $tpl_bug->project_id );
222 echo '</select>';
225 echo '</td>';
227 # View State
228 echo '<td>';
230 if ( $tpl_can_change_view_state ) {
231 echo '<select ' . helper_get_tab_index() . ' id="view_state" name="view_state">';
232 print_enum_string_option_list( 'view_state', $tpl_bug->view_state);
233 echo '</select>';
234 } else if ( $tpl_show_view_state ) {
235 echo $tpl_view_state;
238 echo '</td>';
240 # Date Submitted
241 echo '<td>', $tpl_show_date_submitted ? date( config_get( 'normal_date_format' ), $tpl_bug->date_submitted ) : '', '</td>';
243 # Date Updated
244 echo '<td>', $tpl_show_last_updated ? date( config_get( 'normal_date_format' ), $tpl_bug->last_updated ) : '', '</td>';
246 echo '</tr>';
248 # spacer
249 echo '<tr class="spacer"><td colspan="6"></td></tr>';
253 # Reporter
256 if ( $tpl_show_reporter ) {
257 echo '<tr ', helper_alternate_class(), '>';
259 $t_spacer = 4;
261 if ( $tpl_show_reporter ) {
262 # Reporter
263 echo '<th class="category"><label for="reporter_id">' . lang_get( 'reporter' ) . '</label></th>';
264 echo '<td>';
266 echo '<select ' . helper_get_tab_index() . ' id="reporter_id" name="reporter_id">';
267 print_reporter_option_list( $tpl_bug->reporter_id, $tpl_bug->project_id );
268 echo '</select>';
270 echo '</td>';
271 } else {
272 $t_spacer += 2;
275 # spacer
276 echo '<td colspan="', $t_spacer, '">&#160;</td>';
278 echo '</tr>';
282 # Assigned To, Due Date
285 if ( $tpl_show_handler || $tpl_show_due_date ) {
286 echo '<tr ', helper_alternate_class(), '>';
288 $t_spacer = 2;
290 # Assigned To
291 echo '<th class="category"><label for="handler_id">' . lang_get( 'assigned_to' ) . '</label></th>';
292 echo '<td>';
294 if ( access_has_project_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ) ) ) {
295 echo '<select ' . helper_get_tab_index() . ' id="handler_id" name="handler_id">';
296 echo '<option value="0"></option>';
297 print_assign_to_option_list( $tpl_bug->handler_id, $tpl_bug->project_id );
298 echo '</select>';
299 } else {
300 echo $tpl_handler_name;
303 echo '</td>';
305 if ( $tpl_show_due_date ) {
306 # Due Date
307 echo '<th class="category"><label for="due_date">' . lang_get( 'due_date' ) . '</label></th>';
309 if ( bug_is_overdue( $tpl_bug_id ) ) {
310 echo '<td class="overdue">';
311 } else {
312 echo '<td>';
315 if ( access_has_bug_level( config_get( 'due_date_update_threshold' ), $tpl_bug_id ) ) {
316 $t_date_to_display = '';
318 if ( !date_is_null( $tpl_bug->due_date ) ) {
319 $t_date_to_display = date( config_get( 'calendar_date_format' ), $tpl_bug->due_date );
321 echo "<input " . helper_get_tab_index() . " type=\"text\" id=\"due_date\" name=\"due_date\" class=\"datetime\" size=\"20\" maxlength=\"16\" value=\"" . $t_date_to_display . "\" />";
322 } else {
323 if ( !date_is_null( $tpl_bug->due_date ) ) {
324 echo date( config_get( 'short_date_format' ), $tpl_bug->due_date );
328 echo '</td>';
329 } else {
330 $t_spacer += 2;
333 # spacer
334 echo '<td colspan="', $t_spacer, '">&#160;</td>';
336 echo '</tr>';
340 # Priority, Severity, Reproducibility
343 if ( $tpl_show_priority || $tpl_show_severity || $tpl_show_reproducibility ) {
344 echo '<tr ', helper_alternate_class(), '>';
346 $t_spacer = 0;
348 if ( $tpl_show_priority ) {
349 # Priority
350 echo '<th class="category"><label for="priority">' . lang_get( 'priority' ) . '</label></th>';
351 echo '<td><select ' . helper_get_tab_index() . ' id="priority" name="priority">';
352 print_enum_string_option_list( 'priority', $tpl_bug->priority );
353 echo '</select></td>';
354 } else {
355 $t_spacer += 2;
358 if ( $tpl_show_severity ) {
359 # Severity
360 echo '<th class="category"><label for="severity">' . lang_get( 'severity' ) . '</label></th>';
361 echo '<td><select ' . helper_get_tab_index() . ' id="severity" name="severity">';
362 print_enum_string_option_list( 'severity', $tpl_bug->severity );
363 echo '</select></td>';
364 } else {
365 $t_spacer += 2;
368 if ( $tpl_show_reproducibility ) {
369 # Reproducibility
370 echo '<th class="category"><label for="reproducibility">' . lang_get( 'reproducibility' ) . '</label></th>';
371 echo '<td><select ' . helper_get_tab_index() . ' id="reproducibility" name="reproducibility">';
372 print_enum_string_option_list( 'reproducibility', $tpl_bug->reproducibility );
373 echo '</select></td>';
374 } else {
375 $t_spacer += 2;
378 # spacer
379 if ( $t_spacer > 0 ) {
380 echo '<td colspan="', $t_spacer, '">&#160;</td>';
383 echo '</tr>';
387 # Status, Resolution
390 if ( $tpl_show_status || $tpl_show_resolution ) {
391 echo '<tr ', helper_alternate_class(), '>';
393 $t_spacer = 2;
395 if ( $tpl_show_status ) {
396 # Status
397 echo '<th class="category"><label for="status">' . lang_get( 'status' ) . '</label></th>';
399 # choose color based on status
400 $status_label = html_get_status_css_class( $tpl_bug->status );
402 echo '<td class="' . $status_label . '">';
403 print_status_option_list( 'status', $tpl_bug->status,
404 ( $tpl_bug->reporter_id == auth_get_current_user_id() &&
405 ( ON == config_get( 'allow_reporter_close' ) ) ), $tpl_bug->project_id );
406 echo '</td>';
407 } else {
408 $t_spacer += 2;
411 if ( $tpl_show_resolution ) {
412 # Resolution
413 echo '<th class="category"><label for="resolution">' . lang_get( 'resolution' ) . '</label></th>';
414 echo '<td><select ' . helper_get_tab_index() . ' id="resolution" name="resolution">';
415 print_enum_string_option_list( 'resolution', $tpl_bug->resolution );
416 echo '</select></td>';
417 } else {
418 $t_spacer += 2;
421 # spacer
422 if ( $t_spacer > 0 ) {
423 echo '<td colspan="', $t_spacer, '">&#160;</td>';
426 echo '</tr>';
430 # Projection, ETA
433 if ( $tpl_show_projection || $tpl_show_eta ) {
434 echo '<tr ', helper_alternate_class(), '>';
436 $t_spacer = 2;
438 if ( $tpl_show_projection ) {
439 # Projection
440 echo '<th class="category"><label for="projection">' . lang_get( 'projection' ) . '</label></th>';
441 echo '<td><select ' . helper_get_tab_index() . ' id="projection" name="projection">';
442 print_enum_string_option_list( 'projection', $tpl_bug->projection );
443 echo '</select></td>';
444 } else {
445 $t_spacer += 2;
448 # ETA
449 if ( $tpl_show_eta ) {
450 echo '<th class="category"><label for="eta">' . lang_get( 'eta' ) . '</label></th>';
451 echo '<td><select ' . helper_get_tab_index() . ' id="eta" name="eta">';
452 print_enum_string_option_list( 'eta', $tpl_bug->eta );
453 echo '</select></td>';
454 } else {
455 $t_spacer += 2;
458 # spacer
459 echo '<td colspan="', $t_spacer, '">&#160;</td>';
461 echo '</tr>';
465 # Platform, OS, OS Version
468 if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) {
469 echo '<tr ', helper_alternate_class(), '>';
471 $t_spacer = 0;
473 if ( $tpl_show_platform ) {
474 # Platform
475 echo '<th class="category"><label for="platform">' . lang_get( 'platform' ) . '</label></th>';
476 echo '<td>';
478 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
479 echo '<select ' . helper_get_tab_index() . ' id="platform" name="platform"><option value=""></option>';
480 print_platform_option_list( $tpl_bug->platform );
481 echo '</select>';
482 } else {
483 echo '<input type="text" id="platform" name="platform" class="autocomplete" size="16" maxlength="32" tabindex="' . helper_get_tab_index_value() . '" value="' . string_attribute( $tpl_bug->platform ) . '" />';
486 echo '</td>';
487 } else {
488 $t_spacer += 2;
491 if ( $tpl_show_os ) {
492 # Operating System
493 echo '<th class="category"><label for="os">' . lang_get( 'os' ) . '</label></th>';
494 echo '<td>';
496 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
497 echo '<select ' . helper_get_tab_index() . ' id="os" name="os"><option value=""></option>';
498 print_os_option_list( $tpl_bug->os );
499 echo '</select>';
500 } else {
501 echo '<input type="text" id="os" name="os" class="autocomplete" size="16" maxlength="32" tabindex="' . helper_get_tab_index_value() . '" value="' . string_attribute( $tpl_bug->os ) . '" />';
504 echo '</td>';
505 } else {
506 $t_spacer += 2;
509 if ( $tpl_show_os_version ) {
510 # OS Version
511 echo '<th class="category"><label for="os_build">' . lang_get( 'os_version' ) . '</label></th>';
512 echo '<td>';
514 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
515 echo '<select ' . helper_get_tab_index() . ' id="os_build" name="os_build"><option value=""></option>';
516 print_os_build_option_list( $tpl_bug->os_build );
517 echo '</select>';
518 } else {
519 echo '<input type="text" id="os_build" name="os_build" class="autocomplete" size="16" maxlength="16" tabindex="' . helper_get_tab_index_value() . '" value="' . string_attribute( $tpl_bug->os_build ) . '" />';
522 echo '</td>';
523 } else {
524 $t_spacer += 2;
527 # spacer
528 if ( $t_spacer > 0 ) {
529 echo '<td colspan="', $t_spacer, '">&#160;</td>';
532 echo '</tr>';
536 # Product Version, Product Build
539 if ( $tpl_show_product_version || $tpl_show_product_build ) {
540 echo '<tr ', helper_alternate_class(), '>';
542 $t_spacer = 2;
544 # Product Version or Product Build, if version is suppressed
545 if ( $tpl_show_product_version ) {
546 echo '<th class="category"><label for="version">' . lang_get( 'product_version' ) . '</label></th>';
547 echo '<td>', '<select ', helper_get_tab_index(), ' id="version" name="version">';
548 print_version_option_list( $tpl_bug->version, $tpl_bug->project_id, $tpl_product_version_released_mask );
549 echo '</select></td>';
550 } else {
551 $t_spacer += 2;
554 if ( $tpl_show_product_build ) {
555 echo '<th class="category"><label for="build">' . lang_get( 'product_build' ) . '</label></th>';
556 echo '<td>';
557 echo '<input type="text" id="build" name="build" size="16" maxlength="32" ' . helper_get_tab_index() . ' value="' . $tpl_product_build_attribute . '" />';
558 echo '</td>';
559 } else {
560 $t_spacer += 2;
563 # spacer
564 echo '<td colspan="', $t_spacer, '">&#160;</td>';
566 echo '</tr>';
570 # Target Version, Fixed in Version
573 if ( $tpl_show_target_version || $tpl_show_fixed_in_version ) {
574 echo '<tr ', helper_alternate_class(), '>';
576 $t_spacer = 2;
578 # Target Version
579 if ( $tpl_show_target_version ) {
580 echo '<th class="category"><label for="target_version">' . lang_get( 'target_version' ) . '</label></th>';
581 echo '<td><select ' . helper_get_tab_index() . ' id="target_version" name="target_version">';
582 print_version_option_list( $tpl_bug->target_version, $tpl_bug->project_id, VERSION_ALL );
583 echo '</select></td>';
584 } else {
585 $t_spacer += 2;
588 # Fixed in Version
589 if ( $tpl_show_fixed_in_version ) {
590 echo '<th class="category"><label for="fixed_in_version">' . lang_get( 'fixed_in_version' ) . '</label></th>';
591 echo '<td>';
592 echo '<select ' . helper_get_tab_index() . ' id="fixed_in_version" name="fixed_in_version">';
593 print_version_option_list( $tpl_bug->fixed_in_version, $tpl_bug->project_id, VERSION_ALL );
594 echo '</select>';
595 echo '</td>';
596 } else {
597 $t_spacer += 2;
600 # spacer
601 echo '<td colspan="', $t_spacer, '">&#160;</td>';
603 echo '</tr>';
606 event_signal( 'EVENT_UPDATE_BUG_FORM', array( $tpl_bug_id, true ) );
608 # spacer
609 echo '<tr class="spacer"><td colspan="6"></td></tr>';
611 # Summary
612 if ( $tpl_show_summary ) {
613 echo '<tr ', helper_alternate_class(), '>';
614 echo '<th class="category"><label for="summary">' . lang_get( 'summary' ) . '</label></th>';
615 echo '<td colspan="5">', '<input ', helper_get_tab_index(), ' type="text" id="summary" name="summary" size="105" maxlength="128" value="', $tpl_summary_attribute, '" />';
616 echo '</td></tr>';
619 # Description
620 if ( $tpl_show_description ) {
621 echo '<tr ', helper_alternate_class(), '>';
622 echo '<th class="category"><label for="description">' . lang_get( 'description' ) . '</label></th>';
623 echo '<td colspan="5">';
624 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" id="description" name="description">', $tpl_description_textarea, '</textarea>';
625 echo '</td></tr>';
628 # Steps to Reproduce
629 if ( $tpl_show_steps_to_reproduce ) {
630 echo '<tr ', helper_alternate_class(), '>';
631 echo '<th class="category"><label for="steps_to_reproduce">' . lang_get( 'steps_to_reproduce' ) . '</label></th>';
632 echo '<td colspan="5">';
633 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" id="steps_to_reproduce" name="steps_to_reproduce">', $tpl_steps_to_reproduce_textarea, '</textarea>';
634 echo '</td></tr>';
637 # Additional Information
638 if ( $tpl_show_additional_information ) {
639 echo '<tr ', helper_alternate_class(), '>';
640 echo '<th class="category"><label for="additional_information">' . lang_get( 'additional_information' ) . '</label></th>';
641 echo '<td colspan="5">';
642 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" id="additional_information" name="additional_information">', $tpl_additional_information_textarea, '</textarea>';
643 echo '</td></tr>';
646 echo '<tr class="spacer"><td colspan="6"></td></tr>';
648 # Custom Fields
649 $t_custom_fields_found = false;
650 $t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
652 foreach ( $t_related_custom_field_ids as $t_id ) {
653 $t_def = custom_field_get_definition( $t_id );
654 if ( ( $t_def['display_update'] || $t_def['require_update'] ) && custom_field_has_write_access( $t_id, $tpl_bug_id ) ) {
655 $t_custom_fields_found = true;
657 echo '<tr ', helper_alternate_class(), '>';
658 echo '<td class="category">';
659 if ( $t_def['require_update'] ) {
660 echo '<span class="required">*</span>';
662 if ( $t_def['type'] != CUSTOM_FIELD_TYPE_RADIO && $t_def['type'] != CUSTOM_FIELD_TYPE_CHECKBOX ) {
663 echo '<label for="custom_field_' . string_attribute( $t_def['id'] ) . '">' . string_display( lang_get_defaulted( $t_def['name'] ) ) . '</label>';
664 } else {
665 echo string_display( lang_get_defaulted( $t_def['name'] ) );
667 echo '</td><td colspan="5">';
668 print_custom_field_input( $t_def, $tpl_bug_id );
669 echo '</td></tr>';
671 } # foreach( $t_related_custom_field_ids as $t_id )
673 if ( $t_custom_fields_found ) {
674 # spacer
675 echo '<tr class="spacer"><td colspan="6"></td></tr>';
676 } # custom fields found
678 # Bugnote Text Box
679 echo '<tr ', helper_alternate_class(), '>';
680 echo '<th class="category"><label for="bugnote_text">' . lang_get( 'add_bugnote_title' ) . '</label></th>';
681 echo '<td colspan="5"><textarea ', helper_get_tab_index(), ' id="bugnote_text" name="bugnote_text" cols="80" rows="10"></textarea></td></tr>';
683 # Bugnote Private Checkbox (if permitted)
684 if ( access_has_bug_level( config_get( 'private_bugnote_threshold' ), $tpl_bug_id ) ) {
685 echo '<tr ', helper_alternate_class(), '>';
686 echo '<th class="category">' . lang_get( 'private' ) . '</th>';
687 echo '<td colspan="5">';
689 $t_default_bugnote_view_status = config_get( 'default_bugnote_view_status' );
690 if ( access_has_bug_level( config_get( 'set_view_status_threshold' ), $tpl_bug_id ) ) {
691 echo '<input ', helper_get_tab_index(), ' type="checkbox" id="private" name="private" ', check_checked( config_get( 'default_bugnote_view_status' ), VS_PRIVATE ), ' />';
692 echo lang_get( 'private' );
693 } else {
694 echo get_enum_element( 'view_state', $t_default_bugnote_view_status );
697 echo '</td></tr>';
700 # Time Tracking (if permitted)
701 if ( config_get('time_tracking_enabled') ) {
702 if ( access_has_bug_level( config_get( 'time_tracking_edit_threshold' ), $tpl_bug_id ) ) {
703 echo '<tr ', helper_alternate_class(), '>';
704 echo '<th class="category"><label for="time_tracking">' . lang_get( 'time_tracking' ) . ' (HH:MM)</label></th>';
705 echo '<td colspan="5"><input type="text" id="time_tracking" name="time_tracking" size="5" value="0:00" /></td></tr>';
709 event_signal( 'EVENT_BUGNOTE_ADD_FORM', array( $tpl_bug_id ) );
711 # Submit Button
712 if ( $tpl_bottom_buttons_enabled ) {
713 echo '<tr><td class="center" colspan="6">';
714 echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
715 echo '</td></tr>';
718 echo '</table></form>';
720 define( 'BUGNOTE_VIEW_INC_ALLOW', true );
721 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' );
722 html_page_bottom();
724 last_visited_issue( $tpl_bug_id );