[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> bug_view_advanced_page.php (source)

   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_advanced_page.php,v 1.87.2.1 2007-10-13 22:32:59 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      require_once ( 'core.php' );
  25  
  26      $t_core_path = config_get( 'core_path' );
  27  
  28      require_once( $t_core_path.'bug_api.php' );
  29      require_once( $t_core_path.'custom_field_api.php' );
  30      require_once( $t_core_path.'file_api.php' );
  31      require_once( $t_core_path.'compress_api.php' );
  32      require_once( $t_core_path.'date_api.php' );
  33      require_once( $t_core_path.'relationship_api.php' );
  34      require_once( $t_core_path.'last_visited_api.php' );
  35      require_once( $t_core_path.'tag_api.php' );
  36  
  37      $f_bug_id        = gpc_get_int( 'bug_id' );
  38      $f_history        = gpc_get_bool( 'history', config_get( 'history_default_visible' ) );
  39  
  40      bug_ensure_exists( $f_bug_id );
  41  
  42      access_ensure_bug_level( VIEWER, $f_bug_id );
  43  
  44      $t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) );
  45  
  46      if( $t_bug->project_id != helper_get_current_project() ) {
  47          # in case the current project is not the same project of the bug we are viewing...
  48          # ... override the current project. This to avoid problems with categories and handlers lists etc.
  49          $g_project_override = $t_bug->project_id;
  50      }
  51  
  52      if ( SIMPLE_ONLY == config_get( 'show_view' ) ) {
  53          print_header_redirect ( 'bug_view_page.php?bug_id=' . $f_bug_id );
  54      }
  55  
  56      compress_enable();
  57  
  58      html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
  59      html_page_top2();
  60  
  61      print_recently_visited();
  62  
  63      $t_access_level_needed = config_get( 'view_history_threshold' );
  64      $t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id );
  65  
  66      $t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
  67  ?>
  68  
  69  <br />
  70  <table class="width100" cellspacing="1">
  71  
  72  
  73  <tr>
  74  
  75      <!-- Title -->
  76      <td class="form-title" colspan="<?php echo $t_bugslist ? '3' : '4' ?>">
  77          <?php echo lang_get( 'viewing_bug_advanced_details_title' ) ?>
  78  
  79          <!-- Jump to Bugnotes -->
  80          <span class="small"><?php print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) ) ?></span>
  81  
  82          <!-- Send Bug Reminder -->
  83      <?php
  84          if ( !current_user_is_anonymous() && !bug_is_readonly( $f_bug_id ) &&
  85                access_has_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id ) ) {
  86      ?>
  87          <span class="small">
  88              <?php print_bracket_link( 'bug_reminder_page.php?bug_id='.$f_bug_id, lang_get( 'bug_reminder' ) ) ?>
  89          </span>
  90      <?php
  91          }
  92          
  93          if ( wiki_is_enabled() ) {
  94      ?>
  95          <span class="small">
  96              <?php print_bracket_link( 'wiki.php?id='.$f_bug_id, lang_get( 'wiki' ) ) ?>
  97          </span>
  98      <?php
  99          }
 100      ?>
 101      </td>
 102  
 103      <!-- prev/next links -->
 104      <?php if( $t_bugslist ) { ?>
 105      <td class="center"><span class="small">
 106          <?php
 107              $t_bugslist = explode( ',', $t_bugslist );
 108              $t_index = array_search( $f_bug_id, $t_bugslist );
 109              if( false !== $t_index ) {
 110                  if( isset( $t_bugslist[$t_index-1] ) ) print_bracket_link( 'bug_view_advanced_page.php?bug_id='.$t_bugslist[$t_index-1], '&lt;&lt;' );
 111                  if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_advanced_page.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;' );
 112              }
 113          ?>
 114      </span></td>
 115      <?php } ?>
 116  
 117      <!-- Links -->
 118      <td class="right" colspan="2">
 119  
 120          <!-- Simple View (if enabled) -->
 121      <?php if ( BOTH == config_get( 'show_view' ) ) { ?>
 122              <span class="small"><?php print_bracket_link( 'bug_view_page.php?bug_id=' . $f_bug_id, lang_get( 'view_simple_link' ) ) ?></span>
 123      <?php } ?>
 124  
 125      <?php if ( $t_can_view_history ) { ?>
 126          <!-- History -->
 127          <span class="small"><?php print_bracket_link( 'bug_view_advanced_page.php?bug_id=' . $f_bug_id . '&amp;history=1#history', lang_get( 'bug_history' ) ) ?></span>
 128      <?php } ?>
 129  
 130          <!-- Print Bug -->
 131          <span class="small"><?php print_bracket_link( 'print_bug_page.php?bug_id=' . $f_bug_id, lang_get( 'print' ) ) ?></span>
 132  
 133      </td>
 134  
 135  </tr>
 136  
 137  
 138  <!-- Labels -->
 139  <tr class="row-category">
 140      <td width="15%">
 141          <?php echo lang_get( 'id' ) ?>
 142      </td>
 143      <td width="20%">
 144          <?php echo lang_get( 'category' ) ?>
 145      </td>
 146      <td width="15%">
 147          <?php echo lang_get( 'severity' ) ?>
 148      </td>
 149      <td width="20%">
 150          <?php echo lang_get( 'reproducibility' ) ?>
 151      </td>
 152      <td width="15%">
 153          <?php echo lang_get( 'date_submitted' ) ?>
 154      </td>
 155      <td width="15%">
 156          <?php echo lang_get( 'last_update' ) ?>
 157      </td>
 158  </tr>
 159  
 160  
 161  <tr <?php echo helper_alternate_class() ?>>
 162  
 163      <!-- Bug ID -->
 164      <td>
 165          <?php echo bug_format_id( $f_bug_id ) ?>
 166      </td>
 167  
 168      <!-- Category -->
 169      <td>
 170          <?php
 171              $t_project_name = string_display( project_get_field( $t_bug->project_id, 'name' ) );
 172              echo "[$t_project_name] $t_bug->category";
 173          ?>
 174      </td>
 175  
 176      <!-- Severity -->
 177      <td>
 178          <?php echo get_enum_element( 'severity', $t_bug->severity ) ?>
 179      </td>
 180  
 181      <!-- Reproducibility -->
 182      <td>
 183          <?php echo get_enum_element( 'reproducibility', $t_bug->reproducibility ) ?>
 184      </td>
 185  
 186      <!-- Date Submitted -->
 187      <td>
 188          <?php print_date( config_get( 'normal_date_format' ), $t_bug->date_submitted ) ?>
 189      </td>
 190  
 191      <!-- Date Updated -->
 192      <td>
 193          <?php print_date( config_get( 'normal_date_format' ), $t_bug->last_updated ) ?>
 194      </td>
 195  
 196  </tr>
 197  
 198  
 199  <!-- spacer -->
 200  <tr class="spacer">
 201      <td colspan="6"></td>
 202  </tr>
 203  
 204  
 205  <tr <?php echo helper_alternate_class() ?>>
 206  
 207      <!-- Reporter -->
 208      <td class="category">
 209          <?php echo lang_get( 'reporter' ) ?>
 210      </td>
 211      <td>
 212          <?php print_user_with_subject( $t_bug->reporter_id, $f_bug_id ) ?>
 213      </td>
 214  
 215      <!-- View Status -->
 216      <td class="category">
 217          <?php echo lang_get( 'view_status' ) ?>
 218      </td>
 219      <td>
 220          <?php echo get_enum_element( 'project_view_state', $t_bug->view_state ) ?>
 221      </td>
 222  
 223      <!-- spacer -->
 224      <td colspan="2">&nbsp;</td>
 225  
 226  </tr>
 227  
 228  
 229  <!-- Handler -->
 230  <tr <?php echo helper_alternate_class() ?>>
 231      <td class="category">
 232          <?php echo lang_get( 'assigned_to' ) ?>
 233      </td>
 234      <td colspan="5">
 235          <?php 
 236              if ( access_has_bug_level( config_get( 'view_handler_threshold' ), $f_bug_id ) ) {
 237                  print_user_with_subject( $t_bug->handler_id, $f_bug_id );
 238              }
 239          ?>
 240      </td>
 241  </tr>
 242  
 243  
 244  <tr <?php echo helper_alternate_class() ?>>
 245  
 246      <!-- Priority -->
 247      <td class="category">
 248          <?php echo lang_get( 'priority' ) ?>
 249      </td>
 250      <td>
 251          <?php echo get_enum_element( 'priority', $t_bug->priority ) ?>
 252      </td>
 253  
 254      <!-- Resolution -->
 255      <td class="category">
 256          <?php echo lang_get( 'resolution' ) ?>
 257      </td>
 258      <td>
 259          <?php echo get_enum_element( 'resolution', $t_bug->resolution ) ?>
 260      </td>
 261  
 262      <!-- Platform -->
 263      <td class="category">
 264          <?php echo lang_get( 'platform' ) ?>
 265      </td>
 266      <td>
 267          <?php echo $t_bug->platform ?>
 268      </td>
 269  
 270  </tr>
 271  
 272  
 273  <tr <?php echo helper_alternate_class() ?>>
 274  
 275      <!-- Status -->
 276      <td class="category">
 277          <?php echo lang_get( 'status' ) ?>
 278      </td>
 279      <td bgcolor="<?php echo get_status_color( $t_bug->status ) ?>">
 280          <?php echo get_enum_element( 'status', $t_bug->status ) ?>
 281      </td>
 282  
 283      <?php
 284          # Duplicate Id
 285          # MASC RELATIONSHIP
 286          if ( OFF == config_get( 'enable_relationship' ) ) {
 287              # Duplicate ID
 288              echo '<td class="category">', lang_get( 'duplicate_id' ), '&nbsp;</td>';
 289              echo '<td>';
 290              print_duplicate_id( $t_bug->duplicate_id );
 291              echo '</td>';
 292          } else {
 293              # spacer
 294              echo '<td colspan="2">&nbsp;</td>';
 295          }
 296      ?>
 297  
 298      <!-- Operating System -->
 299      <td class="category">
 300          <?php echo lang_get( 'os' ) ?>
 301      </td>
 302      <td>
 303          <?php echo $t_bug->os ?>
 304      </td>
 305  
 306  </tr>
 307  
 308  
 309  <tr <?php echo helper_alternate_class() ?>>
 310  
 311      <!-- Projection -->
 312      <td class="category">
 313          <?php echo lang_get( 'projection' ) ?>
 314      </td>
 315      <td>
 316          <?php echo get_enum_element( 'projection', $t_bug->projection ) ?>
 317      </td>
 318  
 319      <!-- spacer -->
 320      <td colspan="2">&nbsp;</td>
 321  
 322      <!-- OS Version -->
 323      <td class="category">
 324          <?php echo lang_get( 'os_version' ) ?>
 325      </td>
 326      <td>
 327          <?php echo $t_bug->os_build ?>
 328      </td>
 329  
 330  </tr>
 331  
 332  
 333  <tr <?php echo helper_alternate_class() ?>>
 334  
 335      <!-- ETA -->
 336      <td class="category">
 337          <?php echo lang_get( 'eta' ) ?>
 338      </td>
 339      <td>
 340          <?php echo get_enum_element( 'eta', $t_bug->eta ) ?>
 341      </td>
 342  
 343      <!-- fixed in version -->
 344          <?php
 345              $t_show_version = ( ON == config_get( 'show_product_version' ) )
 346                      || ( ( AUTO == config_get( 'show_product_version' ) )
 347                                  && ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) );
 348              if ( $t_show_version ) {
 349          ?>
 350      <td class="category">
 351          <?php echo lang_get( 'fixed_in_version' ) ?>
 352      </td>
 353      <td>
 354          <?php echo $t_bug->fixed_in_version ?>
 355      </td>
 356          <?php
 357              } else {
 358          ?>
 359      <td>
 360      </td>
 361      <td>
 362      </td>
 363          <?php
 364              }
 365          ?>
 366      <!-- Product Version or Product Build, if version is suppressed -->
 367          <?php
 368              if ( $t_show_version ) {
 369          ?>
 370      <td class="category">
 371          <?php echo lang_get( 'product_version' ) ?>
 372      </td>
 373      <td>
 374          <?php echo $t_bug->version ?>
 375      </td>
 376          <?php
 377              } else {
 378          ?>
 379      <td class="category">
 380          <?php echo lang_get( 'product_build' ) ?>
 381      </td>
 382      <td>
 383          <?php echo $t_bug->build ?>
 384      </td>
 385          <?php
 386              }
 387          ?>
 388  
 389  </tr>
 390  
 391  <?php
 392      if( $t_show_version ) {
 393  ?>
 394  <tr <?php echo helper_alternate_class() ?>>
 395  
 396  <?php
 397      if ( access_has_bug_level( config_get( 'roadmap_view_threshold' ), $f_bug_id ) ) {
 398  ?>
 399      <!-- spacer -->
 400      <td colspan="2">&nbsp;</td>
 401  
 402      <!-- Target Version -->
 403      <td class="category">
 404          <?php echo lang_get( 'target_version' ) ?>
 405      </td>
 406      <td>
 407          <?php echo $t_bug->target_version ?>
 408      </td>
 409  <?php
 410      } else {
 411  ?>
 412      <!-- spacer -->
 413      <td colspan="4">&nbsp;</td>
 414  <?php
 415      }
 416  ?>
 417  
 418      <!-- Product Build -->
 419      <td class="category">
 420          <?php echo lang_get( 'product_build' ) ?>
 421      </td>
 422      <td>
 423          <?php echo $t_bug->build?>
 424      </td>
 425  
 426  </tr>
 427  <?php
 428      }
 429  ?>
 430  
 431  <!-- spacer -->
 432  <tr class="spacer">
 433      <td colspan="6"></td>
 434  </tr>
 435  
 436  
 437  <!-- Summary -->
 438  <tr <?php echo helper_alternate_class() ?>>
 439      <td class="category">
 440          <?php echo lang_get( 'summary' ) ?>
 441      </td>
 442      <td colspan="5">
 443          <?php echo bug_format_summary( $f_bug_id, SUMMARY_FIELD ) ?>
 444      </td>
 445  </tr>
 446  
 447  
 448  <!-- Description -->
 449  <tr <?php echo helper_alternate_class() ?>>
 450      <td class="category">
 451          <?php echo lang_get( 'description' ) ?>
 452      </td>
 453      <td colspan="5">
 454          <?php echo $t_bug->description ?>
 455      </td>
 456  </tr>
 457  
 458  
 459  <!-- Steps to Reproduce -->
 460  <tr <?php echo helper_alternate_class() ?>>
 461      <td class="category">
 462          <?php echo lang_get( 'steps_to_reproduce' ) ?>
 463      </td>
 464      <td colspan="5">
 465          <?php echo $t_bug->steps_to_reproduce ?>
 466      </td>
 467  </tr>
 468  
 469  
 470  <!-- Additional Information -->
 471  <tr <?php echo helper_alternate_class() ?>>
 472      <td class="category">
 473          <?php echo lang_get( 'additional_information' ) ?>
 474      </td>
 475      <td colspan="5">
 476          <?php echo $t_bug->additional_information ?>
 477      </td>
 478  </tr>
 479  
 480  <!-- Tagging -->
 481  <?php if ( access_has_global_level( config_get( 'tag_view_threshold' ) ) ) { ?>
 482  <tr <?php echo helper_alternate_class() ?>>
 483      <td class="category"><?php echo lang_get( 'tags' ) ?></td>
 484      <td colspan="5">
 485  <?php
 486      tag_display_attached( $f_bug_id );
 487  ?>
 488      </td>
 489  </tr>
 490  <?php } # has tag_view access ?>
 491  
 492  <?php if ( access_has_bug_level( config_get( 'tag_attach_threshold' ), $f_bug_id ) ) { ?>
 493  <tr <?php echo helper_alternate_class() ?>>
 494      <td class="category"><?php echo lang_get( 'tag_attach_long' ) ?></td>
 495      <td colspan="5">
 496  <?php
 497      print_tag_attach_form( $f_bug_id );
 498  ?>
 499      </td>
 500  </tr>
 501  <?php } # has tag attach access ?>
 502  
 503  
 504  <!-- spacer -->
 505  <tr class="spacer">
 506      <td colspan="6"></td>
 507  </tr>
 508  
 509  <!-- Custom Fields -->
 510  <?php
 511      $t_custom_fields_found = false;
 512      $t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id );
 513      foreach( $t_related_custom_field_ids as $t_id ) {
 514          if ( !custom_field_has_read_access( $t_id, $f_bug_id ) ) {
 515              continue;
 516          } # has read access
 517  
 518          $t_custom_fields_found = true;
 519          $t_def = custom_field_get_definition( $t_id );
 520  ?>
 521      <tr <?php echo helper_alternate_class() ?>>
 522          <td class="category">
 523              <?php echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?>
 524          </td>
 525          <td colspan="5">
 526          <?php print_custom_field_value( $t_def, $t_id, $f_bug_id ); ?>
 527          </td>
 528      </tr>
 529  <?php
 530      } # foreach
 531  ?>
 532  
 533  <?php if ( $t_custom_fields_found ) { ?>
 534  <!-- spacer -->
 535  <tr class="spacer">
 536      <td colspan="6"></td>
 537  </tr>
 538  <?php } # custom fields found ?>
 539  
 540  
 541  <!-- Attachments -->
 542  <?php
 543      $t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id );
 544  
 545      if ( $t_show_attachments ) {
 546  ?>
 547  <tr <?php echo helper_alternate_class() ?>>
 548      <td class="category">
 549          <a name="attachments" id="attachments" />
 550          <?php echo lang_get( 'attached_files' ) ?>
 551      </td>
 552      <td colspan="5">
 553          <?php file_list_attachments ( $f_bug_id ); ?>
 554      </td>
 555  </tr>
 556  <?php
 557      }
 558  ?>
 559  
 560  <!-- Buttons -->
 561  <tr align="center">
 562      <td align="center" colspan="6">
 563  <?php
 564      html_buttons_view_bug_page( $f_bug_id );
 565  ?>
 566      </td>
 567  </tr>
 568  </table>
 569  
 570  <?php
 571      $t_mantis_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
 572  
 573      # User list sponsoring the bug
 574      include ( $t_mantis_dir . 'bug_sponsorship_list_view_inc.php' );
 575  
 576      # Bug Relationships
 577      # MASC RELATIONSHIP
 578      if ( ON == config_get( 'enable_relationship' ) ) {
 579          relationship_view_box ( $f_bug_id );
 580      }
 581      # MASC RELATIONSHIP
 582  
 583      # File upload box
 584      if ( !bug_is_readonly( $f_bug_id ) ) {
 585          include ( $t_mantis_dir . 'bug_file_upload_inc.php' );
 586      }
 587  
 588      # User list monitoring the bug
 589      include ( $t_mantis_dir . 'bug_monitor_list_view_inc.php' );
 590  
 591      # Bugnotes and "Add Note" box
 592      if ( 'ASC' == current_user_get_pref( 'bugnote_order' ) ) {
 593          include ( $t_mantis_dir . 'bugnote_view_inc.php' );
 594          include ( $t_mantis_dir . 'bugnote_add_inc.php' );
 595      } else {
 596          include ( $t_mantis_dir . 'bugnote_add_inc.php' );
 597          include ( $t_mantis_dir . 'bugnote_view_inc.php' );
 598      }
 599  
 600      # History
 601      if ( $f_history ) {
 602          include ( $t_mantis_dir . 'history_inc.php' );
 603      }
 604  
 605      html_page_bottom1( __FILE__ );
 606  
 607      last_visited_issue( $f_bug_id );
 608  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics