Issue #10730: Use crypto_api for generating nonces and improve hashing
[mantis/radio.git] / bug_update_advanced_page.php
blob6382098e71968d2407b82ac8877385d836430752
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 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
23 * @uses core.php
24 * @uses access_api.php
25 * @uses ajax_api.php
26 * @uses authentication_api.php
27 * @uses bug_api.php
28 * @uses columns_api.php
29 * @uses config_api.php
30 * @uses constant_inc.php
31 * @uses custom_field_api.php
32 * @uses date_api.php
33 * @uses error_api.php
34 * @uses event_api.php
35 * @uses form_api.php
36 * @uses gpc_api.php
37 * @uses helper_api.php
38 * @uses html_api.php
39 * @uses lang_api.php
40 * @uses last_visited_api.php
41 * @uses prepare_api.php
42 * @uses print_api.php
43 * @uses projax_api.php
44 * @uses project_api.php
45 * @uses string_api.php
46 * @uses user_api.php
47 * @uses version_api.php
50 require_once( 'core.php' );
51 require_api( 'access_api.php' );
52 require_api( 'ajax_api.php' );
53 require_api( 'authentication_api.php' );
54 require_api( 'bug_api.php' );
55 require_api( 'columns_api.php' );
56 require_api( 'config_api.php' );
57 require_api( 'constant_inc.php' );
58 require_api( 'custom_field_api.php' );
59 require_api( 'date_api.php' );
60 require_api( 'error_api.php' );
61 require_api( 'event_api.php' );
62 require_api( 'form_api.php' );
63 require_api( 'gpc_api.php' );
64 require_api( 'helper_api.php' );
65 require_api( 'html_api.php' );
66 require_api( 'lang_api.php' );
67 require_api( 'last_visited_api.php' );
68 require_api( 'prepare_api.php' );
69 require_api( 'print_api.php' );
70 require_api( 'projax_api.php' );
71 require_api( 'project_api.php' );
72 require_api( 'string_api.php' );
73 require_api( 'user_api.php' );
74 require_api( 'version_api.php' );
76 $g_allow_browser_cache = 1;
78 $f_bug_id = gpc_get_int( 'bug_id' );
80 $tpl_bug = bug_get( $f_bug_id, true );
82 if ( $tpl_bug->project_id != helper_get_current_project() ) {
83 # in case the current project is not the same project of the bug we are viewing...
84 # ... override the current project. This to avoid problems with categories and handlers lists etc.
85 $g_project_override = $tpl_bug->project_id;
86 $tpl_changed_project = true;
87 } else {
88 $tpl_changed_project = false;
91 if ( bug_is_readonly( $f_bug_id ) ) {
92 error_parameters( $f_bug_id );
93 trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
96 access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id );
98 html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
100 print_recently_visited();
102 $t_fields = config_get( 'bug_update_page_fields' );
103 $t_fields = columns_filter_disabled( $t_fields );
105 $tpl_bug_id = $f_bug_id;
107 $t_action_button_position = config_get( 'action_button_position' );
109 $tpl_top_buttons_enabled = $t_action_button_position == POSITION_TOP || $t_action_button_position == POSITION_BOTH;
110 $tpl_bottom_buttons_enabled = $t_action_button_position == POSITION_BOTTOM || $t_action_button_position == POSITION_BOTH;
112 $tpl_show_id = in_array( BUG_FIELD_ID, $t_fields );
113 $tpl_show_project = in_array( BUG_FIELD_PROJECT, $t_fields );
114 $tpl_show_category = in_array( BUG_FIELD_CATEGORY, $t_fields );
115 $tpl_show_view_state = in_array( BUG_FIELD_VIEW_STATE, $t_fields );
116 $tpl_view_state = $tpl_show_view_state ? string_display_line( get_enum_element( 'view_state', $tpl_bug->view_state ) ) : '';
117 $tpl_show_date_submitted = in_array( BUG_FIELD_DATE_SUBMITTED, $t_fields );
118 $tpl_show_last_updated = in_array( BUG_FIELD_LAST_UPDATED, $t_fields );
119 $tpl_show_reporter = in_array( BUG_FIELD_REPORTER, $t_fields );
120 $tpl_show_handler = in_array( BUG_FIELD_HANDLER, $t_fields );
121 $tpl_show_priority = in_array( BUG_FIELD_PRIORITY, $t_fields );
122 $tpl_show_severity = in_array( BUG_FIELD_SEVERITY, $t_fields );
123 $tpl_show_reproducibility = in_array( BUG_FIELD_REPRODUCIBILITY, $t_fields );
124 $tpl_show_status = in_array( BUG_FIELD_STATUS, $t_fields );
125 $tpl_show_resolution = in_array( BUG_FIELD_RESOLUTION, $t_fields );
126 $tpl_show_projection = in_array( BUG_FIELD_PROJECTION, $t_fields ) && config_get( 'enable_projection' ) == ON;
127 $tpl_show_eta = in_array( BUG_FIELD_ETA, $t_fields ) && config_get( 'enable_eta' ) == ON;
128 $t_show_profiles = config_get( 'enable_profiles' ) == ON;
129 $tpl_show_platform = $t_show_profiles && in_array( BUG_FIELD_PLATFORM, $t_fields );
130 $tpl_show_os = $t_show_profiles && in_array( BUG_FIELD_OS, $t_fields );
131 $tpl_show_os_version = $t_show_profiles && in_array( BUG_FIELD_OS_VERSION, $t_fields );
132 $tpl_show_versions = version_should_show_product_version( $tpl_bug->project_id );
133 $tpl_show_product_version = $tpl_show_versions && in_array( BUG_FIELD_PRODUCT_VERSION, $t_fields );
134 $tpl_show_product_build = $tpl_show_versions && in_array( BUG_FIELD_PRODUCT_BUILD, $t_fields ) && ( config_get( 'enable_product_build' ) == ON );
135 $tpl_product_build_attribute = $tpl_show_product_build ? string_attribute( $tpl_bug->build ) : '';
136 $tpl_show_target_version = $tpl_show_versions && in_array( BUG_FIELD_TARGET_VERSION, $t_fields ) && access_has_bug_level( config_get( 'roadmap_update_threshold' ), $tpl_bug_id );
137 $tpl_show_fixed_in_version = $tpl_show_versions && in_array( BUG_FIELD_FIXED_IN_VERSION, $t_fields );
138 $tpl_show_due_date = in_array( BUG_FIELD_DUE_DATE, $t_fields ) && access_has_bug_level( config_get( 'due_date_view_threshold' ), $tpl_bug_id );
139 $tpl_show_summary = in_array( BUG_FIELD_SUMMARY, $t_fields );
140 $tpl_summary_attribute = $tpl_show_summary ? string_attribute( $tpl_bug->summary ) : '';
141 $tpl_show_description = in_array( BUG_FIELD_DESCRIPTION, $t_fields );
142 $tpl_description_textarea = $tpl_show_description ? string_textarea( $tpl_bug->description ) : '';
143 $tpl_show_additional_information = in_array( BUG_FIELD_ADDITIONAL_INFO, $t_fields );
144 $tpl_additional_information_textarea = $tpl_show_additional_information ? string_textarea( $tpl_bug->additional_information ) : '';
145 $tpl_show_steps_to_reproduce = in_array( BUG_FIELD_STEPS_TO_REPRODUCE, $t_fields );
146 $tpl_steps_to_reproduce_textarea = $tpl_show_steps_to_reproduce ? string_textarea( $tpl_bug->steps_to_reproduce ) : '';
147 $tpl_handler_name = string_display_line( user_get_name( $tpl_bug->handler_id ) );
149 $tpl_can_change_view_state = $tpl_show_view_state && access_has_project_level( config_get( 'change_view_status_threshold' ) );
151 if ( $tpl_show_product_version ) {
152 $tpl_product_version_released_mask = VERSION_RELEASED;
154 if ( access_has_project_level( config_get( 'report_issues_for_unreleased_versions_threshold' ) ) ) {
155 $tpl_product_version_released_mask = VERSION_ALL;
159 $tpl_formatted_bug_id = $tpl_show_id ? bug_format_id( $f_bug_id ) : '';
160 $tpl_project_name = $tpl_show_project ? string_display_line( project_get_name( $tpl_bug->project_id ) ) : '';
162 echo '<br />';
163 echo '<form name="update_bug_form" method="post" action="bug_update.php">';
164 echo form_security_field( 'bug_update' );
165 echo '<table class="width100" cellspacing="1">';
166 echo '<tr>';
167 echo '<td class="form-title" colspan="3">';
168 echo '<input type="hidden" name="bug_id" value="', $tpl_bug_id, '" />';
169 echo '<input type="hidden" name="update_mode" value="1" />';
170 echo lang_get( 'updating_bug_advanced_title' );
171 echo '</td><td class="right" colspan="3">';
172 print_bracket_link( string_get_bug_view_url( $tpl_bug_id ), lang_get( 'back_to_bug_link' ) );
173 echo '</td></tr>';
175 # Submit Button
176 if ( $tpl_top_buttons_enabled ) {
177 echo '<tr><td class="center" colspan="6">';
178 echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
179 echo '</td></tr>';
183 event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $tpl_bug_id, true ) );
185 if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted | $tpl_show_last_updated ) {
187 # Titles for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated
190 echo '<tr>';
191 echo '<td width="15%" class="category">', $tpl_show_id ? lang_get( 'id' ) : '', '</td>';
192 echo '<td width="20%" class="category">', $tpl_show_project ? lang_get( 'email_project' ) : '', '</td>';
193 echo '<td width="15%" class="category">', $tpl_show_category ? lang_get( 'category' ) : '', '</td>';
194 echo '<td width="20%" class="category">', $tpl_show_view_state ? lang_get( 'view_status' ) : '', '</td>';
195 echo '<td width="15%" class="category">', $tpl_show_date_submitted ? lang_get( 'date_submitted' ) : '', '</td>';
196 echo '<td width="15%" class="category">', $tpl_show_last_updated ? lang_get( 'last_update' ) : '', '</td>';
197 echo '</tr>';
200 # Values for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated
203 echo '<tr ', helper_alternate_class(), '>';
205 # Bug ID
206 echo '<td>', $tpl_formatted_bug_id, '</td>';
208 # Project Name
209 echo '<td>', $tpl_project_name, '</td>';
211 # Category
212 echo '<td>';
214 if ( $tpl_show_category ) {
215 echo '<select ', helper_get_tab_index(), ' name="category_id">';
216 print_category_option_list( $tpl_bug->category_id, $tpl_bug->project_id );
217 echo '</select>';
220 echo '</td>';
222 # View State
223 echo '<td>';
225 if ( $tpl_can_change_view_state ) {
226 echo '<select ', helper_get_tab_index(), ' name="view_state">';
227 print_enum_string_option_list( 'view_state', $tpl_bug->view_state);
228 echo '</select>';
229 } else if ( $tpl_show_view_state ) {
230 echo $tpl_view_state;
233 echo '</td>';
235 # Date Submitted
236 echo '<td>', $tpl_show_date_submitted ? date( config_get( 'normal_date_format' ), $tpl_bug->date_submitted ) : '', '</td>';
238 # Date Updated
239 echo '<td>', $tpl_show_last_updated ? date( config_get( 'normal_date_format' ), $tpl_bug->last_updated ) : '', '</td>';
241 echo '</tr>';
243 # spacer
244 echo '<tr class="spacer"><td colspan="6"></td></tr>';
248 # Reporter
251 if ( $tpl_show_reporter ) {
252 echo '<tr ', helper_alternate_class(), '>';
254 $t_spacer = 4;
256 if ( $tpl_show_reporter ) {
257 # Reporter
258 echo '<td class="category">', lang_get( 'reporter' ), '</td>';
259 echo '<td>';
261 if ( ON == config_get( 'use_javascript' ) ) {
262 $t_username = prepare_user_name( $tpl_bug->reporter_id );
263 echo ajax_click_to_edit( $t_username, 'reporter_id', 'entrypoint=issue_reporter_combobox&issue_id=' . $tpl_bug_id );
264 } else {
265 echo '<select ', helper_get_tab_index(), ' name="reporter_id">';
266 print_reporter_option_list( $tpl_bug->reporter_id, $tpl_bug->project_id );
267 echo '</select>';
270 echo '</td>';
271 } else {
272 $t_spacer += 2;
275 # spacer
276 echo '<td colspan="', $t_spacer, '">&nbsp;</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 '<td class="category">', lang_get( 'assigned_to' ), '</td>';
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(), ' 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 '<td class="category">', lang_get( 'due_date' ), '</td>';
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 );
322 echo '<input ', helper_get_tab_index(), ' type="text" id="due_date" name="due_date" size="20" maxlength="16" value="', $t_date_to_display, '">';
323 date_print_calendar();
324 date_finish_calendar( 'due_date', 'trigger');
325 } else {
326 if ( !date_is_null( $tpl_bug->due_date ) ) {
327 echo date( config_get( 'short_date_format' ), $tpl_bug->due_date );
331 echo '</td>';
332 } else {
333 $t_spacer += 2;
336 # spacer
337 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
339 echo '</tr>';
343 # Priority, Severity, Reproducibility
346 if ( $tpl_show_priority || $tpl_show_severity || $tpl_show_reproducibility ) {
347 echo '<tr ', helper_alternate_class(), '>';
349 $t_spacer = 0;
351 if ( $tpl_show_priority ) {
352 # Priority
353 echo '<td class="category">', lang_get( 'priority' ), '</td>';
354 echo '<td align="left">', '<select ', helper_get_tab_index(), ' name="priority">';
355 print_enum_string_option_list( 'priority', $tpl_bug->priority );
356 echo '</select></td>';
357 } else {
358 $t_spacer += 2;
361 if ( $tpl_show_severity ) {
362 # Severity
363 echo '<td class="category">', lang_get( 'severity' ), '</td>';
364 echo '<td>', '<select ', helper_get_tab_index(), ' name="severity">';
365 print_enum_string_option_list( 'severity', $tpl_bug->severity );
366 echo '</select></td>';
367 } else {
368 $t_spacer += 2;
371 if ( $tpl_show_reproducibility ) {
372 # Reproducibility
373 echo '<td class="category">', lang_get( 'reproducibility' ), '</td>';
374 echo '<td><select ', helper_get_tab_index(), ' name="reproducibility">';
375 print_enum_string_option_list( 'reproducibility', $tpl_bug->reproducibility );
376 echo '</select></td>';
377 } else {
378 $t_spacer += 2;
381 # spacer
382 if ( $t_spacer > 0 ) {
383 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
386 echo '</tr>';
390 # Status, Resolution
393 if ( $tpl_show_status || $tpl_show_resolution ) {
394 echo '<tr ', helper_alternate_class(), '>';
396 $t_spacer = 2;
398 if ( $tpl_show_status ) {
399 # Status
400 echo '<td class="category">', lang_get( 'status' ), '</td>';
401 echo '<td bgcolor="', get_status_color( $tpl_bug->status ), '">';
402 print_status_option_list( 'status', $tpl_bug->status,
403 ( $tpl_bug->reporter_id == auth_get_current_user_id() &&
404 ( ON == config_get( 'allow_reporter_close' ) ) ), $tpl_bug->project_id );
405 echo '</td>';
406 } else {
407 $t_spacer += 2;
410 if ( $tpl_show_resolution ) {
411 # Resolution
412 echo '<td class="category">', lang_get( 'resolution' ), '</td>';
413 echo '<td><select ', helper_get_tab_index(), ' name="resolution">';
414 print_enum_string_option_list( "resolution", $tpl_bug->resolution );
415 echo '</select></td>';
416 } else {
417 $t_spacer += 2;
420 # spacer
421 if ( $t_spacer > 0 ) {
422 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
425 echo '</tr>';
429 # Projection, ETA
432 if ( $tpl_show_projection || $tpl_show_eta ) {
433 echo '<tr ', helper_alternate_class(), '>';
435 $t_spacer = 2;
437 if ( $tpl_show_projection ) {
438 # Projection
439 echo '<td class="category">';
440 echo lang_get( 'projection' );
441 echo '</td>';
442 echo '<td><select name="projection">';
443 print_enum_string_option_list( 'projection', $tpl_bug->projection );
444 echo '</select></td>';
445 } else {
446 $t_spacer += 2;
449 # ETA
450 if ( $tpl_show_eta ) {
451 echo '<td class="category">', lang_get( 'eta' ), '</td>';
453 echo '<td>', '<select ', helper_get_tab_index(), ' name="eta">';
454 print_enum_string_option_list( 'eta', $tpl_bug->eta );
455 echo '</select></td>';
456 } else {
457 $t_spacer += 2;
460 # spacer
461 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
463 echo '</tr>';
467 # Platform, OS, OS Version
470 if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) {
471 echo '<tr ', helper_alternate_class(), '>';
473 $t_spacer = 0;
475 if ( $tpl_show_platform ) {
476 # Platform
477 echo '<td class="category">', lang_get( 'platform' ), '</td>';
478 echo '<td>';
480 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
481 echo '<select name="platform"><option value=""></option>';
482 print_platform_option_list( $tpl_bug->platform );
483 echo '</select>';
484 } else {
485 projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $tpl_bug->platform, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
488 echo '</td>';
489 } else {
490 $t_spacer += 2;
493 if ( $tpl_show_os ) {
494 # Operating System
495 echo '<td class="category">', lang_get( 'os' ), '</td>';
496 echo '<td>';
498 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
499 echo '<select name="os"><option value=""></option>';
500 print_os_option_list( $tpl_bug->os );
501 echo '</select>';
502 } else {
503 projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $tpl_bug->os, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
506 echo '</td>';
507 } else {
508 $t_spacer += 2;
511 if ( $tpl_show_os_version ) {
512 # OS Version
513 echo '<td class="category">', lang_get( 'os_version' ), '</td>';
514 echo '<td>';
516 if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
517 echo '<select name="os_build"><option value=""></option>';
518 print_os_build_option_list( $tpl_bug->os_build );
519 echo '</select>';
520 } else {
521 projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $tpl_bug->os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
524 echo '</td>';
525 } else {
526 $t_spacer += 2;
529 # spacer
530 if ( $t_spacer > 0 ) {
531 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
534 echo '</tr>';
538 # Product Version, Product Build
541 if ( $tpl_show_product_version || $tpl_show_product_build ) {
542 echo '<tr ', helper_alternate_class(), '>';
544 $t_spacer = 2;
546 # Product Version or Product Build, if version is suppressed
547 if ( $tpl_show_product_version ) {
548 echo '<td class="category">', lang_get( 'product_version' ), '</td>';
549 echo '<td>', '<select ', helper_get_tab_index(), ' name="version">';
550 print_version_option_list( $tpl_bug->version, $tpl_bug->project_id, $tpl_product_version_released_mask );
551 echo '</select></td>';
552 } else {
553 $t_spacer += 2;
556 if ( $tpl_show_product_build ) {
557 echo '<td class="category">', lang_get( 'product_build' ), '</td>';
558 echo '<td>';
559 echo '<input type="text" name="build" size="16" maxlength="32" value="', $tpl_product_build_attribute, '" />';
560 echo '</td>';
561 } else {
562 $t_spacer += 2;
565 # spacer
566 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
568 echo '</tr>';
572 # Target Versiom, Fixed in Version
575 if ( $tpl_show_target_version || $tpl_show_fixed_in_version ) {
576 echo '<tr ', helper_alternate_class(), '>';
578 $t_spacer = 2;
580 # Target Version
581 if ( $tpl_show_target_version ) {
582 echo '<td class="category">', lang_get( 'target_version' ), '</td>';
583 echo '<td><select ', helper_get_tab_index(), ' name="target_version">';
584 print_version_option_list( $tpl_bug->target_version, $tpl_bug->project_id, VERSION_ALL );
585 echo '</select></td>';
586 } else {
587 $t_spacer += 2;
590 # Fixed in Version
591 if ( $tpl_show_fixed_in_version ) {
592 echo '<td class="category">';
593 echo lang_get( 'fixed_in_version' );
594 echo '</td>';
596 echo '<td>';
597 echo '<select ', helper_get_tab_index(), ' name="fixed_in_version">';
598 print_version_option_list( $tpl_bug->fixed_in_version, $tpl_bug->project_id, VERSION_ALL );
599 echo '</select>';
600 echo '</td>';
601 } else {
602 $t_spacer += 2;
605 # spacer
606 echo '<td colspan="', $t_spacer, '">&nbsp;</td>';
608 echo '</tr>';
611 event_signal( 'EVENT_UPDATE_BUG_FORM', array( $tpl_bug_id, true ) );
613 # spacer
614 echo '<tr class="spacer"><td colspan="6"></td></tr>';
616 # Summary
617 if ( $tpl_show_summary ) {
618 echo '<tr ', helper_alternate_class(), '>';
619 echo '<td class="category">', lang_get( 'summary' ), '</td>';
620 echo '<td colspan="5">', '<input ', helper_get_tab_index(), ' type="text" name="summary" size="105" maxlength="128" value="', $tpl_summary_attribute, '" />';
621 echo '</td></tr>';
624 # Description
625 if ( $tpl_show_description ) {
626 echo '<tr ', helper_alternate_class(), '>';
627 echo '<td class="category">', lang_get( 'description' ), '</td>';
628 echo '<td colspan="5">';
629 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" name="description">', $tpl_description_textarea, '</textarea>';
630 echo '</td></tr>';
633 # Steps to Reproduce
634 if ( $tpl_show_steps_to_reproduce ) {
635 echo '<tr ', helper_alternate_class(), '>';
636 echo '<td class="category">', lang_get( 'steps_to_reproduce' ), '</td>';
637 echo '<td colspan="5">';
638 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" name="steps_to_reproduce">', $tpl_steps_to_reproduce_textarea, '</textarea>';
639 echo '</td></tr>';
642 # Additional Information
643 if ( $tpl_show_additional_information ) {
644 echo '<tr ', helper_alternate_class(), '>';
645 echo '<td class="category">', lang_get( 'additional_information' ), '</td>';
646 echo '<td colspan="5">';
647 echo '<textarea ', helper_get_tab_index(), ' cols="80" rows="10" name="additional_information">', $tpl_additional_information_textarea, '</textarea>';
648 echo '</td></tr>';
651 echo '<tr class="spacer"><td colspan="6"></td></tr>';
653 # Custom Fields
654 $t_custom_fields_found = false;
655 $t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
657 foreach ( $t_related_custom_field_ids as $t_id ) {
658 $t_def = custom_field_get_definition( $t_id );
659 if ( ( $t_def['display_update'] || $t_def['require_update'] ) && custom_field_has_write_access( $t_id, $tpl_bug_id ) ) {
660 $t_custom_fields_found = true;
662 echo '<tr ', helper_alternate_class(), '>';
663 echo '<td class="category">';
664 if ( $t_def['require_update'] ) {
665 echo '<span class="required">*</span>';
668 echo string_display( lang_get_defaulted( $t_def['name'] ) );
669 echo '</td><td colspan="5">';
670 print_custom_field_input( $t_def, $tpl_bug_id );
671 echo '</td></tr>';
673 } # foreach( $t_related_custom_field_ids as $t_id )
675 if ( $t_custom_fields_found ) {
676 # spacer
677 echo '<tr class="spacer"><td colspan="6"></td></tr>';
678 } # custom fields found
680 # Bugnote Text Box
681 echo '<tr ', helper_alternate_class(), '>';
682 echo '<td class="category">', lang_get( 'add_bugnote_title' ), '</td>';
683 echo '<td colspan="5"><textarea ', helper_get_tab_index(), ' name="bugnote_text" cols="80" rows="10"></textarea></td></tr>';
685 # Bugnote Private Checkbox (if permitted)
686 if ( access_has_bug_level( config_get( 'private_bugnote_threshold' ), $tpl_bug_id ) ) {
687 echo '<tr ', helper_alternate_class(), '>';
688 echo '<td class="category">', lang_get( 'private' ), '</td>';
689 echo '<td colspan="5">';
691 $t_default_bugnote_view_status = config_get( 'default_bugnote_view_status' );
692 if ( access_has_bug_level( config_get( 'set_view_status_threshold' ), $tpl_bug_id ) ) {
693 echo '<input ', helper_get_tab_index(), ' type="checkbox" name="private" ', check_checked( config_get( 'default_bugnote_view_status' ), VS_PRIVATE ), ' />';
694 echo lang_get( 'private' );
695 } else {
696 echo get_enum_element( 'view_state', $t_default_bugnote_view_status );
699 echo '</td></tr>';
702 # Time Tracking (if permitted)
703 if ( config_get('time_tracking_enabled') ) {
704 if ( access_has_bug_level( config_get( 'time_tracking_edit_threshold' ), $tpl_bug_id ) ) {
705 echo '<tr ', helper_alternate_class(), '>';
706 echo '<td class="category">', lang_get( 'time_tracking' ), ' (HH:MM)</td>';
707 echo '<td colspan="5"><input type="text" name="time_tracking" size="5" value="0:00" /></td></tr>';
711 event_signal( 'EVENT_BUGNOTE_ADD_FORM', array( $tpl_bug_id ) );
713 # Submit Button
714 if ( $tpl_bottom_buttons_enabled ) {
715 echo '<tr><td class="center" colspan="6">';
716 echo '<input ', helper_get_tab_index(), ' type="submit" class="button" value="', lang_get( 'update_information_button' ), '" />';
717 echo '</td></tr>';
720 echo '</table></form>';
722 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' );
723 html_page_bottom();
725 last_visited_issue( $tpl_bug_id );