[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/core/ -> xmlhttprequest_api.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: xmlhttprequest_api.php,v 1.3.2.1 2007-10-13 22:35:51 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
  25  
  26      require_once ( $t_core_dir . 'bug_api.php' );
  27      require_once ( $t_core_dir . 'profile_api.php' );
  28      require_once ( $t_core_dir . 'logging_api.php' );
  29      require_once ( $t_core_dir . 'projax_api.php' );
  30  
  31      ### XmlHttpRequest API ###
  32  
  33  	function xmlhttprequest_issue_reporter_combobox() {
  34          $f_bug_id = gpc_get_int( 'issue_id' );
  35  
  36          access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id );
  37  
  38          $t_reporter_id = bug_get_field( $f_bug_id, 'reporter_id' );
  39          $t_project_id = bug_get_field( $f_bug_id, 'project_id' );
  40  
  41          echo '<select name="reporter_id">';
  42          print_reporter_option_list( $t_reporter_id, $t_project_id );
  43          echo '</select>';
  44      }
  45  
  46      /**
  47       * Print a generic combobox with a list of users above a given access level.
  48       */
  49  	function xmlhttprequest_user_combobox() {
  50          $f_user_id = gpc_get_int( 'user_id' );
  51          $f_user_access = gpc_get_int( 'access_level' );
  52          
  53          echo '<select name="user_id">';
  54          print_user_option_list( $f_user_id, ALL_PROJECTS, $f_user_access );
  55          echo '</select>';
  56      }
  57  
  58      # ---------------
  59      # Echos a serialized list of platforms starting with the prefix specified in the $_POST
  60  	function xmlhttprequest_platform_get_with_prefix() {
  61          $f_platform = gpc_get_string( 'platform' );
  62  
  63          $t_unique_entries = profile_get_field_all_for_user( 'platform' );
  64          $t_matching_entries = projax_array_filter_by_prefix( $t_unique_entries, $f_platform );
  65  
  66          echo projax_array_serialize_for_autocomplete( $t_matching_entries );
  67      }
  68  
  69      # ---------------
  70      # Echos a serialized list of OSes starting with the prefix specified in the $_POST
  71  	function xmlhttprequest_os_get_with_prefix() {
  72          $f_os = gpc_get_string( 'os' );
  73  
  74          $t_unique_entries = profile_get_field_all_for_user( 'os' );
  75          $t_matching_entries = projax_array_filter_by_prefix( $t_unique_entries, $f_os );
  76  
  77          echo projax_array_serialize_for_autocomplete( $t_matching_entries );
  78      }
  79  
  80      # ---------------
  81      # Echos a serialized list of OS Versions starting with the prefix specified in the $_POST
  82  	function xmlhttprequest_os_build_get_with_prefix() {
  83          $f_os_build = gpc_get_string( 'os_build' );
  84  
  85          $t_unique_entries = profile_get_field_all_for_user( 'os_build' );
  86          $t_matching_entries = projax_array_filter_by_prefix( $t_unique_entries, $f_os_build );
  87  
  88          echo projax_array_serialize_for_autocomplete( $t_matching_entries );
  89      }
  90  ?>


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