[ 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_update_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_update_page.php,v 1.100.2.1 2007-10-13 22:32:58 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.'ajax_api.php' );
  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.'date_api.php' );
  32      require_once( $t_core_path.'last_visited_api.php' );
  33  
  34      $f_bug_id = gpc_get_int( 'bug_id' );
  35  
  36      $t_bug = bug_prepare_edit( bug_get( $f_bug_id, true ) );
  37  
  38      if( $t_bug->project_id != helper_get_current_project() ) {
  39          # in case the current project is not the same project of the bug we are viewing...
  40          # ... override the current project. This to avoid problems with categories and handlers lists etc.
  41          $g_project_override = $t_bug->project_id;
  42          $t_changed_project = true;
  43      } else {
  44          $t_changed_project = false;
  45      }
  46  
  47      if ( ADVANCED_ONLY == config_get( 'show_update' ) ) {
  48          print_header_redirect ( 'bug_update_advanced_page.php?bug_id=' . $f_bug_id );
  49      }
  50  
  51      if ( bug_is_readonly( $f_bug_id ) ) {
  52          error_parameters( $f_bug_id );
  53          trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
  54      }
  55  
  56      access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id );
  57  
  58      $t_bug = bug_prepare_edit( bug_get( $f_bug_id, true ) );
  59  
  60      html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
  61      html_page_top2();
  62  
  63      print_recently_visited();
  64  ?>
  65  
  66  <br />
  67  <form method="post" action="bug_update.php">
  68  <table class="width100" cellspacing="1">
  69  
  70  
  71  <!-- Title -->
  72  <tr>
  73      <td class="form-title" colspan="3">
  74          <input type="hidden" name="bug_id"            value="<?php echo $f_bug_id ?>" />
  75          <input type="hidden" name="update_mode"            value="1" />
  76          <?php echo lang_get( 'updating_bug_simple_title' ) ?>
  77      </td>
  78      <td class="right" colspan="3">
  79  <?php
  80      print_bracket_link( string_get_bug_view_url( $f_bug_id ), lang_get( 'back_to_bug_link' ) );
  81  
  82      if ( BOTH == config_get( 'show_update' ) ) {
  83          print_bracket_link( 'bug_update_advanced_page.php?bug_id=' . $f_bug_id, lang_get( 'update_advanced_link' ) );
  84      }
  85  ?>
  86      </td>
  87  </tr>
  88  
  89  
  90  <tr class="row-category">
  91      <td width="15%">
  92          <?php echo lang_get( 'id' ) ?>
  93      </td>
  94      <td width="20%">
  95          <?php echo lang_get( 'category' ) ?>
  96      </td>
  97      <td width="15%">
  98          <?php echo lang_get( 'severity' ) ?>
  99      </td>
 100      <td width="20%">
 101          <?php echo lang_get( 'reproducibility' ) ?>
 102      </td>
 103      <td width="15%">
 104          <?php echo lang_get( 'date_submitted' ) ?>
 105      </td>
 106      <td width="15%">
 107          <?php echo lang_get( 'last_update' ) ?>
 108      </td>
 109  </tr>
 110  
 111  
 112  <tr <?php echo helper_alternate_class() ?>>
 113  
 114      <!-- Bug ID -->
 115      <td>
 116          <?php echo bug_format_id( $f_bug_id ) ?>
 117      </td>
 118  
 119      <!-- Category -->
 120      <td>
 121          <?php if ( $t_changed_project ) {
 122              echo "[" . project_get_field( $t_bug->project_id, 'name' ) . "] ";
 123          } ?>
 124          <select <?php echo helper_get_tab_index() ?> name="category">
 125              <?php print_category_option_list( $t_bug->category, $t_bug->project_id ) ?>
 126          </select>
 127      </td>
 128  
 129      <!-- Severity -->
 130      <td>
 131          <select <?php echo helper_get_tab_index() ?> name="severity">
 132              <?php print_enum_string_option_list( 'severity', $t_bug->severity ) ?>
 133          </select>
 134      </td>
 135  
 136      <!-- Reproducibility -->
 137      <td>
 138          <select <?php echo helper_get_tab_index() ?> name="reproducibility">
 139              <?php print_enum_string_option_list( 'reproducibility', $t_bug->reproducibility ) ?>
 140          </select>
 141      </td>
 142  
 143      <!-- Date Submitted -->
 144      <td>
 145          <?php print_date( config_get( 'normal_date_format' ), $t_bug->date_submitted ) ?>
 146      </td>
 147  
 148      <!-- Date Updated -->
 149      <td>
 150          <?php print_date( config_get( 'normal_date_format' ), $t_bug->last_updated ) ?>
 151      </td>
 152  
 153  </tr>
 154  
 155  
 156  <!-- spacer -->
 157  <tr class="spacer">
 158      <td colspan="6"></td>
 159  </tr>
 160  
 161  
 162  
 163  <tr <?php echo helper_alternate_class() ?>>
 164  
 165      <!-- Reporter -->
 166      <td class="category">
 167          <?php echo lang_get( 'reporter' ) ?>
 168      </td>
 169      <td>
 170          <?php
 171              if ( ON == config_get( 'use_javascript' ) ) {
 172                  $t_username = prepare_user_name( $t_bug->reporter_id );
 173                  echo ajax_click_to_edit( $t_username, 'reporter_id', 'entrypoint=issue_reporter_combobox&issue_id=' . $f_bug_id );
 174              } else {
 175                  echo '<select ', helper_get_tab_index(), ' name="reporter_id">';
 176                  print_reporter_option_list( $t_bug->reporter_id, $t_bug->project_id );
 177                  echo '</select>';
 178              }
 179          ?>
 180      </td>
 181  
 182      <!-- View Status -->
 183      <td class="category">
 184          <?php echo lang_get( 'view_status' ) ?>
 185      </td>
 186      <td>
 187  <?php
 188          if ( access_has_project_level( config_get( 'change_view_status_threshold' ) ) ) { ?>
 189              <select <?php echo helper_get_tab_index() ?> name="view_state">
 190                  <?php print_enum_string_option_list( 'view_state', $t_bug->view_state) ?>
 191              </select>
 192  <?php
 193          } else {
 194              echo get_enum_element( 'view_state', $t_bug->view_state );
 195          }
 196  ?>
 197      </td>
 198  
 199      <!-- spacer -->
 200      <td colspan="2">&nbsp;</td>
 201  </tr>
 202  
 203  
 204  <tr <?php echo helper_alternate_class() ?>>
 205  
 206      <!-- Assigned To -->
 207      <td class="category">
 208          <?php echo lang_get( 'assigned_to' ) ?>
 209      </td>
 210      <td colspan="5">
 211      <?php if ( access_has_project_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ) ) ) {
 212      ?>
 213          <select <?php echo helper_get_tab_index() ?> name="handler_id">
 214              <option value="0"></option>
 215              <?php print_assign_to_option_list( $t_bug->handler_id, $t_bug->project_id ) ?>
 216          </select>
 217      <?php
 218          } else {
 219              echo user_get_name( $t_bug->handler_id );
 220          }
 221      ?>
 222      </td>
 223  
 224  </tr>
 225  
 226  
 227  <tr <?php echo helper_alternate_class() ?>>
 228  
 229      <!-- Priority -->
 230      <td class="category">
 231          <?php echo lang_get( 'priority' ) ?>
 232      </td>
 233      <td>
 234          <select <?php echo helper_get_tab_index() ?> name="priority">
 235              <?php print_enum_string_option_list( 'priority', $t_bug->priority ) ?>
 236          </select>
 237      </td>
 238  
 239      <!-- Resolution -->
 240      <td class="category">
 241          <?php echo lang_get( 'resolution' ) ?>
 242      </td>
 243      <td>
 244          <select <?php echo helper_get_tab_index() ?> name="resolution">
 245              <?php print_enum_string_option_list( "resolution", $t_bug->resolution ) ?>
 246          </select>
 247      </td>
 248  
 249      <!-- spacer -->
 250      <td colspan="2">&nbsp;</td>
 251  
 252  </tr>
 253  
 254  
 255  <tr <?php echo helper_alternate_class() ?>>
 256  
 257      <!-- Status -->
 258      <td class="category">
 259          <?php echo lang_get( 'status' ) ?>
 260      </td>
 261      <td bgcolor="<?php echo get_status_color( $t_bug->status ) ?>">
 262          <?php print_status_option_list( 'status', $t_bug->status,
 263                          ( $t_bug->reporter_id == auth_get_current_user_id() &&
 264                                  ( ON == config_get( 'allow_reporter_close' ) ) ), $t_bug->project_id ) ?>
 265      </td>
 266  
 267      <?php
 268          # Duplicate Id
 269  
 270          # MASC RELATIONSHIP
 271          if ( OFF == config_get( 'enable_relationship' ) ) {
 272              # Duplicate ID
 273              echo '<td class="category">', lang_get( 'duplicate_id' ), '&nbsp;</td>';
 274              echo '<td>';
 275              echo '<input ', helper_get_tab_index(), ' type="text" name="duplicate_id" value="', $t_bug->duplicate_id, '" maxlength="7" />&nbsp;';
 276              echo '</td>';
 277          } else {
 278              # spacer
 279              echo '<td colspan="2">&nbsp;</td>';
 280          }
 281      ?>
 282  <?php
 283      $t_show_version = ( ON == config_get( 'show_product_version' ) )
 284              || ( ( AUTO == config_get( 'show_product_version' ) )
 285                          && ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) );
 286      if ( $t_show_version ) {
 287  ?>
 288      <!-- Product Version -->
 289      <td class="category">
 290          <?php echo lang_get( 'product_version' ) ?>
 291      </td>
 292      <td>
 293          <select <?php echo helper_get_tab_index() ?> name="version">
 294              <?php print_version_option_list( $t_bug->version, $t_bug->project_id, VERSION_RELEASED ) ?>
 295          </select>
 296      </td>
 297  </tr>
 298  
 299  <?php
 300      }
 301  ?>
 302  <?php /*
 303  <tr <?php echo helper_alternate_class() ?>>
 304      <!-- Fixed in Version -->
 305      <td class="category">
 306          <?php echo lang_get( 'fixed_in_version' ) ?>
 307      </td>
 308      <td colspan="5">
 309          <select <?php echo helper_get_tab_index() ?> name="fixed_in_version">
 310              <?php print_version_option_list( $t_bug->fixed_in_version, $t_bug->project_id, VERSION_ALL ) ?>
 311          </select>
 312      </td>
 313  </tr>
 314  */ ?>
 315  
 316  <!-- spacer -->
 317  <tr class="spacer">
 318      <td colspan="6"></td>
 319  </tr>
 320  
 321  
 322  <!-- Summary -->
 323  <tr <?php echo helper_alternate_class() ?>>
 324      <td class="category">
 325          <?php echo lang_get( 'summary' ) ?>
 326      </td>
 327      <td colspan="5">
 328          <input <?php echo helper_get_tab_index() ?> type="text" name="summary" size="105" maxlength="128" value="<?php echo $t_bug->summary ?>" />
 329      </td>
 330  </tr>
 331  
 332  
 333  <!-- Description -->
 334  <tr <?php echo helper_alternate_class() ?>>
 335      <td class="category">
 336          <?php echo lang_get( 'description' ) ?>
 337      </td>
 338      <td colspan="5">
 339          <textarea <?php echo helper_get_tab_index() ?> cols="80" rows="10" name="description"><?php echo $t_bug->description ?></textarea>
 340      </td>
 341  </tr>
 342  
 343  
 344  <!-- Additional Information -->
 345  <tr <?php echo helper_alternate_class() ?>>
 346      <td class="category">
 347          <?php echo lang_get( 'additional_information' ) ?>
 348      </td>
 349      <td colspan="5">
 350          <textarea <?php echo helper_get_tab_index() ?> cols="80" rows="10" name="additional_information"><?php echo $t_bug->additional_information ?></textarea>
 351      </td>
 352  </tr>
 353  
 354  
 355  <tr class="spacer">
 356      <td colspan="6">&nbsp;</td>
 357  </tr>
 358  
 359  
 360  <!-- Custom Fields -->
 361  <?php
 362      $t_custom_fields_found = false;
 363      $t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id );
 364      foreach( $t_related_custom_field_ids as $t_id ) {
 365          $t_def = custom_field_get_definition( $t_id );
 366          if( ( ( $t_def['display_update'] && !$t_def['advanced'] ) || $t_def['require_update']) && custom_field_has_write_access( $t_id, $f_bug_id ) ) {
 367              $t_custom_fields_found = true;
 368  ?>
 369  <tr <?php echo helper_alternate_class() ?>>
 370      <td class="category">
 371          <?php if ( $t_def['require_update'] ) {?><span class="required">*</span><?php } ?><?php echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?>
 372      </td>
 373      <td colspan="5">
 374          <?php
 375              print_custom_field_input( $t_def, $f_bug_id );
 376          ?>
 377      </td>
 378  </tr>
 379  <?php
 380          } # !$t_def['advanced']
 381      } # foreach( $t_related_custom_field_ids as $t_id )
 382  ?>
 383  
 384  
 385  <?php if ( $t_custom_fields_found ) { ?>
 386  <!-- spacer -->
 387  <tr class="spacer">
 388      <td colspan="6"></td>
 389  </tr>
 390  <?php } # custom fields found ?>
 391  
 392  <!-- Bugnote Text Box -->
 393  <tr <?php echo helper_alternate_class() ?>>
 394      <td class="category">
 395          <?php echo lang_get( 'add_bugnote_title' ) ?>
 396      </td>
 397      <td colspan="5">
 398          <textarea <?php echo helper_get_tab_index() ?> name="bugnote_text" cols="80" rows="10"></textarea>
 399      </td>
 400  </tr>
 401  
 402  
 403  <!-- Bugnote Private Checkbox (if permitted) -->
 404  <?php if ( access_has_bug_level( config_get( 'private_bugnote_threshold' ), $f_bug_id ) ) { ?>
 405  <tr <?php echo helper_alternate_class() ?>>
 406      <td class="category">
 407          <?php echo lang_get( 'view_status' ) ?>
 408      </td>
 409      <td colspan="5">
 410  <?php
 411          $t_default_bugnote_view_status = config_get( 'default_bugnote_view_status' );
 412          if ( access_has_bug_level( config_get( 'set_view_status_threshold' ), $f_bug_id ) ) {
 413  ?>
 414              <input <?php echo helper_get_tab_index() ?> type="checkbox" name="private" <?php check_checked( config_get( 'default_bugnote_view_status' ), VS_PRIVATE ); ?> />
 415  <?php
 416              echo lang_get( 'private' );
 417          } else {
 418              echo get_enum_element( 'view_state', $t_default_bugnote_view_status );
 419          }
 420  ?>
 421      </td>
 422  </tr>
 423  <?php } ?>
 424  
 425  <!-- Time Tracking (if permitted) -->
 426  <?php if ( config_get('time_tracking_enabled') ) { ?>
 427  <?php if ( access_has_bug_level( config_get( 'time_tracking_edit_threshold' ), $f_bug_id ) ) { ?>
 428  <tr <?php echo helper_alternate_class() ?>>
 429      <td class="category">
 430          <?php echo lang_get( 'time_tracking' ) ?>
 431      </td>
 432      <td colspan="5">
 433          <input type="text" name="time_tracking" size="5" value="0:00" />
 434      </td>
 435  </tr>
 436  <?php } ?>
 437  <?php } ?>
 438  
 439  
 440  <!-- Submit Button -->
 441  <tr>
 442      <td class="center" colspan="6">
 443          <input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'update_information_button' ) ?>" />
 444      </td>
 445  </tr>
 446  
 447  
 448  </table>
 449  </form>
 450  
 451  <?php
 452      include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' );
 453      html_page_bottom1( __FILE__ );
 454  
 455      last_visited_issue( $f_bug_id );
 456  ?>


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