[ 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_report_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_report_advanced_page.php,v 1.66.2.1 2007-10-13 22:32:52 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      # This file POSTs data to report_bug.php
  25  
  26      $g_allow_browser_cache = 1;
  27      require_once ( 'core.php' );
  28  
  29      $t_core_path = config_get( 'core_path' );
  30  
  31      require_once( $t_core_path.'file_api.php' );
  32      require_once( $t_core_path.'custom_field_api.php' );
  33      require_once( $t_core_path.'last_visited_api.php' );
  34      require_once( $t_core_path.'projax_api.php' );
  35  
  36      $f_master_bug_id = gpc_get_int( 'm_id', 0 );
  37  
  38      # this page is invalid for the 'All Project' selection except if this is a clone
  39      if ( ( ALL_PROJECTS == helper_get_current_project() ) && ( 0 == $f_master_bug_id ) ) {
  40          print_header_redirect( 'login_select_proj_page.php?ref=bug_report_advanced_page.php' );
  41      }
  42  
  43      if ( SIMPLE_ONLY == config_get( 'show_report' ) ) {
  44          print_header_redirect ( 'bug_report_page.php' .
  45                          ( 0 == $f_master_bug_id ) ? '' : '?m_id=' . $f_master_bug_id );
  46      }
  47  
  48      if( $f_master_bug_id > 0 ) {
  49          # master bug exists...
  50          bug_ensure_exists( $f_master_bug_id );
  51  
  52          # master bug is not read-only...
  53          if ( bug_is_readonly( $f_master_bug_id ) ) {
  54              error_parameters( $f_master_bug_id );
  55              trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
  56          }
  57  
  58          $t_bug = bug_prepare_edit( bug_get( $f_master_bug_id, true ) );
  59  
  60          # the user can at least update the master bug (needed to add the relationship)...
  61          access_ensure_bug_level( config_get( 'update_bug_threshold', null, $t_bug->project_id ), $f_master_bug_id );
  62  
  63          #@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of
  64          #       what the current project is set to.
  65          if( $t_bug->project_id != helper_get_current_project() ) {
  66              # in case the current project is not the same project of the bug we are viewing...
  67              # ... override the current project. This to avoid problems with categories and handlers lists etc.
  68              $g_project_override = $t_bug->project_id;
  69              $t_changed_project = true;
  70          } else {
  71              $t_changed_project = false;
  72          }
  73  
  74          access_ensure_project_level( config_get( 'report_bug_threshold' ) );
  75  
  76          $f_build                = $t_bug->build;
  77          $f_platform                = $t_bug->platform;
  78          $f_os                    = $t_bug->os;
  79          $f_os_build                = $t_bug->os_build;
  80          $f_product_version        = $t_bug->version;
  81          $f_target_version        = $t_bug->target_version;
  82          $f_profile_id            = 0;
  83          $f_handler_id            = $t_bug->handler_id;
  84  
  85          $f_category                = $t_bug->category;
  86          $f_reproducibility        = $t_bug->reproducibility;
  87          $f_severity                = $t_bug->severity;
  88          $f_priority                = $t_bug->priority;
  89          $f_summary                = $t_bug->summary;
  90          $f_description            = $t_bug->description;
  91          $f_steps_to_reproduce    = $t_bug->steps_to_reproduce;
  92          $f_additional_info        = $t_bug->additional_information;
  93          $f_view_state            = $t_bug->view_state;
  94  
  95          $t_project_id            = $t_bug->project_id;
  96      } else {
  97          access_ensure_project_level( config_get( 'report_bug_threshold' ) );
  98  
  99          $f_build                = gpc_get_string( 'build', '' );
 100          $f_platform                = gpc_get_string( 'platform', '' );
 101          $f_os                    = gpc_get_string( 'os', '' );
 102          $f_os_build                = gpc_get_string( 'os_build', '' );
 103          $f_product_version        = gpc_get_string( 'product_version', '' );
 104          $f_target_version        = gpc_get_string( 'target_version', '' );
 105          $f_profile_id            = gpc_get_int( 'profile_id', 0 );
 106          $f_handler_id            = gpc_get_int( 'handler_id', 0 );
 107  
 108          $f_category                = gpc_get_string( 'category', config_get( 'default_bug_category' ) );
 109          $f_reproducibility        = gpc_get_int( 'reproducibility', config_get( 'default_bug_reproducibility' ) );
 110          $f_severity                = gpc_get_int( 'severity', config_get( 'default_bug_severity' ) );
 111          $f_priority                = gpc_get_int( 'priority', config_get( 'default_bug_priority' ) );
 112          $f_summary                = gpc_get_string( 'summary', '' );
 113          $f_description            = gpc_get_string( 'description', '' );
 114          $f_steps_to_reproduce    = gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) );
 115          $f_additional_info        = gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) );
 116          $f_view_state            = gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
 117  
 118          $t_project_id            = helper_get_current_project();
 119  
 120          $t_changed_project        = false;
 121      }
 122  
 123      $f_report_stay            = gpc_get_bool( 'report_stay', false );
 124  
 125      html_page_top1( lang_get( 'report_bug_link' ) );
 126      html_page_top2();
 127  
 128      print_recently_visited();
 129  ?>
 130  
 131  <br />
 132  <div align="center">
 133  <form name="report_bug_form" method="post" <?php if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?> action="bug_report.php">
 134  <table class="width75" cellspacing="1">
 135  
 136  
 137  <!-- Title -->
 138  <tr>
 139      <td class="form-title">
 140          <input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
 141          <input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
 142          <?php echo lang_get( 'enter_report_details_title' ) ?>
 143      </td>
 144      <td class="right">
 145          <?php
 146              if ( BOTH == config_get( 'show_report' ) ) {
 147                  print_bracket_link( 'bug_report_page.php' .
 148                      ( $f_master_bug_id > 0 ? '?m_id=' . $f_master_bug_id : '' ), lang_get( 'simple_report_link' ) );
 149              }
 150          ?>
 151      </td>
 152  </tr>
 153  
 154  
 155  <!-- Category -->
 156  <tr <?php echo helper_alternate_class() ?>>
 157      <td class="category" width="30%">
 158          <?php echo '<span class="required">*</span>', lang_get( 'category' ) ?> <?php print_documentation_link( 'category' ) ?>
 159      </td>
 160      <td width="70%">
 161          <?php if ( $t_changed_project ) {
 162              echo "[" . project_get_field( $t_bug->project_id, 'name' ) . "] ";
 163          } ?>
 164          <select <?php echo helper_get_tab_index() ?> name="category">
 165              <?php 
 166                  if ( is_blank( $f_category ) ) {
 167                      echo '<option value="" selected="selected">', string_attribute( lang_get( 'select_option' ) ), '</option>';
 168                  }
 169  
 170                  print_category_option_list( $f_category ); 
 171              ?>
 172          </select>
 173      </td>
 174  </tr>
 175  
 176  
 177  <!-- Reproducibility -->
 178  <tr <?php echo helper_alternate_class() ?>>
 179      <td class="category">
 180          <?php echo lang_get( 'reproducibility' ) ?> <?php print_documentation_link( 'reproducibility' ) ?>
 181      </td>
 182      <td>
 183          <select <?php echo helper_get_tab_index() ?> name="reproducibility">
 184              <?php print_enum_string_option_list( 'reproducibility', $f_reproducibility ) ?>
 185          </select>
 186      </td>
 187  </tr>
 188  
 189  <!-- Severity -->
 190  <tr <?php echo helper_alternate_class() ?>>
 191      <td class="category">
 192          <?php echo lang_get( 'severity' ) ?> <?php print_documentation_link( 'severity' ) ?>
 193      </td>
 194      <td>
 195          <select <?php echo helper_get_tab_index() ?> name="severity">
 196              <?php print_enum_string_option_list( 'severity', $f_severity ) ?>
 197          </select>
 198      </td>
 199  </tr>
 200  
 201  
 202  <!-- Priority (if permissions allow) -->
 203  <?php if ( access_has_project_level( config_get( 'handle_bug_threshold' ) ) ) { ?>
 204  <tr <?php echo helper_alternate_class() ?>>
 205      <td class="category">
 206          <?php echo lang_get( 'priority' ) ?> <?php print_documentation_link( 'priority' ) ?>
 207      </td>
 208      <td>
 209          <select <?php echo helper_get_tab_index() ?> name="priority">
 210              <?php print_enum_string_option_list( 'priority', $f_priority ) ?>
 211          </select>
 212      </td>
 213  </tr>
 214  <?php } ?>
 215  
 216  
 217  <!-- spacer -->
 218  <tr class="spacer">
 219      <td colspan="2"></td>
 220  </tr>
 221  
 222  
 223  <!-- Profile -->
 224  <tr <?php echo helper_alternate_class() ?>>
 225      <td class="category">
 226          <?php echo lang_get( 'select_profile' ) ?>
 227      </td>
 228      <td>
 229          <select <?php echo helper_get_tab_index() ?> name="profile_id">
 230              <?php print_profile_option_list( auth_get_current_user_id(), $f_profile_id ) ?>
 231          </select>
 232      </td>
 233  </tr>
 234  
 235  
 236  <!-- instructions -->
 237  <tr>
 238      <td colspan="2">
 239          <?php echo lang_get( 'or_fill_in' ) ?>
 240      </td>
 241  </tr>
 242  
 243  
 244  <!-- Platform -->
 245  <tr <?php echo helper_alternate_class() ?>>
 246      <td class="category">
 247          <?php echo lang_get( 'platform' ) ?>
 248      </td>
 249      <td>
 250          <?php
 251              if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
 252          ?>
 253                  <select name="platform">
 254                      <option value=""></option>
 255                  <?php
 256                          print_platform_option_list( $f_platform );
 257                  ?>
 258                  </select>
 259          <?php
 260              } else {
 261                  projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $f_platform, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
 262              }
 263          ?>
 264      </td>
 265  </tr>
 266  
 267  
 268  <!-- Operating System -->
 269  <tr <?php echo helper_alternate_class() ?>>
 270      <td class="category">
 271          <?php echo lang_get( 'os' ) ?>
 272      </td>
 273      <td>
 274          <?php
 275              if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
 276          ?>
 277                  <select name="os">
 278                      <option value=""></option>
 279                  <?php
 280                          print_os_option_list( $f_os );
 281                  ?>
 282                  </select>
 283          <?php
 284              } else {
 285                  projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $f_os, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
 286              }
 287          ?>
 288      </td>
 289  </tr>
 290  
 291  
 292  <!-- OS Version -->
 293  <tr <?php echo helper_alternate_class() ?>>
 294      <td class="category">
 295          <?php echo lang_get( 'os_version' ) ?>
 296      </td>
 297      <td>
 298          <?php
 299              if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
 300          ?>
 301                  <select name="os_build">
 302                      <option value=""></option>
 303                  <?php
 304                          print_os_build_option_list( $f_os_build );
 305                  ?>
 306                  </select>
 307          <?php
 308              } else {
 309                  projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $f_os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
 310              }
 311          ?>
 312      </td>
 313  </tr>
 314  
 315  
 316  <!-- spacer -->
 317  <tr class="spacer">
 318      <td colspan="2"></td>
 319  </tr>
 320  
 321  
 322  <?php
 323      $t_show_version = ( ON == config_get( 'show_product_version' ) )
 324              || ( ( AUTO == config_get( 'show_product_version' ) )
 325                          && ( count( version_get_all_rows( $t_project_id ) ) > 0 ) );
 326      if ( $t_show_version ) {
 327  ?>
 328  <!-- Product Version -->
 329  <tr <?php echo helper_alternate_class() ?>>
 330      <td class="category">
 331          <?php echo lang_get( 'product_version' ) ?>
 332      </td>
 333      <td>
 334          <select <?php echo helper_get_tab_index() ?> name="product_version">
 335              <?php print_version_option_list( $f_product_version, $t_project_id, VERSION_RELEASED ) ?>
 336          </select>
 337      </td>
 338  </tr>
 339  <?php
 340      }
 341  ?>
 342  
 343  <!-- Product Build -->
 344  <tr <?php echo helper_alternate_class() ?>>
 345      <td class="category">
 346          <?php echo lang_get( 'product_build' ) ?>
 347      </td>
 348      <td>
 349          <input <?php echo helper_get_tab_index() ?> type="text" name="build" size="32" maxlength="32" value="<?php echo $f_build ?>" />
 350      </td>
 351  </tr>
 352  
 353  
 354  <!-- Handler (if permissions allow) -->
 355  <?php if ( access_has_project_level( config_get( 'update_bug_assign_threshold' ) ) ) { ?>
 356  <!-- spacer -->
 357  <tr class="spacer">
 358      <td colspan="2"></td>
 359  </tr>
 360  <tr <?php echo helper_alternate_class() ?>>
 361      <td class="category">
 362          <?php echo lang_get( 'assign_to' ) ?>
 363      </td>
 364      <td>
 365          <select <?php echo helper_get_tab_index() ?> name="handler_id">
 366              <option value="0" selected="selected"></option>
 367              <?php print_assign_to_option_list( $f_handler_id ) ?>
 368          </select>
 369      </td>
 370  </tr>
 371  <?php } ?>
 372  
 373  <!-- Target Version (if permissions allow) -->
 374  <?php if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) { ?>
 375  <tr <?php echo helper_alternate_class() ?>>
 376      <td class="category">
 377          <?php echo lang_get( 'target_version' ) ?>
 378      </td>
 379      <td>
 380          <select <?php echo helper_get_tab_index() ?> name="target_version">
 381              <?php print_version_option_list() ?>
 382          </select>
 383      </td>
 384  </tr>
 385  <?php } ?>
 386  
 387  
 388  <!-- spacer -->
 389  <tr class="spacer">
 390      <td colspan="2"></td>
 391  </tr>
 392  
 393  
 394  <!-- Summary -->
 395  <tr <?php echo helper_alternate_class() ?>>
 396      <td class="category">
 397          <span class="required">*</span><?php echo lang_get( 'summary' ) ?> <?php print_documentation_link( 'summary' ) ?>
 398      </td>
 399      <td>
 400          <input <?php echo helper_get_tab_index() ?> type="text" name="summary" size="105" maxlength="128" value="<?php echo $f_summary ?>" />
 401      </td>
 402  </tr>
 403  
 404  
 405  <!-- Description -->
 406  <tr <?php echo helper_alternate_class() ?>>
 407      <td class="category">
 408          <span class="required">*</span><?php echo lang_get( 'description' ) ?> <?php print_documentation_link( 'description' ) ?>
 409      </td>
 410      <td>
 411          <textarea <?php echo helper_get_tab_index() ?> name="description" cols="80" rows="10"><?php echo $f_description ?></textarea>
 412      </td>
 413  </tr>
 414  
 415  
 416  <!-- Steps to Reproduce -->
 417  <tr <?php echo helper_alternate_class() ?>>
 418      <td class="category">
 419          <?php echo lang_get( 'steps_to_reproduce' ) ?> <?php print_documentation_link( 'steps_to_reproduce' ) ?>
 420      </td>
 421      <td>
 422          <textarea <?php echo helper_get_tab_index() ?> name="steps_to_reproduce" cols="80" rows="10"><?php echo $f_steps_to_reproduce ?></textarea>
 423      </td>
 424  </tr>
 425  
 426  
 427  <!-- Additional Information -->
 428  <tr <?php echo helper_alternate_class() ?>>
 429      <td class="category">
 430          <?php echo lang_get( 'additional_information' ) ?> <?php print_documentation_link( 'additional_information' ) ?>
 431      </td>
 432      <td>
 433          <textarea <?php echo helper_get_tab_index() ?> name="additional_info" cols="80" rows="10"><?php echo $f_additional_info ?></textarea>
 434      </td>
 435  </tr>
 436  
 437  
 438  <tr class="spacer">
 439      <td colspan="2"></td>
 440  </tr>
 441  
 442  
 443  <!-- Custom Fields -->
 444  <?php
 445      $t_custom_fields_found = false;
 446      $t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id );
 447  
 448      foreach( $t_related_custom_field_ids as $t_id ) {
 449          $t_def = custom_field_get_definition( $t_id );
 450          if( ( $t_def['display_report'] || $t_def['require_report']) && custom_field_has_write_access_to_project( $t_id, $t_project_id ) ) {
 451              $t_custom_fields_found = true;
 452  ?>
 453  <tr <?php echo helper_alternate_class() ?>>
 454      <td class="category">
 455          <?php if($t_def['require_report']) {?><span class="required">*</span><?php } ?><?php echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?>
 456      </td>
 457      <td>
 458          <?php print_custom_field_input( $t_def, ( $f_master_bug_id === 0 ) ? null : $f_master_bug_id ) ?>
 459      </td>
 460  </tr>
 461  <?php
 462          }
 463      } # foreach( $t_related_custom_field_ids as $t_id )
 464  ?>
 465  
 466  
 467  <?php if ( $t_custom_fields_found ) { ?>
 468  <!-- spacer -->
 469  <tr class="spacer">
 470      <td colspan="2">&nbsp;</td>
 471  </tr>
 472  <?php } # custom fields found ?>
 473  
 474  
 475  <!-- File Upload (if enabled) -->
 476  <?php if ( file_allow_bug_upload() ) {
 477      $t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
 478  ?>
 479  <tr <?php echo helper_alternate_class() ?>>
 480      <td class="category">
 481          <?php echo lang_get( 'upload_file' ) ?>
 482          <?php echo '<span class="small">(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)</span>'?>
 483      </td>
 484      <td>
 485          <input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
 486          <input <?php echo helper_get_tab_index() ?> name="file" type="file" size="60" />
 487      </td>
 488  </tr>
 489  <?php } ?>
 490  
 491  
 492  <!-- View Status -->
 493  <tr <?php echo helper_alternate_class() ?>>
 494      <td class="category">
 495          <?php echo lang_get( 'view_status' ) ?>
 496      </td>
 497      <td>
 498  <?php
 499      if ( access_has_project_level( config_get( 'set_view_status_threshold' ) ) ) {
 500  ?>
 501          <input <?php echo helper_get_tab_index() ?> type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
 502          <input <?php echo helper_get_tab_index() ?> type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
 503  <?php
 504      } else {
 505          echo get_enum_element( 'project_view_state', $f_view_state );
 506      }
 507  ?>
 508      </td>
 509  </tr>
 510  
 511  <!-- Relationship (in case of cloned bug creation...) -->
 512  <?php
 513      if( $f_master_bug_id > 0 ) {
 514  ?>
 515  <tr <?php echo helper_alternate_class() ?>>
 516      <td class="category">
 517          <?php echo lang_get( 'relationship_with_parent' ) ?>
 518      </td>
 519      <td>
 520          <?php relationship_list_box( /* none */ -2, "rel_type", false, true ) ?>
 521          <?php PRINT '<b>' . lang_get( 'bug' ) . ' ' . bug_format_id( $f_master_bug_id ) . '</b>' ?>
 522      </td>
 523  </tr>
 524  <?php
 525      }
 526  ?>
 527  
 528  <!-- Report Stay (report more bugs) -->
 529  <tr <?php echo helper_alternate_class() ?>>
 530      <td class="category">
 531          <?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?>
 532      </td>
 533      <td>
 534          <input <?php echo helper_get_tab_index() ?> type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
 535      </td>
 536  </tr>
 537  
 538  
 539  <!-- Submit Button -->
 540  <tr>
 541      <td class="left">
 542          <span class="required"> * <?php echo lang_get( 'required' ) ?></span>
 543      </td>
 544      <td class="center">
 545          <input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
 546      </td>
 547  </tr>
 548  
 549  
 550  </table>
 551  </form>
 552  </div>
 553  
 554  <!-- Autofocus JS -->
 555  <?php if ( ON == config_get( 'use_javascript' ) ) { ?>
 556  <script type="text/javascript" language="JavaScript">
 557  <!--
 558      window.document.report_bug_form.category.focus();
 559  -->
 560  </script>
 561  <?php } ?>
 562  
 563  <?php html_page_bottom1( __FILE__ ) ?>


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