[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 20 # -------------------------------------------------------- 21 # $Id: bug_view_page.php,v 1.89.2.1 2007-10-13 22:33:03 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 require_once ( 'core.php' ); 26 27 $t_core_path = config_get( 'core_path' ); 28 29 require_once( $t_core_path.'bug_api.php' ); 30 require_once( $t_core_path.'custom_field_api.php' ); 31 require_once( $t_core_path.'compress_api.php' ); 32 require_once( $t_core_path.'current_user_api.php' ); 33 require_once( $t_core_path.'file_api.php' ); 34 require_once( $t_core_path.'date_api.php' ); 35 require_once( $t_core_path.'relationship_api.php' ); 36 require_once( $t_core_path.'last_visited_api.php' ); 37 require_once( $t_core_path.'tag_api.php' ); 38 ?> 39 <?php 40 $f_bug_id = gpc_get_int( 'bug_id' ); 41 $f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) ); 42 43 bug_ensure_exists( $f_bug_id ); 44 45 access_ensure_bug_level( VIEWER, $f_bug_id ); 46 47 $t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) ); 48 49 if( $t_bug->project_id != helper_get_current_project() ) { 50 # in case the current project is not the same project of the bug we are viewing... 51 # ... override the current project. This to avoid problems with categories and handlers lists etc. 52 $g_project_override = $t_bug->project_id; 53 } 54 55 if ( ADVANCED_ONLY == config_get( 'show_view' ) ) { 56 print_header_redirect ( 'bug_view_advanced_page.php?bug_id=' . $f_bug_id ); 57 } 58 59 $t_access_level_needed = config_get( 'view_history_threshold' ); 60 $t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id ); 61 62 compress_enable(); 63 64 $t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false ); 65 66 html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); 67 html_page_top2(); 68 69 print_recently_visited(); 70 ?> 71 72 <br /> 73 <table class="width100" cellspacing="1"> 74 75 76 <tr> 77 78 <!-- Title --> 79 <td class="form-title" colspan="<?php echo $t_bugslist ? '3' : '4' ?>"> 80 <?php echo lang_get( 'viewing_bug_simple_details_title' ) ?> 81 82 <!-- Jump to Bugnotes --> 83 <span class="small"><?php print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) ) ?></span> 84 85 <!-- Send Bug Reminder --> 86 <?php 87 if ( !current_user_is_anonymous() && !bug_is_readonly( $f_bug_id ) && 88 access_has_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id ) ) { 89 ?> 90 <span class="small"> 91 <?php print_bracket_link( 'bug_reminder_page.php?bug_id='.$f_bug_id, lang_get( 'bug_reminder' ) ) ?> 92 </span> 93 <?php 94 } 95 96 if ( wiki_is_enabled() ) { 97 ?> 98 <span class="small"> 99 <?php print_bracket_link( 'wiki.php?id='.$f_bug_id, lang_get( 'wiki' ) ) ?> 100 </span> 101 <?php 102 } 103 ?> 104 </td> 105 106 <!-- prev/next links --> 107 <?php if( $t_bugslist ) { ?> 108 <td class="center"><span class="small"> 109 <?php 110 $t_bugslist = explode( ',', $t_bugslist ); 111 $t_index = array_search( $f_bug_id, $t_bugslist ); 112 if( false !== $t_index ) { 113 if( isset( $t_bugslist[$t_index-1] ) ) print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index-1], '<<' ); 114 if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '>>' ); 115 } 116 ?> 117 </span></td> 118 <?php } ?> 119 120 <!-- Links --> 121 <td class="right" colspan="2"> 122 123 <!-- Advanced View (if enabled) --> 124 <?php if ( BOTH == config_get( 'show_view' ) ) { ?> 125 <span class="small"><?php print_bracket_link( 'bug_view_advanced_page.php?bug_id=' . $f_bug_id, lang_get( 'view_advanced_link' ) )?></span> 126 <?php }?> 127 128 <?php if ( $t_can_view_history ) { ?> 129 <!-- History --> 130 <span class="small"><?php print_bracket_link( 'bug_view_page.php?bug_id=' . $f_bug_id . '&history=1#history', lang_get( 'bug_history' ) ) ?></span> 131 <?php } ?> 132 133 <!-- Print Bug --> 134 <span class="small"><?php print_bracket_link( 'print_bug_page.php?bug_id=' . $f_bug_id, lang_get( 'print' ) ) ?></span> 135 136 </td> 137 138 </tr> 139 140 141 <!-- Labels --> 142 <tr class="row-category"> 143 <td> 144 <?php echo lang_get( 'id' ) ?> 145 </td> 146 <td> 147 <?php echo lang_get( 'category' ) ?> 148 </td> 149 <td> 150 <?php echo lang_get( 'severity' ) ?> 151 </td> 152 <td> 153 <?php echo lang_get( 'reproducibility' ) ?> 154 </td> 155 <td> 156 <?php echo lang_get( 'date_submitted' ) ?> 157 </td> 158 <td> 159 <?php echo lang_get( 'last_update' ) ?> 160 </td> 161 </tr> 162 163 164 <tr <?php echo helper_alternate_class() ?>> 165 166 <!-- Bug ID --> 167 <td> 168 <?php echo bug_format_id( $f_bug_id ) ?> 169 </td> 170 171 <!-- Category --> 172 <td> 173 <?php 174 $t_project_name = string_display( project_get_field( $t_bug->project_id, 'name' ) ); 175 echo "[$t_project_name] $t_bug->category"; 176 ?> 177 </td> 178 179 <!-- Severity --> 180 <td> 181 <?php echo get_enum_element( 'severity', $t_bug->severity ) ?> 182 </td> 183 184 <!-- Reproducibility --> 185 <td> 186 <?php echo get_enum_element( 'reproducibility', $t_bug->reproducibility ) ?> 187 </td> 188 189 <!-- Date Submitted --> 190 <td> 191 <?php print_date( config_get( 'normal_date_format' ), $t_bug->date_submitted ) ?> 192 </td> 193 194 <!-- Date Updated --> 195 <td> 196 <?php print_date( config_get( 'normal_date_format' ), $t_bug->last_updated ) ?> 197 </td> 198 199 </tr> 200 201 202 <!-- spacer --> 203 <tr class="spacer"> 204 <td colspan="6"></td> 205 </tr> 206 207 208 <tr <?php echo helper_alternate_class() ?>> 209 210 <!-- Reporter --> 211 <td class="category"> 212 <?php echo lang_get( 'reporter' ) ?> 213 </td> 214 <td> 215 <?php print_user_with_subject( $t_bug->reporter_id, $f_bug_id ) ?> 216 </td> 217 218 <!-- View Status --> 219 <td class="category"> 220 <?php echo lang_get( 'view_status' ) ?> 221 </td> 222 <td> 223 <?php echo get_enum_element( 'project_view_state', $t_bug->view_state ) ?> 224 </td> 225 226 <!-- spacer --> 227 <td colspan="2"> </td> 228 </tr> 229 230 231 <!-- Handler --> 232 <tr <?php echo helper_alternate_class() ?>> 233 <td class="category"> 234 <?php echo lang_get( 'assigned_to' ) ?> 235 </td> 236 <td colspan="5"> 237 <?php 238 if ( access_has_bug_level( config_get( 'view_handler_threshold' ), $f_bug_id ) ) { 239 print_user_with_subject( $t_bug->handler_id, $f_bug_id ); 240 } 241 ?> 242 </td> 243 </tr> 244 245 246 <tr <?php echo helper_alternate_class() ?>> 247 248 <!-- Priority --> 249 <td class="category"> 250 <?php echo lang_get( 'priority' ) ?> 251 </td> 252 <td> 253 <?php echo get_enum_element( 'priority', $t_bug->priority ) ?> 254 </td> 255 256 <!-- Resolution --> 257 <td class="category"> 258 <?php echo lang_get( 'resolution' ) ?> 259 </td> 260 <td> 261 <?php echo get_enum_element( 'resolution', $t_bug->resolution ) ?> 262 </td> 263 264 <!-- spacer --> 265 <td colspan="2"> </td> 266 </tr> 267 268 269 <tr <?php echo helper_alternate_class() ?>> 270 271 <!-- Status --> 272 <td class="category"> 273 <?php echo lang_get( 'status' ) ?> 274 </td> 275 <td bgcolor="<?php echo get_status_color( $t_bug->status ) ?>"> 276 <?php echo get_enum_element( 'status', $t_bug->status ) ?> 277 </td> 278 279 <?php 280 # MASC RELATIONSHIP 281 if ( OFF == config_get( 'enable_relationship' ) ) { 282 # Duplicate ID 283 echo '<td class="category">', lang_get( 'duplicate_id' ), ' </td>'; 284 echo '<td>'; 285 print_duplicate_id( $t_bug->duplicate_id ); 286 echo '</td>'; 287 } else { 288 # spacer 289 echo '<td colspan="2"> </td>'; 290 } 291 ?> 292 293 <!-- Product Version --> 294 <?php 295 $t_show_version = ( ON == config_get( 'show_product_version' ) ) 296 || ( ( AUTO == config_get( 'show_product_version' ) ) 297 && ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) ); 298 if ( $t_show_version ) { 299 ?> 300 <td class="category"> 301 <?php echo lang_get( 'product_version' ) ?> 302 </td> 303 <td> 304 <?php echo $t_bug->version ?> 305 </td> 306 <?php 307 } else { 308 ?> 309 <td> 310 </td> 311 <td> 312 </td> 313 <?php 314 } 315 ?> 316 </tr> 317 318 319 <!-- spacer --> 320 <tr class="spacer"> 321 <td colspan="6"></td> 322 </tr> 323 324 325 <!-- Summary --> 326 <tr <?php echo helper_alternate_class() ?>> 327 <td class="category"> 328 <?php echo lang_get( 'summary' ) ?> 329 </td> 330 <td colspan="5"> 331 <?php echo bug_format_summary( $f_bug_id, SUMMARY_FIELD ) ?> 332 </td> 333 </tr> 334 335 336 <!-- Description --> 337 <tr <?php echo helper_alternate_class() ?>> 338 <td class="category"> 339 <?php echo lang_get( 'description' ) ?> 340 </td> 341 <td colspan="5"> 342 <?php echo $t_bug->description ?> 343 </td> 344 </tr> 345 346 347 <!-- Additional Information --> 348 <tr <?php echo helper_alternate_class() ?>> 349 <td class="category"> 350 <?php echo lang_get( 'additional_information' ) ?> 351 </td> 352 <td colspan="5"> 353 <?php echo $t_bug->additional_information ?> 354 </td> 355 </tr> 356 357 <!-- Tagging --> 358 <?php if ( access_has_global_level( config_get( 'tag_view_threshold' ) ) ) { ?> 359 <tr <?php echo helper_alternate_class() ?>> 360 <td class="category"><?php echo lang_get( 'tags' ) ?></td> 361 <td colspan="5"> 362 <?php 363 tag_display_attached( $f_bug_id ); 364 ?> 365 </td> 366 </tr> 367 <?php } # has tag_view access ?> 368 369 <?php if ( access_has_bug_level( config_get( 'tag_attach_threshold' ), $f_bug_id ) ) { ?> 370 <tr <?php echo helper_alternate_class() ?>> 371 <td class="category"><?php echo lang_get( 'tag_attach_long' ) ?></td> 372 <td colspan="5"> 373 <?php 374 print_tag_attach_form( $f_bug_id ); 375 ?> 376 </td> 377 </tr> 378 <?php } # has tag attach access ?> 379 380 381 <!-- spacer --> 382 <tr class="spacer"> 383 <td colspan="6"></td> 384 </tr> 385 386 387 <!-- Custom Fields --> 388 <?php 389 $t_custom_fields_found = false; 390 $t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id ); 391 foreach( $t_related_custom_field_ids as $t_id ) { 392 $t_def = custom_field_get_definition( $t_id ); 393 if( !$t_def['advanced'] && custom_field_has_read_access( $t_id, $f_bug_id ) ) { 394 $t_custom_fields_found = true; 395 ?> 396 <tr <?php echo helper_alternate_class() ?>> 397 <td class="category"> 398 <?php echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?> 399 </td> 400 <td colspan="5"> 401 <?php print_custom_field_value( $t_def, $t_id, $f_bug_id ); ?> 402 </td> 403 </tr> 404 <?php 405 } # !$t_def['advanced'] && has read access 406 } # foreach 407 ?> 408 409 410 <?php if ( $t_custom_fields_found ) { ?> 411 <!-- spacer --> 412 <tr class="spacer"> 413 <td colspan="6"></td> 414 </tr> 415 <?php } # custom fields found ?> 416 417 418 <!-- Attachments --> 419 <?php 420 $t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id ); 421 422 if ( $t_show_attachments ) { 423 ?> 424 <tr <?php echo helper_alternate_class() ?>> 425 <td class="category"> 426 <a name="attachments" id="attachments" /> 427 <?php echo lang_get( 'attached_files' ) ?> 428 </td> 429 <td colspan="5"> 430 <?php file_list_attachments ( $f_bug_id ); ?> 431 </td> 432 </tr> 433 <?php 434 } 435 ?> 436 437 <!-- Buttons --> 438 <tr align="center"> 439 <td align="center" colspan="6"> 440 <?php 441 html_buttons_view_bug_page( $f_bug_id ); 442 ?> 443 </td> 444 </tr> 445 446 447 </table> 448 449 <?php 450 $t_mantis_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; 451 452 # User list sponsoring the bug 453 include ( $t_mantis_dir . 'bug_sponsorship_list_view_inc.php' ); 454 455 # Bug Relationships 456 # MASC RELATIONSHIP 457 if ( ON == config_get( 'enable_relationship' ) ) { 458 relationship_view_box ( $f_bug_id ); 459 } 460 # MASC RELATIONSHIP 461 462 # File upload box 463 if ( !bug_is_readonly( $f_bug_id ) ) { 464 include ( $t_mantis_dir . 'bug_file_upload_inc.php' ); 465 } 466 467 # User list monitoring the bug 468 include ( $t_mantis_dir . 'bug_monitor_list_view_inc.php' ); 469 470 # Bugnotes and "Add Note" box 471 if ( 'ASC' == current_user_get_pref( 'bugnote_order' ) ) { 472 include ( $t_mantis_dir . 'bugnote_view_inc.php' ); 473 include ( $t_mantis_dir . 'bugnote_add_inc.php' ); 474 } else { 475 include ( $t_mantis_dir . 'bugnote_add_inc.php' ); 476 include ( $t_mantis_dir . 'bugnote_view_inc.php' ); 477 } 478 479 # Time Tracking stats 480 if ( config_get('time_tracking_enabled') && 481 access_has_bug_level( config_get( 'time_tracking_reporting_threshold' ), $f_bug_id ) ) { 482 include ( $t_mantis_dir . 'bugnote_stats_inc.php' ); 483 } 484 # History 485 if ( $f_history ) { 486 include ( $t_mantis_dir . 'history_inc.php' ); 487 } 488 489 html_page_bottom1( __FILE__ ); 490 491 last_visited_issue( $f_bug_id ); 492 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |