[ 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_reminder.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_reminder.php,v 1.21.2.1 2007-10-13 22:32:49 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php
  25      # This page allows an authorized user to send a reminder by email to another user
  26  ?>
  27  <?php
  28      require_once ( 'core.php' );
  29  
  30      $t_core_path = config_get( 'core_path' );
  31  
  32      require_once( $t_core_path.'bug_api.php' );
  33      require_once( $t_core_path.'email_api.php' );
  34      require_once( $t_core_path.'bugnote_api.php' );
  35  ?>
  36  <?php
  37      $f_bug_id        = gpc_get_int( 'bug_id' );
  38      $f_to            = gpc_get_int_array( 'to' );
  39      $f_body            = gpc_get_string( 'body' );
  40  
  41      if ( bug_is_readonly( $f_bug_id ) ) {
  42          error_parameters( $f_bug_id );
  43          trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
  44      }
  45  
  46      access_ensure_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id );
  47  
  48      $t_bug = bug_get( $f_bug_id, true );
  49      if( $t_bug->project_id != helper_get_current_project() ) {
  50          # in case the current project is not the same project of the bug we are viewing...
  51          # ... override the current project. This to avoid problems with categories and handlers lists etc.
  52          $g_project_override = $t_bug->project_id;
  53      }
  54  
  55      # Automically add recipients to monitor list if they are above the monitor
  56      # threshold, option is enabled, and not reporter or handler.
  57      foreach ( $f_to as $t_recipient )
  58      {
  59          if ( ON == config_get( 'reminder_recipents_monitor_bug' ) &&
  60              access_has_bug_level( config_get( 'monitor_bug_threshold' ), $f_bug_id ) &&
  61              !bug_is_user_handler( $f_bug_id, $t_recipient ) &&
  62              !bug_is_user_reporter( $f_bug_id, $t_recipient ) ) {
  63              bug_monitor( $f_bug_id, $t_recipient );
  64          }
  65      }
  66  
  67      $result = email_bug_reminder( $f_to, $f_bug_id, $f_body );
  68  
  69      # Add reminder as bugnote if store reminders option is ON.
  70      if ( ON == config_get( 'store_reminders' ) ) {
  71          if ( count( $f_to ) > 50 ) {        # too many recipients to log, truncate the list
  72              $t_to = array();
  73              for ( $i=0; $i<50; $i++ ) {
  74                  $t_to[] = $f_to[$i];
  75              }
  76              $f_to = $t_to;
  77          }
  78          $t_attr = '|' . implode( '|', $f_to ) . '|';
  79          bugnote_add( $f_bug_id, $f_body, 0, config_get( 'default_reminder_view_status' ) == VS_PRIVATE, REMINDER, $t_attr );
  80      }
  81  
  82      html_page_top1();
  83      html_meta_redirect( string_get_bug_view_url( $f_bug_id ) );
  84      html_page_top2();
  85  ?>
  86  <br />
  87  <div align="center">
  88  <?php
  89      echo lang_get( 'operation_successful' ).'<br />';
  90      print_bracket_link( string_get_bug_view_url( $f_bug_id ), lang_get( 'proceed' ) );
  91  ?>
  92  </div>
  93  <?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