[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> bugnote_edit_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: bugnote_edit_page.php,v 1.54.2.1 2007-10-13 22:33:07 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      # CALLERS
  25      #    This page is submitted to by the following pages:
  26      #    - bugnote_inc.php
  27  
  28      # EXPECTED BEHAVIOUR
  29      #    Allow the user to modify the text of a bugnote, then submit to
  30      #    bugnote_update.php with the new text
  31  
  32      # RESTRICTIONS & PERMISSIONS
  33      #    - none beyond API restrictions
  34  ?>
  35  <?php
  36      require_once ( 'core.php' );
  37  
  38      $t_core_path = config_get( 'core_path' );
  39  
  40      require_once( $t_core_path.'bug_api.php' );
  41      require_once( $t_core_path.'bugnote_api.php' );
  42      require_once( $t_core_path.'string_api.php' );
  43      require_once( $t_core_path.'current_user_api.php' );
  44  ?>
  45  <?php
  46      $f_bugnote_id = gpc_get_int( 'bugnote_id' );
  47      $t_bug_id = bugnote_get_field( $f_bugnote_id, 'bug_id' );
  48  
  49      $t_bug = bug_get( $t_bug_id, true );
  50      if( $t_bug->project_id != helper_get_current_project() ) {
  51          # in case the current project is not the same project of the bug we are viewing...
  52          # ... override the current project. This to avoid problems with categories and handlers lists etc.
  53          $g_project_override = $t_bug->project_id;
  54      }
  55  
  56      # Check if the current user is allowed to edit the bugnote
  57      $t_user_id = auth_get_current_user_id();
  58      $t_reporter_id = bugnote_get_field( $f_bugnote_id, 'reporter_id' );
  59  
  60      if ( ( $t_user_id != $t_reporter_id ) ||
  61           ( OFF == config_get( 'bugnote_allow_user_edit_delete' ) ) ) {
  62          access_ensure_bugnote_level( config_get( 'update_bugnote_threshold' ), $f_bugnote_id );
  63      }
  64  
  65      # Check if the bug is readonly
  66      if ( bug_is_readonly( $t_bug_id ) ) {
  67          error_parameters( $t_bug_id );
  68          trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
  69      }
  70  
  71      $t_bugnote_text = string_textarea( bugnote_get_text( $f_bugnote_id ) );
  72  
  73      # No need to gather the extra information if not used
  74      if ( config_get('time_tracking_enabled') &&
  75          access_has_bug_level( config_get( 'time_tracking_edit_threshold' ), $t_bug_id ) ) {
  76          $t_time_tracking = bugnote_get_field( $f_bugnote_id, "time_tracking" );
  77          $t_time_tracking = db_minutes_to_hhmm( $t_time_tracking );
  78      }
  79  
  80      # Determine which view page to redirect back to.
  81      $t_redirect_url = string_get_bug_view_url( $t_bug_id );
  82  ?>
  83  <?php html_page_top1( bug_format_summary( $t_bug_id, SUMMARY_CAPTION ) ) ?>
  84  <?php html_page_top2() ?>
  85  
  86  <br />
  87  <div align="center">
  88  <form method="post" action="bugnote_update.php">
  89  <table class="width75" cellspacing="1">
  90  <tr>
  91      <td class="form-title">
  92          <input type="hidden" name="bugnote_id" value="<?php echo $f_bugnote_id ?>" />
  93          <?php echo lang_get( 'edit_bugnote_title' ) ?>
  94      </td>
  95      <td class="right">
  96          <?php print_bracket_link( $t_redirect_url, lang_get( 'go_back' ) ) ?>
  97      </td>
  98  </tr>
  99  <tr class="row-1">
 100      <td class="center" colspan="2">
 101          <textarea cols="80" rows="10" name="bugnote_text"><?php echo $t_bugnote_text ?></textarea>
 102      </td>
 103  </tr>
 104  <?php if ( config_get('time_tracking_enabled') ) { ?>
 105  <?php if ( access_has_bug_level( config_get( 'time_tracking_edit_threshold' ), $t_bug_id ) ) { ?>
 106  <tr class="row-2">
 107      <td class="center" colspan="2">
 108          <b><?php echo lang_get( 'time_tracking') ?> (HH:MM)</b><br />
 109          <input type="text" name="time_tracking" size="5" value="<?php echo $t_time_tracking ?>" />
 110      </td>
 111  </tr>
 112  <?php } ?>
 113  <?php } ?>
 114  <tr>
 115      <td class="center" colspan="2">
 116          <input type="submit" class="button" value="<?php echo lang_get( 'update_information_button' ) ?>" />
 117      </td>
 118  </tr>
 119  </table>
 120  </form>
 121  </div>
 122  
 123  <?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