[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/ -> bug_view_inc.php (source)

   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   * This include file prints out the bug information
  19   * $f_bug_id MUST be specified before the file is included
  20   *
  21   * @package MantisBT
  22   * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
  23   * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
  24   * @link http://www.mantisbt.org
  25   *
  26   * @uses access_api.php
  27   * @uses authentication_api.php
  28   * @uses bug_api.php
  29   * @uses category_api.php
  30   * @uses columns_api.php
  31   * @uses compress_api.php
  32   * @uses config_api.php
  33   * @uses constant_inc.php
  34   * @uses current_user_api.php
  35   * @uses custom_field_api.php
  36   * @uses date_api.php
  37   * @uses event_api.php
  38   * @uses gpc_api.php
  39   * @uses helper_api.php
  40   * @uses html_api.php
  41   * @uses lang_api.php
  42   * @uses last_visited_api.php
  43   * @uses prepare_api.php
  44   * @uses print_api.php
  45   * @uses project_api.php
  46   * @uses string_api.php
  47   * @uses tag_api.php
  48   * @uses utility_api.php
  49   * @uses version_api.php
  50   */
  51  
  52  if ( !defined( 'BUG_VIEW_INC_ALLOW' ) ) {
  53      return;
  54  }
  55  
  56  require_api( 'access_api.php' );
  57  require_api( 'authentication_api.php' );
  58  require_api( 'bug_api.php' );
  59  require_api( 'category_api.php' );
  60  require_api( 'columns_api.php' );
  61  require_api( 'compress_api.php' );
  62  require_api( 'config_api.php' );
  63  require_api( 'constant_inc.php' );
  64  require_api( 'current_user_api.php' );
  65  require_api( 'custom_field_api.php' );
  66  require_api( 'date_api.php' );
  67  require_api( 'event_api.php' );
  68  require_api( 'gpc_api.php' );
  69  require_api( 'helper_api.php' );
  70  require_api( 'html_api.php' );
  71  require_api( 'lang_api.php' );
  72  require_api( 'last_visited_api.php' );
  73  require_api( 'prepare_api.php' );
  74  require_api( 'print_api.php' );
  75  require_api( 'project_api.php' );
  76  require_api( 'string_api.php' );
  77  require_api( 'tag_api.php' );
  78  require_api( 'utility_api.php' );
  79  require_api( 'version_api.php' );
  80  
  81  require_css( 'status_config.php' );
  82  
  83  $f_bug_id = gpc_get_int( 'id' );
  84  
  85  bug_ensure_exists( $f_bug_id );
  86  
  87  $tpl_bug = bug_get( $f_bug_id, true );
  88  
  89  # In case the current project is not the same project of the bug we are
  90  # viewing, override the current project. This ensures all config_get and other
  91  # per-project function calls use the project ID of this bug.
  92  $g_project_override = $tpl_bug->project_id;
  93  
  94  access_ensure_bug_level( VIEWER, $f_bug_id );
  95  
  96  $f_history = gpc_get_bool( 'history', config_get( 'history_default_visible' ) );
  97  
  98  $t_fields = config_get( $tpl_fields_config_option );
  99  $t_fields = columns_filter_disabled( $t_fields );
 100  
 101  compress_enable();
 102  
 103  if ( $tpl_show_page_header ) {
 104      html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
 105      print_recently_visited();
 106  }
 107  
 108  $t_action_button_position = config_get( 'action_button_position' );
 109  
 110  $t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
 111  
 112  $tpl_show_versions = version_should_show_product_version( $tpl_bug->project_id );
 113  $tpl_show_product_version = $tpl_show_versions && in_array( 'product_version', $t_fields );
 114  $tpl_show_fixed_in_version = $tpl_show_versions && in_array( 'fixed_in_version', $t_fields );
 115  $tpl_show_product_build = $tpl_show_versions && in_array( 'product_build', $t_fields )
 116      && ( config_get( 'enable_product_build' ) == ON );
 117  $tpl_product_build = $tpl_show_product_build ? string_display_line( $tpl_bug->build ) : '';
 118  $tpl_show_target_version = $tpl_show_versions && in_array( 'target_version', $t_fields )
 119      && access_has_bug_level( config_get( 'roadmap_view_threshold' ), $f_bug_id );
 120  
 121  $tpl_product_version_string  = '';
 122  $tpl_target_version_string   = '';
 123  $tpl_fixed_in_version_string = '';
 124  
 125  if ( $tpl_show_product_version || $tpl_show_fixed_in_version || $tpl_show_target_version ) {
 126      $t_version_rows = version_get_all_rows( $tpl_bug->project_id );
 127  
 128      if ( $tpl_show_product_version ) {
 129          $tpl_product_version_string  = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->version, $tpl_bug->project_id ), $t_version_rows );
 130      }
 131  
 132      if ( $tpl_show_target_version ) {
 133          $tpl_target_version_string   = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->target_version, $tpl_bug->project_id) , $t_version_rows );
 134      }
 135  
 136      if ( $tpl_show_fixed_in_version ) {
 137          $tpl_fixed_in_version_string = prepare_version_string( $tpl_bug->project_id, version_get_id( $tpl_bug->fixed_in_version, $tpl_bug->project_id ), $t_version_rows );
 138      }
 139  }
 140  
 141  $tpl_product_version_string = string_display_line( $tpl_product_version_string );
 142  $tpl_target_version_string = string_display_line( $tpl_target_version_string );
 143  $tpl_fixed_in_version_string = string_display_line( $tpl_fixed_in_version_string );
 144  
 145  $tpl_bug_id = $f_bug_id;
 146  $tpl_form_title = lang_get( 'bug_view_title' );
 147  $tpl_wiki_link = config_get_global( 'wiki_enable' ) == ON ? 'wiki.php?id=' . $f_bug_id : '';
 148  
 149  if ( access_has_bug_level( config_get( 'view_history_threshold' ), $f_bug_id ) ) {
 150      $tpl_history_link = "view.php?id=$f_bug_id&history=1#history";
 151  } else {
 152      $tpl_history_link = '';
 153  }
 154  
 155  $tpl_show_reminder_link = !current_user_is_anonymous() && !bug_is_readonly( $f_bug_id ) &&
 156        access_has_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id );
 157  $tpl_bug_reminder_link = 'bug_reminder_page.php?bug_id=' . $f_bug_id;
 158  
 159  $tpl_print_link = 'print_bug_page.php?bug_id=' . $f_bug_id;
 160  
 161  $tpl_top_buttons_enabled = !$tpl_force_readonly && ( $t_action_button_position == POSITION_TOP || $t_action_button_position == POSITION_BOTH );
 162  $tpl_bottom_buttons_enabled = !$tpl_force_readonly && ( $t_action_button_position == POSITION_BOTTOM || $t_action_button_position == POSITION_BOTH );
 163  
 164  $tpl_show_project = in_array( 'project', $t_fields );
 165  $tpl_project_name = $tpl_show_project ? string_display_line( project_get_name( $tpl_bug->project_id ) ): '';
 166  $tpl_show_id = in_array( 'id', $t_fields );
 167  $tpl_formatted_bug_id = $tpl_show_id ? string_display_line( bug_format_id( $f_bug_id ) ) : '';
 168  
 169  $tpl_show_date_submitted = in_array( 'date_submitted', $t_fields );
 170  $tpl_date_submitted = $tpl_show_date_submitted ? date( config_get( 'normal_date_format' ), $tpl_bug->date_submitted ) : '';
 171  
 172  $tpl_show_last_updated = in_array( 'last_updated', $t_fields );
 173  $tpl_last_updated = $tpl_show_last_updated ? date( config_get( 'normal_date_format' ), $tpl_bug->last_updated ) : '';
 174  
 175  $tpl_show_tags = in_array( 'tags', $t_fields ) && access_has_global_level( config_get( 'tag_view_threshold' ) );
 176  
 177  $tpl_bug_overdue = bug_is_overdue( $f_bug_id );
 178  
 179  $tpl_show_view_state = in_array( 'view_state', $t_fields );
 180  $tpl_bug_view_state_enum = $tpl_show_view_state ? string_display_line( get_enum_element( 'view_state', $tpl_bug->view_state ) ) : '';
 181  
 182  $tpl_show_due_date = in_array( 'due_date', $t_fields ) && access_has_bug_level( config_get( 'due_date_view_threshold' ), $f_bug_id );
 183  
 184  if ( $tpl_show_due_date ) {
 185      if ( !date_is_null( $tpl_bug->due_date ) ) {
 186          $tpl_bug_due_date = date( config_get( 'normal_date_format' ), $tpl_bug->due_date );
 187      } else {
 188          $tpl_bug_due_date = '';
 189      }
 190  }
 191  
 192  $tpl_show_reporter = in_array( 'reporter', $t_fields );
 193  $tpl_show_handler = in_array( 'handler', $t_fields ) && access_has_bug_level( config_get( 'view_handler_threshold' ), $f_bug_id );
 194  $tpl_show_additional_information = !is_blank( $tpl_bug->additional_information ) && in_array( 'additional_info', $t_fields );
 195  $tpl_show_steps_to_reproduce = !is_blank( $tpl_bug->steps_to_reproduce ) && in_array( 'steps_to_reproduce', $t_fields );
 196  $tpl_show_monitor_box = !$tpl_force_readonly;
 197  $tpl_show_relationships_box = !$tpl_force_readonly;
 198  $tpl_show_sponsorships_box = config_get( 'enable_sponsorship' ) && access_has_bug_level( config_get( 'view_sponsorship_total_threshold' ), $f_bug_id );
 199  $tpl_show_upload_form = !$tpl_force_readonly && !bug_is_readonly( $f_bug_id );
 200  $tpl_show_history = $f_history;
 201  $tpl_show_profiles = config_get( 'enable_profiles' );
 202  $tpl_show_platform = $tpl_show_profiles && in_array( 'platform', $t_fields );
 203  $tpl_platform = $tpl_show_platform ? string_display_line( $tpl_bug->platform ) : '';
 204  $tpl_show_os = $tpl_show_profiles && in_array( 'os', $t_fields );
 205  $tpl_os = $tpl_show_os ? string_display_line( $tpl_bug->os ) : '';
 206  $tpl_show_os_version = $tpl_show_profiles && in_array( 'os_version', $t_fields );
 207  $tpl_os_version = $tpl_show_os_version ? string_display_line( $tpl_bug->os_build ) : '';
 208  $tpl_show_projection = in_array( 'projection', $t_fields );
 209  $tpl_projection = $tpl_show_projection ? string_display_line( get_enum_element( 'projection', $tpl_bug->projection ) ) : '';
 210  $tpl_show_eta = in_array( 'eta', $t_fields );
 211  $tpl_eta = $tpl_show_eta ? string_display_line( get_enum_element( 'eta', $tpl_bug->eta ) ) : '';
 212  $tpl_show_attachments = in_array( 'attachments', $t_fields );
 213  $tpl_can_attach_tag = $tpl_show_tags && !$tpl_force_readonly && access_has_bug_level( config_get( 'tag_attach_threshold' ), $f_bug_id );
 214  $tpl_show_category = in_array( 'category_id', $t_fields );
 215  $tpl_category = $tpl_show_category ? string_display_line( category_full_name( $tpl_bug->category_id ) ) : '';
 216  $tpl_show_priority = in_array( 'priority', $t_fields );
 217  $tpl_priority = $tpl_show_priority ? string_display_line( get_enum_element( 'priority', $tpl_bug->priority ) ) : '';
 218  $tpl_show_severity = in_array( 'severity', $t_fields );
 219  $tpl_severity = $tpl_show_severity ? string_display_line( get_enum_element( 'severity', $tpl_bug->severity ) ) : '';
 220  $tpl_show_reproducibility = in_array( 'reproducibility', $t_fields );
 221  $tpl_reproducibility = $tpl_show_reproducibility ? string_display_line( get_enum_element( 'reproducibility', $tpl_bug->reproducibility ) ): '';
 222  $tpl_show_status = in_array( 'status', $t_fields );
 223  $tpl_status = $tpl_show_status ? string_display_line( get_enum_element( 'status', $tpl_bug->status ) ) : '';
 224  $tpl_show_resolution = in_array( 'resolution', $t_fields );
 225  $tpl_resolution = $tpl_show_resolution ? string_display_line( get_enum_element( 'resolution', $tpl_bug->resolution ) ) : '';
 226  $tpl_show_summary = in_array( 'summary', $t_fields );
 227  $tpl_show_description = in_array( 'description', $t_fields );
 228  
 229  $tpl_summary = $tpl_show_summary ? bug_format_summary( $f_bug_id, SUMMARY_FIELD ) : '';
 230  $tpl_description = $tpl_show_description ? string_display_links( $tpl_bug->description ) : '';
 231  $tpl_steps_to_reproduce = $tpl_show_steps_to_reproduce ? string_display_links( $tpl_bug->steps_to_reproduce ) : '';
 232  $tpl_additional_information = $tpl_show_additional_information ? string_display_links( $tpl_bug->additional_information ) : '';
 233  
 234  $tpl_links = event_signal( 'EVENT_MENU_ISSUE', $f_bug_id );
 235  
 236  #
 237  # Start of Template
 238  #
 239  
 240  echo '<br />';
 241  echo '<table class="width100" cellspacing="1">';
 242  echo '<thead><tr class="bug-nav">';
 243  
 244  # Form Title
 245  echo '<td class="form-title" colspan="', $t_bugslist ? '3' : '4', '">';
 246  
 247  echo $tpl_form_title;
 248  
 249  echo '&#160;<span class="small">';
 250  
 251  # Jump to Bugnotes
 252  print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ), false, 'jump-to-bugnotes' );
 253  
 254  # Send Bug Reminder
 255  if ( $tpl_show_reminder_link ) {
 256      print_bracket_link( $tpl_bug_reminder_link, lang_get( 'bug_reminder' ), false, 'bug-reminder' );
 257  }
 258  
 259  if ( !is_blank( $tpl_wiki_link ) ) {
 260      print_bracket_link( $tpl_wiki_link, lang_get( 'wiki' ), false, 'wiki' );
 261  }
 262  
 263  foreach ( $tpl_links as $t_plugin => $t_hooks ) {
 264      foreach( $t_hooks as $t_hook ) {
 265          if ( is_array( $t_hook ) ) {
 266              foreach( $t_hook as $t_label => $t_href ) {
 267                  if ( is_numeric( $t_label ) ) {
 268                      print_bracket_link_prepared( $t_href );
 269                  } else {
 270                      print_bracket_link( $t_href, $t_label );
 271                  }
 272              }
 273          } else {
 274              print_bracket_link_prepared( $t_hook );
 275          }
 276      }
 277  }
 278  
 279  echo '</span></td>';
 280  
 281  # prev/next links
 282  if ( $t_bugslist ) {
 283      echo '<td class="center prev-next-links"><span class="small">';
 284  
 285      $t_bugslist = explode( ',', $t_bugslist );
 286      $t_index = array_search( $f_bug_id, $t_bugslist );
 287      if ( false !== $t_index ) {
 288          if ( isset( $t_bugslist[$t_index-1] ) ) {
 289              print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index-1], '&lt;&lt;', false, 'previous-bug' );
 290          }
 291  
 292          if ( isset( $t_bugslist[$t_index+1] ) ) {
 293              print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;', false, 'next-bug' );
 294          }
 295      }
 296      echo '</span></td>';
 297  }
 298  
 299  
 300  # Links
 301  echo '<td class="right alternate-views-links" colspan="2">';
 302  
 303  if ( !is_blank( $tpl_history_link ) ) {
 304      # History
 305      echo '<span class="small">';
 306      print_bracket_link( $tpl_history_link, lang_get( 'bug_history' ), false , 'bug-history' );
 307      echo '</span>';
 308  }
 309  
 310  # Print Bug
 311  echo '<span class="small">';
 312  print_bracket_link( $tpl_print_link, lang_get( 'print' ), false, 'print' );
 313  echo '</span>';
 314  echo '</td>';
 315  echo '</tr>';
 316  
 317  if ( $tpl_top_buttons_enabled ) {
 318      echo '<tr class="top-buttons">';
 319      echo '<td colspan="6">';
 320      html_buttons_view_bug_page( $tpl_bug_id );
 321      echo '</td>';
 322      echo '</tr>';
 323  }
 324  
 325  echo '</thead>';
 326  
 327  if ( $tpl_bottom_buttons_enabled ) {
 328      echo '<tfoot>';
 329      echo '<tr class="bottom-buttons"><td colspan="6">';
 330      html_buttons_view_bug_page( $tpl_bug_id );
 331      echo '</td></tr>';
 332      echo '</tfoot>';
 333  }
 334  
 335  echo '<tbody>';
 336  
 337  if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_state || $tpl_show_date_submitted || $tpl_show_last_updated ) {
 338      # Labels
 339      echo '<tr class="bug-header">';
 340      echo '<th class="bug-id category" width="15%">', $tpl_show_id ? lang_get( 'id' ) : '', '</th>';
 341      echo '<th class="bug-project category" width="20%">', $tpl_show_project ? lang_get( 'email_project' ) : '', '</th>';
 342      echo '<th class="bug-category category" width="15%">', $tpl_show_category ? lang_get( 'category' ) : '', '</th>';
 343      echo '<th class="bug-view-status category" width="15%">', $tpl_show_view_state ? lang_get( 'view_status' ) : '', '</th>';
 344      echo '<th class="bug-date-submitted category" width="15%">', $tpl_show_date_submitted ? lang_get( 'date_submitted' ) : '', '</th>';
 345      echo '<th class="bug-last-modified category" width="20%">', $tpl_show_last_updated ? lang_get( 'last_update' ) : '','</th>';
 346      echo '</tr>';
 347  
 348      echo '<tr ', helper_alternate_class(null, 'row-1 bug-header-data', 'row-2 bug-header-data'), '>';
 349  
 350      # Bug ID
 351      echo '<td class="bug-id">', $tpl_formatted_bug_id, '</td>';
 352  
 353      # Project
 354      echo '<td class="bug-project">', $tpl_project_name, '</td>';
 355  
 356      # Category
 357      echo '<th class="bug-category">', $tpl_category, '</th>';
 358  
 359      # View Status
 360      echo '<td class="bug-view-status">', $tpl_bug_view_state_enum, '</td>';
 361  
 362      # Date Submitted
 363      echo '<td class="bug-date-submitted">', $tpl_date_submitted, '</td>';
 364  
 365      # Date Updated
 366      echo '<td class="bug-last-modified">', $tpl_last_updated, '</td>';
 367  
 368      echo '</tr>';
 369  
 370      # spacer
 371      echo '<tr class="spacer"><td colspan="6"></td></tr>';
 372  }
 373  
 374  #
 375  # Reporter
 376  #
 377  
 378  if ( $tpl_show_reporter ) {
 379      echo '<tr ', helper_alternate_class(), '>';
 380  
 381      $t_spacer = 4;
 382  
 383      # Reporter
 384      echo '<th class="bug-reporter category">', lang_get( 'reporter' ), '</th>';
 385      echo '<td class="bug-reporter">';
 386      print_user_with_subject( $tpl_bug->reporter_id, $tpl_bug_id );
 387      echo '</td>';
 388      echo '<td colspan="', $t_spacer, '">&#160;</td>';
 389  
 390      echo '</tr>';
 391  }
 392  
 393  #
 394  # Handler, Due Date
 395  #
 396  
 397  if ( $tpl_show_handler || $tpl_show_due_date ) {
 398      echo '<tr ', helper_alternate_class(), '>';
 399  
 400      $t_spacer = 2;
 401  
 402      # Handler
 403      echo '<th class="bug-assigned-to category">', lang_get( 'assigned_to' ), '</th>';
 404      echo '<td class="bug-assigned-to">';
 405      print_user_with_subject( $tpl_bug->handler_id, $tpl_bug_id );
 406      echo '</td>';
 407  
 408      # Due Date
 409      if ( $tpl_show_due_date ) {
 410          echo '<th class="bug-due-date category">', lang_get( 'due_date' ), '</th>';
 411  
 412          if ( $tpl_bug_overdue ) {
 413              echo '<td class="bug-due-date overdue">', $tpl_bug_due_date, '</td>';
 414          } else {
 415              echo '<td class="bug-due-date">', $tpl_bug_due_date, '</td>';
 416          }
 417      } else {
 418          $t_spacer += 2;
 419      }
 420  
 421      echo '<td colspan="', $t_spacer, '">&#160;</td>';
 422      echo '</tr>';
 423  }
 424  
 425  #
 426  # Priority, Severity, Reproducibility
 427  #
 428  
 429  if ( $tpl_show_priority || $tpl_show_severity || $tpl_show_reproducibility ) {
 430      echo '<tr ', helper_alternate_class(), '>';
 431  
 432      $t_spacer = 0;
 433  
 434      # Priority
 435      if ( $tpl_show_priority ) {
 436          echo '<th class="bug-priority category">', lang_get( 'priority' ), '</th>';
 437          echo '<td class="bug-priority">', $tpl_priority, '</td>';
 438      } else {
 439          $t_spacer += 2;
 440      }
 441  
 442      # Severity
 443      if ( $tpl_show_severity ) {
 444          echo '<th class="bug-severity category">', lang_get( 'severity' ), '</th>';
 445          echo '<td class="bug-severity">', $tpl_severity, '</td>';
 446      } else {
 447          $t_spacer += 2;
 448      }
 449  
 450      # Reproducibility
 451      if ( $tpl_show_reproducibility ) {
 452          echo '<th class="bug-reproducibility category">', lang_get( 'reproducibility' ), '</th>';
 453          echo '<td class="bug-reproducibility">', $tpl_reproducibility, '</td>';
 454      } else {
 455          $t_spacer += 2;
 456      }
 457  
 458      # spacer
 459      if ( $t_spacer > 0 ) {
 460          echo '<td colspan="', $t_spacer, '">&#160;</td>';
 461      }
 462  
 463      echo '</tr>';
 464  }
 465  
 466  #
 467  # Status, Resolution
 468  #
 469  
 470  if ( $tpl_show_status || $tpl_show_resolution ) {
 471      echo '<tr ', helper_alternate_class(), '>';
 472  
 473      $t_spacer = 2;
 474  
 475      # Status
 476      if ( $tpl_show_status ) {
 477          echo '<th class="bug-status category">', lang_get( 'status' ), '</th>';
 478  
 479          # choose color based on status
 480          $status_label = html_get_status_css_class( $tpl_bug->status );
 481  
 482          echo '<td class="bug-status ', $status_label, '">', $tpl_status, '</td>';
 483      } else {
 484          $t_spacer += 2;
 485      }
 486  
 487      # Resolution
 488      if ( $tpl_show_resolution ) {
 489          echo '<th class="bug-resolution category">', lang_get( 'resolution' ), '</th>';
 490          echo '<td class="bug-resolution">', $tpl_resolution, '</td>';
 491      } else {
 492          $t_spacer += 2;
 493      }
 494  
 495      # spacer
 496      if ( $t_spacer > 0 ) {
 497          echo '<td colspan="', $t_spacer, '">&#160;</td>';
 498      }
 499  
 500      echo '</tr>';
 501  }
 502  
 503  #
 504  # Projection, ETA
 505  #
 506  
 507  if ( $tpl_show_projection || $tpl_show_eta ) {
 508      echo '<tr ', helper_alternate_class(), '>';
 509  
 510      $t_spacer = 2;
 511  
 512      if ( $tpl_show_projection ) {
 513          # Projection
 514          echo '<th class="bug-projection category">', lang_get( 'projection' ), '</th>';
 515          echo '<td class="bug-projection">', $tpl_projection, '</td>';
 516      } else {
 517          $t_spacer += 2;
 518      }
 519  
 520      # ETA
 521      if ( $tpl_show_eta ) {
 522          echo '<th class="bug-eta category">', lang_get( 'eta' ), '</th>';
 523          echo '<td class="bug-eta">', $tpl_eta, '</td>';
 524      } else {
 525          $t_spacer += 2;
 526      }
 527  
 528      echo '<td colspan="', $t_spacer, '">&#160;</td>';
 529      echo '</tr>';
 530  }
 531  
 532  #
 533  # Platform, OS, OS Version
 534  #
 535  
 536  if (( $tpl_show_platform || $tpl_show_os || $tpl_show_os_version ) &&
 537      ( $tpl_platform || $tpl_os || $tpl_os_version )) {
 538      $t_spacer = 0;
 539  
 540      echo '<tr ', helper_alternate_class(), '>';
 541  
 542      # Platform
 543      if ( $tpl_show_platform ) {
 544          echo '<th class="bug-platform category">', lang_get( 'platform' ), '</th>';
 545          echo '<td class="bug-platform">', $tpl_platform, '</td>';
 546      } else {
 547          $t_spacer += 2;
 548      }
 549  
 550      # Operating System
 551      if ( $tpl_show_os ) {
 552          echo '<th class="bug-os category">', lang_get( 'os' ), '</th>';
 553          echo '<td class="bug-os">', $tpl_os, '</td>';
 554      } else {
 555          $t_spacer += 2;
 556      }
 557  
 558      # OS Version
 559      if ( $tpl_show_os_version ) {
 560          echo '<th class="bug-os-version category">', lang_get( 'os_version' ), '</th>';
 561          echo '<td class="bug-os-version">', $tpl_os_version, '</td>';
 562      } else {
 563          $t_spacer += 2;
 564      }
 565  
 566      if ( $t_spacer > 0 ) {
 567          echo '<td colspan="', $t_spacer, '">&#160;</td>';
 568      }
 569  
 570      echo '</tr>';
 571  }
 572  
 573  #
 574  # Product Version, Product Build
 575  #
 576  
 577  if ( $tpl_show_product_version || $tpl_show_product_build ) {
 578      $t_spacer = 2;
 579  
 580      echo '<tr ', helper_alternate_class(), '>';
 581  
 582      # Product Version
 583      if ( $tpl_show_product_version ) {
 584          echo '<th class="bug-product-version category">', lang_get( 'product_version' ), '</th>';
 585          echo '<td class="bug-product-version">', $tpl_product_version_string, '</td>';
 586      } else {
 587          $t_spacer += 2;
 588      }
 589  
 590      # Product Build
 591      if ( $tpl_show_product_build ) {
 592          echo '<th class="bug-product-build category">', lang_get( 'product_build' ), '</th>';
 593          echo '<td class="bug-product-build">', $tpl_product_build, '</td>';
 594      } else {
 595          $t_spacer += 2;
 596      }
 597  
 598      # spacer
 599      echo '<td colspan="', $t_spacer, '">&#160;</td>';
 600  
 601      echo '</tr>';
 602  }
 603  
 604  #
 605  # Target Version, Fixed In Version
 606  #
 607  
 608  if ( $tpl_show_target_version || $tpl_show_fixed_in_version ) {
 609      $t_spacer = 2;
 610  
 611      echo '<tr ', helper_alternate_class(), '>';
 612  
 613      # target version
 614      if ( $tpl_show_target_version ) {
 615          # Target Version
 616          echo '<th class="bug-target-version category">', lang_get( 'target_version' ), '</th>';
 617          echo '<td class="bug-target-version">', $tpl_target_version_string, '</td>';
 618      } else {
 619          $t_spacer += 2;
 620      }
 621  
 622      # fixed in version
 623      if ( $tpl_show_fixed_in_version ) {
 624          echo '<th class="bug-fixed-in-version category">', lang_get( 'fixed_in_version' ), '</th>';
 625          echo '<td class="bug-fixed-in-version">', $tpl_fixed_in_version_string, '</td>';
 626      } else {
 627          $t_spacer += 2;
 628      }
 629  
 630      # spacer
 631      echo '<td colspan="', $t_spacer, '">&#160;</td>';
 632  
 633      echo '</tr>';
 634  }
 635  
 636  #
 637  # Bug Details Event Signal
 638  #
 639  
 640  event_signal( 'EVENT_VIEW_BUG_DETAILS', array( $tpl_bug_id ) );
 641  
 642  # spacer
 643  echo '<tr class="spacer"><td colspan="6"></td></tr>';
 644  
 645  #
 646  # Bug Details (screen wide fields)
 647  #
 648  
 649  # Summary
 650  if ( $tpl_show_summary ) {
 651      echo '<tr ', helper_alternate_class(), '>';
 652      echo '<th class="bug-summary category">', lang_get( 'summary' ), '</th>';
 653      echo '<td class="bug-summary" colspan="5">', $tpl_summary, '</td>';
 654      echo '</tr>';
 655  }
 656  
 657  # Description
 658  if ( $tpl_show_description ) {
 659      echo '<tr ', helper_alternate_class(), '>';
 660      echo '<th class="bug-description category">', lang_get( 'description' ), '</th>';
 661      echo '<td class="bug-description" colspan="5">', $tpl_description, '</td>';
 662      echo '</tr>';
 663  }
 664  
 665  # Steps to Reproduce
 666  if ( $tpl_show_steps_to_reproduce ) {
 667      echo '<tr ', helper_alternate_class(), '>';
 668      echo '<th class="bug-steps-to-reproduce category">', lang_get( 'steps_to_reproduce' ), '</th>';
 669      echo '<td class="bug-steps-to-reproduce" colspan="5">', $tpl_steps_to_reproduce, '</td>';
 670      echo '</tr>';
 671  }
 672  
 673  # Additional Information
 674  if ( $tpl_show_additional_information ) {
 675      echo '<tr ', helper_alternate_class(), '>';
 676      echo '<th class="bug-additional-information category">', lang_get( 'additional_information' ), '</th>';
 677      echo '<td class="bug-additional-information" colspan="5">', $tpl_additional_information, '</td>';
 678      echo '</tr>';
 679  }
 680  
 681  # Tagging
 682  if ( $tpl_show_tags ) {
 683      echo '<tr ', helper_alternate_class(), '>';
 684      echo '<th class="bug-tags category">', lang_get( 'tags' ), '</th>';
 685      echo '<td class="bug-tags" colspan="5">';
 686      tag_display_attached( $tpl_bug_id );
 687      echo '</td></tr>';
 688  }
 689  
 690  # Attachments Form
 691  if ( $tpl_can_attach_tag ) {
 692      echo '<tr ', helper_alternate_class(), '>';
 693      echo '<th class="bug-attach-tags category">', lang_get( 'tag_attach_long' ), '</th>';
 694      echo '<td class="bug-attach-tags" colspan="5">';
 695      print_tag_attach_form( $tpl_bug_id );
 696      echo '</td></tr>';
 697  }
 698  
 699  # spacer
 700  echo '<tr class="spacer"><td colspan="6"></td></tr>';
 701  
 702  # Custom Fields
 703  $t_custom_fields_found = false;
 704  $t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
 705  
 706  foreach( $t_related_custom_field_ids as $t_id ) {
 707      if ( !custom_field_has_read_access( $t_id, $f_bug_id ) ) {
 708          continue;
 709      } # has read access
 710  
 711      $t_custom_fields_found = true;
 712      $t_def = custom_field_get_definition( $t_id );
 713  
 714      echo '<tr ', helper_alternate_class(), '>';
 715      echo '<th class="bug-custom-field category">', string_display( lang_get_defaulted( $t_def['name'] ) ), '</th>';
 716      echo '<td class="bug-custom-field" colspan="5">';
 717      print_custom_field_value( $t_def, $t_id, $f_bug_id );
 718      echo '</td></tr>';
 719  }
 720  
 721  if ( $t_custom_fields_found ) {
 722      # spacer
 723      echo '<tr class="spacer"><td colspan="6"></td></tr>';
 724  } # custom fields found
 725  
 726  # Attachments
 727  if ( $tpl_show_attachments ) {
 728      echo '<tr id="attachments" ', helper_alternate_class(), '>';
 729      echo '<th class="bug-attachments category">', lang_get( 'attached_files' ), '</th>';
 730      echo '<td class="bug-attachments" colspan="5">';
 731      print_bug_attachments_list( $tpl_bug_id );
 732      echo '</td></tr>';
 733  }
 734  
 735  echo '</tbody></table>';
 736  
 737  # User list sponsoring the bug
 738  if ( $tpl_show_sponsorships_box ) {
 739      define( 'BUG_SPONSORSHIP_LIST_VIEW_INC_ALLOW', true );
 740      include ( $tpl_mantis_dir . 'bug_sponsorship_list_view_inc.php' );
 741  }
 742  
 743  # Bug Relationships
 744  if ( $tpl_show_relationships_box ) {
 745      relationship_view_box ( $tpl_bug->id );
 746  }
 747  
 748  # File upload box
 749  if ( $tpl_show_upload_form ) {
 750      define( 'BUG_FILE_UPLOAD_INC_ALLOW', true );
 751      include ( $tpl_mantis_dir . 'bug_file_upload_inc.php' );
 752  }
 753  
 754  # User list monitoring the bug
 755  if ( $tpl_show_monitor_box ) {
 756      define( 'BUG_MONITOR_LIST_VIEW_INC_ALLOW', true );
 757      include ( $tpl_mantis_dir . 'bug_monitor_list_view_inc.php' );
 758  }
 759  
 760  # Bugnotes and "Add Note" box
 761  if ( 'ASC' == current_user_get_pref( 'bugnote_order' ) ) {
 762      define( 'BUGNOTE_VIEW_INC_ALLOW', true );
 763      include ( $tpl_mantis_dir . 'bugnote_view_inc.php' );
 764  
 765      if ( !$tpl_force_readonly ) {
 766          define( 'BUGNOTE_ADD_INC_ALLOW', true );
 767          include ( $tpl_mantis_dir . 'bugnote_add_inc.php' );
 768      }
 769  } else {
 770      if ( !$tpl_force_readonly ) {
 771          define( 'BUGNOTE_ADD_INC_ALLOW', true );
 772          include ( $tpl_mantis_dir . 'bugnote_add_inc.php' );
 773      }
 774  
 775      define( 'BUGNOTE_VIEW_INC_ALLOW', true );
 776      include ( $tpl_mantis_dir . 'bugnote_view_inc.php' );
 777  }
 778  
 779  # Allow plugins to display stuff after notes
 780  event_signal( 'EVENT_VIEW_BUG_EXTRA', array( $f_bug_id ) );
 781  
 782  # Time tracking statistics
 783  if ( config_get( 'time_tracking_enabled' ) &&
 784      access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $f_bug_id ) ) {
 785      include ( $tpl_mantis_dir . 'bugnote_stats_inc.php' );
 786  }
 787  
 788  # History
 789  if ( $tpl_show_history ) {
 790      define( 'HISTORY_INC_ALLOW', true );
 791      include ( $tpl_mantis_dir . 'history_inc.php' );
 792  }
 793  
 794  html_page_bottom();
 795  
 796  last_visited_issue( $tpl_bug_id );


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7