[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> query_store.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  <?php
  21      require_once ( 'core.php' );
  22      $t_core_path = config_get( 'core_path' );
  23  
  24      require_once( $t_core_path.'compress_api.php' );
  25      require_once( $t_core_path.'filter_api.php' );
  26      require_once( $t_core_path.'current_user_api.php' );
  27      require_once( $t_core_path.'bug_api.php' );
  28      require_once( $t_core_path.'string_api.php' );
  29      require_once( $t_core_path.'date_api.php' );
  30  
  31      auth_ensure_user_authenticated();
  32      compress_enable();
  33  
  34      $f_query_name = strip_tags( gpc_get_string( 'query_name' ) );
  35      $f_is_public = gpc_get_bool( 'is_public' );
  36      $f_all_projects = gpc_get_bool( 'all_projects' );
  37  
  38      $t_query_redirect_url = 'query_store_page.php';
  39  
  40      # We can't have a blank name
  41      if ( is_blank( $f_query_name ) ) {
  42          $t_query_redirect_url = $t_query_redirect_url . '?error_msg='
  43              . urlencode( lang_get( 'query_blank_name' ) );
  44          print_header_redirect( $t_query_redirect_url );
  45      }
  46  
  47      # Check and make sure they don't already have a
  48      # query with the same name
  49      $t_query_arr = filter_db_get_available_queries();
  50      foreach( $t_query_arr as $t_id => $t_name )    {
  51          if ( $f_query_name == $t_name ) {
  52              $t_query_redirect_url = $t_query_redirect_url . '?error_msg='
  53                  . urlencode( lang_get( 'query_dupe_name' ) );
  54              print_header_redirect( $t_query_redirect_url );
  55              exit;
  56          }
  57      }
  58  
  59      $t_project_id = helper_get_current_project();
  60      if ( $f_all_projects ) {
  61          $t_project_id = 0;
  62      }
  63  
  64      $t_filter_string = filter_db_get_filter( gpc_get_cookie( config_get( 'view_all_cookie' ), '' ) );
  65  
  66      $t_new_row_id = filter_db_set_for_current_user($t_project_id, $f_is_public,
  67                                                      $f_query_name, $t_filter_string);
  68  
  69      if ( $t_new_row_id == -1 ) {
  70          $t_query_redirect_url = $t_query_redirect_url . '?error_msg='
  71              . urlencode( lang_get( 'query_store_error' ) );
  72          print_header_redirect( $t_query_redirect_url );
  73      } else {
  74          print_header_redirect( 'view_all_bug_page.php' );
  75      }
  76  ?>


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