| [ Index ] |
PHP Cross Reference of MantisBT |
[Summary view] [Print] [Text view]
1 <?php 2 # MantisBT - A PHP based bugtracking system 3 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. 8 # 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. 13 # 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/>. 16 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 22 * 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 45 */ 46 47 /** 48 * MantisBT Core API's 49 */ 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' ); 72 73 require_css( 'status_config.php' ); 74 75 $g_allow_browser_cache = 1; 76 77 $f_bug_id = gpc_get_int( 'bug_id' ); 78 79 $tpl_bug = bug_get( $f_bug_id, true ); 80 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; 88 } 89 90 if ( bug_is_readonly( $f_bug_id ) ) { 91 error_parameters( $f_bug_id ); 92 trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR ); 93 } 94 95 access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id ); 96 97 $t_fields = config_get( 'bug_update_page_fields' ); 98 $t_fields = columns_filter_disabled( $t_fields ); 99 100 $tpl_bug_id = $f_bug_id; 101 102 $t_action_button_position = config_get( 'action_button_position' ); 103 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; 106 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 ) ); 143 144 $tpl_can_change_view_state = $tpl_show_view_state && access_has_project_level( config_get( 'change_view_status_threshold' ) ); 145 146 if ( $tpl_show_product_version ) { 147 $tpl_product_version_released_mask = VERSION_RELEASED; 148 149 if ( access_has_project_level( config_get( 'report_issues_for_unreleased_versions_threshold' ) ) ) { 150 $tpl_product_version_released_mask = VERSION_ALL; 151 } 152 } 153 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 ) ) : ''; 156 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' ); 162 } 163 164 html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); 165 166 print_recently_visited(); 167 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>'; 179 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>'; 185 } 186 187 188 event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $tpl_bug_id, true ) ); 189 190 if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted | $tpl_show_last_updated ) { 191 # 192 # Titles for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated 193 # 194 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>'; 203 204 # 205 # Values for Bug Id, Project Name, Category, View State, Date Submitted, Last Updated 206 # 207 208 echo '<tr ', helper_alternate_class(), '>'; 209 210 # Bug ID 211 echo '<td>', $tpl_formatted_bug_id, '</td>'; 212 213 # Project Name 214 echo '<td>', $tpl_project_name, '</td>'; 215 216 # Category 217 echo '<td>'; 218 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>'; 223 } 224 225 echo '</td>'; 226 227 # View State 228 echo '<td>'; 229 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; 236 } 237 238 echo '</td>'; 239 240 # Date Submitted 241 echo '<td>', $tpl_show_date_submitted ? date( config_get( 'normal_date_format' ), $tpl_bug->date_submitted ) : '', '</td>'; 242 243 # Date Updated 244 echo '<td>', $tpl_show_last_updated ? date( config_get( 'normal_date_format' ), $tpl_bug->last_updated ) : '', '</td>'; 245 246 echo '</tr>'; 247 248 # spacer 249 echo '<tr class="spacer"><td colspan="6"></td></tr>'; 250 } 251 252 # 253 # Reporter 254 # 255 256 if ( $tpl_show_reporter ) { 257 echo '<tr ', helper_alternate_class(), '>'; 258 259 $t_spacer = 4; 260 261 if ( $tpl_show_reporter ) { 262 # Reporter 263 echo '<th class="category"><label for="reporter_id">' . lang_get( 'reporter' ) . '</label></th>'; 264 echo '<td>'; 265 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>'; 269 270 echo '</td>'; 271 } else { 272 $t_spacer += 2; 273 } 274 275 # spacer 276 echo '<td colspan="', $t_spacer, '"> </td>'; 277 278 echo '</tr>'; 279 } 280 281 # 282 # Assigned To, Due Date 283 # 284 285 if ( $tpl_show_handler || $tpl_show_due_date ) { 286 echo '<tr ', helper_alternate_class(), '>'; 287 288 $t_spacer = 2; 289 290 # Assigned To 291 echo '<th class="category"><label for="handler_id">' . lang_get( 'assigned_to' ) . '</label></th>'; 292 echo '<td>'; 293 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; 301 } 302 303 echo '</td>'; 304 305 if ( $tpl_show_due_date ) { 306 # Due Date 307 echo '<th class="category"><label for="due_date">' . lang_get( 'due_date' ) . '</label></th>'; 308 309 if ( bug_is_overdue( $tpl_bug_id ) ) { 310 echo '<td class="overdue">'; 311 } else { 312 echo '<td>'; 313 } 314 315 if ( access_has_bug_level( config_get( 'due_date_update_threshold' ), $tpl_bug_id ) ) { 316 $t_date_to_display = ''; 317 318 if ( !date_is_null( $tpl_bug->due_date ) ) { 319 $t_date_to_display = date( config_get( 'calendar_date_format' ), $tpl_bug->due_date ); 320 } 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 ); 325 } 326 } 327 328 echo '</td>'; 329 } else { 330 $t_spacer += 2; 331 } 332 333 # spacer 334 echo '<td colspan="', $t_spacer, '"> </td>'; 335 336 echo '</tr>'; 337 } 338 339 # 340 # Priority, Severity, Reproducibility 341 # 342 343 if ( $tpl_show_priority || $tpl_show_severity || $tpl_show_reproducibility ) { 344 echo '<tr ', helper_alternate_class(), '>'; 345 346 $t_spacer = 0; 347 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; 356 } 357 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; 366 } 367 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; 376 } 377 378 # spacer 379 if ( $t_spacer > 0 ) { 380 echo '<td colspan="', $t_spacer, '"> </td>'; 381 } 382 383 echo '</tr>'; 384 } 385 386 # 387 # Status, Resolution 388 # 389 390 if ( $tpl_show_status || $tpl_show_resolution ) { 391 echo '<tr ', helper_alternate_class(), '>'; 392 393 $t_spacer = 2; 394 395 if ( $tpl_show_status ) { 396 # Status 397 echo '<th class="category"><label for="status">' . lang_get( 'status' ) . '</label></th>'; 398 399 # choose color based on status 400 $status_label = html_get_status_css_class( $tpl_bug->status ); 401 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; 409 } 410 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; 419 } 420 421 # spacer 422 if ( $t_spacer > 0 ) { 423 echo '<td colspan="', $t_spacer, '"> </td>'; 424 } 425 426 echo '</tr>'; 427 } 428 429 # 430 # Projection, ETA 431 # 432 433 if ( $tpl_show_projection || $tpl_show_eta ) { 434 echo '<tr ', helper_alternate_class(), '>'; 435 436 $t_spacer = 2; 437 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; 446 } 447 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; 456 } 457 458 # spacer 459 echo '<td colspan="', $t_spacer, '"> </td>'; 460 461 echo '</tr>'; 462 } 463 464 # 465 # Platform, OS, OS Version 466 # 467 468 if ( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) { 469 echo '<tr ', helper_alternate_class(), '>'; 470 471 $t_spacer = 0; 472 473 if ( $tpl_show_platform ) { 474 # Platform 475 echo '<th class="category"><label for="platform">' . lang_get( 'platform' ) . '</label></th>'; 476 echo '<td>'; 477 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 ) . '" />'; 484 } 485 486 echo '</td>'; 487 } else { 488 $t_spacer += 2; 489 } 490 491 if ( $tpl_show_os ) { 492 # Operating System 493 echo '<th class="category"><label for="os">' . lang_get( 'os' ) . '</label></th>'; 494 echo '<td>'; 495 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 ) . '" />'; 502 } 503 504 echo '</td>'; 505 } else { 506 $t_spacer += 2; 507 } 508 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>'; 513 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 ) . '" />'; 520 } 521 522 echo '</td>'; 523 } else { 524 $t_spacer += 2; 525 } 526 527 # spacer 528 if ( $t_spacer > 0 ) { 529 echo '<td colspan="', $t_spacer, '"> </td>'; 530 } 531 532 echo '</tr>'; 533 } 534 535 # 536 # Product Version, Product Build 537 # 538 539 if ( $tpl_show_product_version || $tpl_show_product_build ) { 540 echo '<tr ', helper_alternate_class(), '>'; 541 542 $t_spacer = 2; 543 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; 552 } 553 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; 561 } 562 563 # spacer 564 echo '<td colspan="', $t_spacer, '"> </td>'; 565 566 echo '</tr>'; 567 } 568 569 # 570 # Target Version, Fixed in Version 571 # 572 573 if ( $tpl_show_target_version || $tpl_show_fixed_in_version ) { 574 echo '<tr ', helper_alternate_class(), '>'; 575 576 $t_spacer = 2; 577 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; 586 } 587 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; 598 } 599 600 # spacer 601 echo '<td colspan="', $t_spacer, '"> </td>'; 602 603 echo '</tr>'; 604 } 605 606 event_signal( 'EVENT_UPDATE_BUG_FORM', array( $tpl_bug_id, true ) ); 607 608 # spacer 609 echo '<tr class="spacer"><td colspan="6"></td></tr>'; 610 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>'; 617 } 618 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>'; 626 } 627 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>'; 635 } 636 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>'; 644 } 645 646 echo '<tr class="spacer"><td colspan="6"></td></tr>'; 647 648 # Custom Fields 649 $t_custom_fields_found = false; 650 $t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id ); 651 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; 656 657 echo '<tr ', helper_alternate_class(), '>'; 658 echo '<td class="category">'; 659 if ( $t_def['require_update'] ) { 660 echo '<span class="required">*</span>'; 661 } 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'] ) ); 666 } 667 echo '</td><td colspan="5">'; 668 print_custom_field_input( $t_def, $tpl_bug_id ); 669 echo '</td></tr>'; 670 } 671 } # foreach( $t_related_custom_field_ids as $t_id ) 672 673 if ( $t_custom_fields_found ) { 674 # spacer 675 echo '<tr class="spacer"><td colspan="6"></td></tr>'; 676 } # custom fields found 677 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>'; 682 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">'; 688 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 ); 695 } 696 697 echo '</td></tr>'; 698 } 699 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>'; 706 } 707 } 708 709 event_signal( 'EVENT_BUGNOTE_ADD_FORM', array( $tpl_bug_id ) ); 710 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>'; 716 } 717 718 echo '</table></form>'; 719 720 define( 'BUGNOTE_VIEW_INC_ALLOW', true ); 721 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' ); 722 html_page_bottom(); 723 724 last_visited_issue( $tpl_bug_id );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jul 28 15:48:31 2011 | Cross-referenced by PHPXref 0.7 |