[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> view_all_set.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: view_all_set.php,v 1.67.2.1 2007-10-13 22:34:48 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php require_once ( 'core.php' ) ?>
  25  <?php auth_ensure_user_authenticated() ?>
  26  <?php
  27      $f_type                    = gpc_get_int( 'type', -1 );
  28      $f_source_query_id        = gpc_get_int( 'source_query_id', -1 );
  29      $f_print                = gpc_get_bool( 'print' );
  30      $f_temp_filter            = gpc_get_bool( 'temporary' );
  31  
  32      # validate filter type
  33      $f_default_view_type = 'simple';
  34      if ( ADVANCED_DEFAULT == config_get( 'view_filters' ) ) {
  35          $f_default_view_type = 'advanced';
  36      }
  37  
  38      $f_view_type = gpc_get_string( 'view_type', $f_default_view_type );
  39      if ( ADVANCED_ONLY == config_get( 'view_filters' ) ) {
  40          $f_view_type = 'advanced';
  41      }
  42      if ( SIMPLE_ONLY == config_get( 'view_filters' ) ) {
  43          $f_view_type = 'simple';
  44      }
  45      if ( ! in_array( $f_view_type, array( 'simple', 'advanced' ) ) ) {
  46          $f_view_type = $f_default_view_type;
  47      }    
  48  
  49      # these are all possibly multiple selections for advanced filtering
  50      $f_show_category = array();
  51      if ( is_array( gpc_get( 'show_category', null ) ) ) {
  52          $f_show_category = gpc_get_string_array( 'show_category', META_FILTER_ANY );
  53      } else {
  54          $f_show_category = gpc_get_string( 'show_category', META_FILTER_ANY );
  55          $f_show_category = array( $f_show_category );
  56      }
  57  
  58      $f_platform = array();
  59      if ( is_array( gpc_get( 'platform', null ) ) ) {
  60          $f_platform = gpc_get_string_array( 'platform', META_FILTER_ANY );
  61      } else {
  62          $f_platform = gpc_get_string( 'platform', META_FILTER_ANY );
  63          $f_platform = array( $f_platform );
  64      }
  65  
  66      $f_os = array();
  67      if ( is_array( gpc_get( 'os', null ) ) ) {
  68          $f_os = gpc_get_string_array( 'os', META_FILTER_ANY );
  69      } else {
  70          $f_os = gpc_get_string( 'os', META_FILTER_ANY );
  71          $f_os = array( $f_os );
  72      }
  73  
  74      $f_os_build = array();
  75      if ( is_array( gpc_get( 'os_build', null ) ) ) {
  76          $f_os_build = gpc_get_string_array( 'os_build', META_FILTER_ANY );
  77      } else {
  78          $f_os_build = gpc_get_string( 'os_build', META_FILTER_ANY );
  79          $f_os_build = array( $f_os_build );
  80      }
  81  
  82      $f_show_severity = array();
  83      if ( is_array( gpc_get( 'show_severity', null ) ) ) {
  84          $f_show_severity = gpc_get_string_array( 'show_severity', META_FILTER_ANY );
  85      } else {
  86          $f_show_severity = gpc_get_string( 'show_severity', META_FILTER_ANY );
  87          $f_show_severity = array( $f_show_severity );
  88      }
  89  
  90      $f_show_status = array();
  91      if ( is_array( gpc_get( 'show_status', null ) ) ) {
  92          $f_show_status = gpc_get_string_array( 'show_status', META_FILTER_ANY );
  93      } else {
  94          $f_show_status = gpc_get_string( 'show_status', META_FILTER_ANY );
  95          $f_show_status = array( $f_show_status );
  96      }
  97  
  98      $f_hide_status = array();
  99      if ( is_array( gpc_get( 'hide_status', null ) ) ) {
 100          $f_hide_status = gpc_get_string_array( 'hide_status', META_FILTER_NONE );
 101      } else {
 102          $f_hide_status = gpc_get_string( 'hide_status', META_FILTER_NONE );
 103          $f_hide_status = array( $f_hide_status );
 104      }
 105  
 106      $f_reporter_id = array();
 107      if ( is_array( gpc_get( 'reporter_id', null ) ) ) {
 108          $f_reporter_id = gpc_get_string_array( 'reporter_id', META_FILTER_ANY );
 109      } else {
 110          $f_reporter_id = gpc_get_string( 'reporter_id', META_FILTER_ANY );
 111          $f_reporter_id = array( $f_reporter_id );
 112      }
 113  
 114      $f_handler_id = array();
 115      if ( is_array( gpc_get( 'handler_id', null ) ) ) {
 116          $f_handler_id = gpc_get_string_array( 'handler_id', META_FILTER_ANY );
 117      } else {
 118          $f_handler_id = gpc_get_string( 'handler_id', META_FILTER_ANY );
 119          $f_handler_id = array( $f_handler_id );
 120      }
 121  
 122      $f_project_id = array();
 123      if ( is_array( gpc_get( 'project_id', null ) ) ) {
 124          $f_project_id = gpc_get_int_array( 'project_id', META_FILTER_CURRENT );
 125      } else {
 126          $f_project_id = gpc_get_int( 'project_id', META_FILTER_CURRENT );
 127          $f_project_id = array( $f_project_id );
 128      }
 129  
 130      $f_show_resolution = array();
 131      if ( is_array( gpc_get( 'show_resolution', null ) ) ) {
 132          $f_show_resolution = gpc_get_string_array( 'show_resolution', META_FILTER_ANY );
 133      } else {
 134          $f_show_resolution = gpc_get_string( 'show_resolution', META_FILTER_ANY );
 135          $f_show_resolution = array( $f_show_resolution );
 136      }
 137  
 138      $f_show_build = array();
 139      if ( is_array( gpc_get( 'show_build', null ) ) ) {
 140          $f_show_build = gpc_get_string_array( 'show_build', META_FILTER_ANY );
 141      } else {
 142          $f_show_build = gpc_get_string( 'show_build', META_FILTER_ANY );
 143          $f_show_build = array( $f_show_build );
 144      }
 145  
 146      $f_show_version = array();
 147      if ( is_array( gpc_get( 'show_version', null ) ) ) {
 148          $f_show_version = gpc_get_string_array( 'show_version', META_FILTER_ANY );
 149      } else {
 150          $f_show_version = gpc_get_string( 'show_version', META_FILTER_ANY );
 151          $f_show_version = array( $f_show_version );
 152      }
 153  
 154      $f_fixed_in_version = array();
 155      if ( is_array( gpc_get( 'fixed_in_version', null ) ) ) {
 156          $f_fixed_in_version = gpc_get_string_array( 'fixed_in_version', META_FILTER_ANY );
 157      } else {
 158          $f_fixed_in_version = gpc_get_string( 'fixed_in_version', META_FILTER_ANY );
 159          $f_fixed_in_version = array( $f_fixed_in_version );
 160      }
 161      
 162      $f_target_version = array();
 163      if ( is_array( gpc_get( 'target_version', null ) ) ) {
 164          $f_target_version = gpc_get_string_array( 'target_version', META_FILTER_ANY );
 165      } else {
 166          $f_target_version = gpc_get_string( 'target_version', META_FILTER_ANY );
 167          $f_target_version = array( $f_target_version );
 168      }
 169  
 170      $f_show_profile = array();
 171      if ( is_array( gpc_get( 'show_profile', null ) ) ) {
 172          $f_show_profile = gpc_get_string_array( 'show_profile', META_FILTER_ANY );
 173      } else {
 174          $f_show_profile = gpc_get_string( 'show_profile', META_FILTER_ANY );
 175          $f_show_profile = array( $f_show_profile );
 176      }
 177  
 178      $f_show_priority = array();
 179      if ( is_array( gpc_get( 'show_priority', null ) ) ) {
 180          $f_show_priority = gpc_get_string_array( 'show_priority', META_FILTER_ANY );
 181      } else {
 182          $f_show_priority = gpc_get_string( 'show_priority', META_FILTER_ANY );
 183          $f_show_priority = array( $f_show_priority );
 184      }
 185  
 186      $f_user_monitor = array();
 187      if ( is_array( gpc_get( 'user_monitor', null ) ) ) {
 188          $f_user_monitor = gpc_get_string_array( 'user_monitor', META_FILTER_ANY );
 189      } else {
 190          $f_user_monitor = gpc_get_string( 'user_monitor', META_FILTER_ANY );
 191          $f_user_monitor = array( $f_user_monitor );
 192      }
 193  
 194      # these are only single values, even when doing advanced filtering
 195      $f_per_page                = gpc_get_int( 'per_page', -1 );
 196      $f_highlight_changed    = gpc_get_int( 'highlight_changed', config_get( 'default_show_changed' ) );
 197      $f_sticky_issues        = gpc_get_bool( 'sticky_issues' );
 198      # sort direction
 199      $f_sort_d                    = gpc_get_string( 'sort', '' );
 200      $f_dir_d                    = gpc_get_string( 'dir', '' );
 201      $f_sort_0                = gpc_get_string( 'sort_0', 'last_updated' );
 202      $f_dir_0                = gpc_get_string( 'dir_0', 'DESC' );
 203      $f_sort_1                = gpc_get_string( 'sort_1', '' );
 204      $f_dir_1                = gpc_get_string( 'dir_1', '' );
 205  
 206      # date values
 207      $f_start_month            = gpc_get_int( 'start_month', date( 'm' ) );
 208      $f_end_month            = gpc_get_int( 'end_month', date( 'm' ) );
 209      $f_start_day            = gpc_get_int( 'start_day', 1 );
 210      $f_end_day                = gpc_get_int( 'end_day', date( 'd' ) );
 211      $f_start_year            = gpc_get_int( 'start_year', date( 'Y' ) );
 212      $f_end_year                = gpc_get_int( 'end_year', date( 'Y' ) );
 213      $f_search                = gpc_get_string( 'search', '' );
 214      $f_and_not_assigned        = gpc_get_bool( 'and_not_assigned' );
 215      $f_do_filter_by_date    = gpc_get_bool( 'do_filter_by_date' );
 216      $f_view_state            = gpc_get_int( 'view_state', META_FILTER_ANY );
 217  
 218      $f_tag_string            = gpc_get_string( 'tag_string', '' );
 219      $f_tag_select            = gpc_get_int( 'tag_select', '0' );
 220  
 221      $t_custom_fields         = custom_field_get_ids(); # @@@ (thraxisp) This should really be the linked ids, but we don't know the project
 222      $f_custom_fields_data     = array();
 223      if ( is_array( $t_custom_fields ) && ( sizeof( $t_custom_fields ) > 0 ) ) {
 224          foreach( $t_custom_fields as $t_cfid ) {
 225              if (custom_field_type( $t_cfid ) == CUSTOM_FIELD_TYPE_DATE) {
 226                  $t_control = gpc_get_string( 'custom_field_' . $t_cfid . '_control', null);
 227  
 228                  $t_year = gpc_get_int( 'custom_field_' . $t_cfid . '_start_year', null);
 229                  $t_month = gpc_get_int( 'custom_field_' . $t_cfid . '_start_month', null);
 230                  $t_day = gpc_get_int( 'custom_field_' . $t_cfid . '_start_day', null);
 231                  $t_start_date = mktime(0, 0, 0, $t_month, $t_day, $t_year);
 232  
 233                  $t_year = gpc_get_int( 'custom_field_' . $t_cfid . '_end_year', null);
 234                  $t_month = gpc_get_int( 'custom_field_' . $t_cfid . '_end_month', null);
 235                  $t_day = gpc_get_int( 'custom_field_' . $t_cfid . '_end_day', null);
 236                  $t_end_date = mktime(0, 0, 0, $t_month, $t_day, $t_year);
 237  
 238                  $f_custom_fields_data[$t_cfid] = array();
 239                  $f_custom_fields_data[$t_cfid][0] = $t_control;
 240                  $t_start = 1;
 241                  $t_end = 1;
 242                  $t_one_day = 86399;
 243  
 244                  switch ($t_control)
 245                  {
 246                  case CUSTOM_FIELD_DATE_ANY:
 247                  case CUSTOM_FIELD_DATE_NONE:
 248                      break ;
 249                  case CUSTOM_FIELD_DATE_BETWEEN:
 250                      $t_start = $t_start_date;
 251                      $t_end = $t_end_date + $t_one_day - 1;
 252                      break ;
 253                  case CUSTOM_FIELD_DATE_ONORBEFORE:
 254                      $t_end = $t_start_date + $t_one_day - 1;
 255                      break;
 256                  case CUSTOM_FIELD_DATE_BEFORE:
 257                      $t_end = $t_start_date;
 258                      break ;
 259                  case CUSTOM_FIELD_DATE_ON:
 260                      $t_start = $t_start_date;
 261                      $t_end = $t_start_date + $t_one_day - 1;
 262                      break;
 263                  case CUSTOM_FIELD_DATE_AFTER:
 264                      $t_start = $t_start_date + $t_one_day - 1;
 265                      $t_end = 2147483647; // Some time in 2038, max value of a signed int.
 266                      break;
 267                  case CUSTOM_FIELD_DATE_ONORAFTER:
 268                      $t_start = $t_start_date;
 269                      $t_end = 2147483647; // Some time in 2038, max value of a signed int.
 270                      break;
 271                  }
 272                  $f_custom_fields_data[$t_cfid][1] = $t_start;
 273                  $f_custom_fields_data[$t_cfid][2] = $t_end;
 274              } else {
 275                  if ( is_array( gpc_get( 'custom_field_' . $t_cfid, null ) ) ) {
 276                      $f_custom_fields_data[$t_cfid] = gpc_get_string_array( 'custom_field_' . $t_cfid, META_FILTER_ANY );
 277                  } else {
 278                      $f_custom_fields_data[$t_cfid] = gpc_get_string( 'custom_field_' . $t_cfid, META_FILTER_ANY );
 279                      $f_custom_fields_data[$t_cfid] = array( $f_custom_fields_data[$t_cfid] );
 280                  }
 281              }
 282          }
 283      }
 284  
 285      $f_relationship_type = gpc_get_int( 'relationship_type', -1 );
 286      $f_relationship_bug = gpc_get_int( 'relationship_bug', 0 );
 287  
 288      if ( $f_temp_filter ) {
 289          $f_type = 1;
 290      }
 291  
 292      if ( $f_and_not_assigned ) {
 293          $f_and_not_assigned = 'on';
 294      }
 295  
 296      if ( $f_do_filter_by_date ) {
 297          $f_do_filter_by_date = 'on';
 298      }
 299  
 300      if ( $f_sticky_issues ) {
 301          $f_sticky_issues = 'on';
 302      } else {
 303          $f_sticky_issues = 'off';
 304      }
 305  
 306      if ( $f_type < 0 ) {
 307          print_header_redirect( 'view_all_bug_page.php' );
 308      }
 309  
 310      $t_hide_status_default = config_get( 'hide_status_default' );
 311  
 312      # show bugs per page
 313      if ( $f_per_page < 0 ) {
 314          $f_per_page = config_get( 'default_limit_view' );
 315      }
 316  
 317      # combine sort settings
 318      #  (f_sort overrides f_sort_1 if set to keep old sorting code working in view_all_bug_inc)
 319      $f_sort = ( ( $f_sort_d != "" ) ? $f_sort_d : $f_sort_0 ) . ( ( $f_sort_1 != "" ) ? "," . $f_sort_1 : "" );
 320      $f_dir = ( ( $f_dir_d != "" ) ? $f_dir_d : $f_dir_0 ) . ( ( $f_dir_1 != "" ) ? "," . $f_dir_1 : "" );
 321  
 322      # -1 is a special case stored query: it means we want to reset our filter
 323      if ( ( $f_type == 3 ) && ( $f_source_query_id == -1 ) ) {
 324          $f_type = 0;
 325      }
 326  
 327  /*   array contents
 328       --------------
 329       0: version
 330       1: $f_show_category
 331       2: $f_show_severity
 332       3: $f_show_status
 333       4: $f_per_page
 334       5: $f_highlight_changed
 335       6: $f_hide_closed
 336       7: $f_reporter_id
 337       8: $f_handler_id
 338       9: $f_sort
 339      10: $f_dir
 340      11: $f_start_month
 341      12: $f_start_day
 342      13: $f_start_year
 343      14: $f_end_month
 344      15: $f_end_day
 345      16: $f_end_year
 346      17: $f_search
 347      18: $f_hide_resolved
 348      19: $f_and_not_assigned
 349      20: $f_show_resolution
 350      21: $f_show_build
 351      22: $f_show_version
 352      23: $f_do_filter_by_date
 353      24: $f_custom_field
 354      25: $f_relationship_type
 355      26: $f_relationship_bug
 356      27: $f_show_profile
 357  
 358  */
 359      # Set new filter values.  These are stored in a cookie
 360      $t_view_all_cookie_id = gpc_get_cookie( config_get( 'view_all_cookie' ), '' );
 361      $t_view_all_cookie = filter_db_get_filter( $t_view_all_cookie_id );
 362  
 363      # process the cookie if it exists, it may be blank in a new install
 364      if ( ! is_blank( $t_view_all_cookie ) ) {
 365          $t_setting_arr = filter_deserialize( $t_view_all_cookie );
 366          if ( false === $t_setting_arr ) {
 367              # couldn't deserialize, if we were trying to use the filter, clear it and reload
 368              # for ftype = 0, 1, or 3, we are going to re-write the filter anyways
 369              if ( !in_array( $f_type, array( 0, 1, 3 ) ) ) {
 370                  gpc_clear_cookie( 'view_all_cookie' );
 371                  error_proceed_url( 'view_all_set.php?type=0' );
 372                  trigger_error( ERROR_FILTER_TOO_OLD, ERROR );
 373                  exit; # stop here
 374              } 
 375          } 
 376      } else {
 377          # no cookie found, set it
 378          $f_type = 1;
 379      }
 380  
 381      $t_cookie_version = config_get( 'cookie_version' );
 382      $t_default_show_changed = config_get( 'default_show_changed' );
 383  
 384      switch ( $f_type ) {
 385          # New cookie
 386          case '0':
 387                  log_event( LOG_FILTERING, 'view_all_set.php: New cookie' );
 388                  $t_setting_arr = array();
 389  
 390                  break;
 391          # Update filters
 392          case '1':
 393                  log_event( LOG_FILTERING, 'view_all_set.php: Update filters' );
 394                  $t_setting_arr['_version'] = $t_cookie_version;
 395                  $t_setting_arr['_view_type'] = $f_view_type;
 396                  $t_setting_arr['show_category'] = $f_show_category;
 397                  $t_setting_arr['show_severity'] = $f_show_severity;
 398                  $t_setting_arr['show_status'] = $f_show_status;
 399                  $t_setting_arr['per_page'] = $f_per_page;
 400                  $t_setting_arr['highlight_changed'] = $f_highlight_changed;
 401                  $t_setting_arr['reporter_id'] = $f_reporter_id;
 402                  $t_setting_arr['handler_id'] = $f_handler_id;
 403                  $t_setting_arr['project_id'] = $f_project_id;
 404                  $t_setting_arr['sort'] = $f_sort;
 405                  $t_setting_arr['dir'] = $f_dir;
 406                  $t_setting_arr['start_month'] = $f_start_month;
 407                  $t_setting_arr['start_day'] = $f_start_day;
 408                  $t_setting_arr['start_year'] = $f_start_year;
 409                  $t_setting_arr['end_month'] = $f_end_month;
 410                  $t_setting_arr['end_day'] = $f_end_day;
 411                  $t_setting_arr['end_year'] = $f_end_year;
 412                  $t_setting_arr['search'] = $f_search;
 413                  $t_setting_arr['hide_status'] = $f_hide_status;
 414                  $t_setting_arr['and_not_assigned'] = $f_and_not_assigned;
 415                  $t_setting_arr['show_resolution'] = $f_show_resolution;
 416                  $t_setting_arr['show_build'] = $f_show_build;
 417                  $t_setting_arr['show_version'] = $f_show_version;
 418                  $t_setting_arr['do_filter_by_date'] = $f_do_filter_by_date;
 419                  $t_setting_arr['fixed_in_version'] = $f_fixed_in_version;
 420                  $t_setting_arr['target_version'] = $f_target_version;
 421                  $t_setting_arr['show_priority'] = $f_show_priority;
 422                  $t_setting_arr['user_monitor'] = $f_user_monitor;
 423                  $t_setting_arr['view_state'] = $f_view_state;
 424                  $t_setting_arr['custom_fields'] = $f_custom_fields_data;
 425                  $t_setting_arr['sticky_issues'] = $f_sticky_issues;
 426                  $t_setting_arr['relationship_type'] = $f_relationship_type;
 427                  $t_setting_arr['relationship_bug'] = $f_relationship_bug;
 428                  $t_setting_arr['show_profile'] = $f_show_profile;
 429                  $t_setting_arr['platform'] = $f_platform;
 430                  $t_setting_arr['os'] = $f_os;
 431                  $t_setting_arr['os_build'] = $f_os_build;
 432                  $t_setting_arr['tag_string'] = $f_tag_string;
 433                  $t_setting_arr['tag_select'] = $f_tag_select;
 434                  break;
 435          # Set the sort order and direction
 436          case '2':
 437                  log_event( LOG_FILTERING, 'view_all_set.php: Set the sort order and direction.' );
 438  
 439                  # We only need to set those fields that we are overriding
 440                  $t_setting_arr['sort'] = $f_sort;
 441                  $t_setting_arr['dir'] = $f_dir;
 442  
 443                  break;
 444          # This is when we want to copy another query from the
 445          # database over the top of our current one
 446          case '3':
 447                  log_event( LOG_FILTERING, 'view_all_set.php: Copy another query from database' );
 448  
 449                  $t_filter_string = filter_db_get_filter( $f_source_query_id );
 450                  # If we can use the query that we've requested,
 451                  # grab it. We will overwrite the current one at the
 452                  # bottom of this page
 453                  $t_setting_arr = filter_deserialize( $t_filter_string );
 454                  if ( false === $t_setting_arr ) {
 455                      # couldn't deserialize, if we were trying to use the filter, clear it and reload
 456                      gpc_clear_cookie( 'view_all_cookie' );
 457                      error_proceed_url( 'view_all_set.php?type=0' );
 458                      trigger_error( ERROR_FILTER_TOO_OLD, ERROR );
 459                      exit; # stop here
 460                  } 
 461                  break;
 462          # Generalise the filter
 463          case '4':
 464                  log_event( LOG_FILTERING, 'view_all_set.php: Generalise the filter' );
 465  
 466                  $t_setting_arr['show_category']    = array( META_FILTER_ANY );
 467                  $t_setting_arr['reporter_id']     = array( META_FILTER_ANY );
 468                  $t_setting_arr['handler_id']     = array( META_FILTER_ANY );
 469                  $t_setting_arr['show_build']     = array( META_FILTER_ANY );
 470                  $t_setting_arr['show_version']     = array( META_FILTER_ANY );
 471                  $t_setting_arr['show_priority']    = array( META_FILTER_ANY );
 472                  $t_setting_arr['fixed_in_version']    = array( META_FILTER_ANY );
 473                  $t_setting_arr['target_version']    = array( META_FILTER_ANY );
 474                  $t_setting_arr['user_monitor']         = array( META_FILTER_ANY );
 475                  $t_setting_arr['relationship_type'] = -1;
 476                  $t_setting_arr['relationship_bug'] = 0;
 477  
 478                  $t_custom_fields         = custom_field_get_ids(); # @@@ (thraxisp) This should really be the linked ids, but we don't know the project
 479                  $t_custom_fields_data     = array();
 480                  if ( is_array( $t_custom_fields ) && ( sizeof( $t_custom_fields ) > 0 ) ) {
 481                      foreach( $t_custom_fields as $t_cfid ) {
 482                          $t_custom_fields_data[$t_cfid] =  array( META_FILTER_ANY );
 483                      }
 484                  }
 485                  $t_setting_arr['custom_fields'] = $t_custom_fields_data;
 486  
 487                  break;
 488          # Just set the search string value
 489          case '5':
 490                  log_event( LOG_FILTERING, 'view_all_set.php: Search Text' );
 491                  $t_setting_arr['search'] = $f_search;
 492  
 493                  break;
 494          # Just set the view_state (simple / advanced) value
 495          case '6':
 496                  log_event( LOG_FILTERING, 'view_all_set.php: View state (simple/advanced)' );
 497                  $t_setting_arr['_view_type'] = $f_view_type;
 498  
 499                  break;
 500          # does nothing. catch all case
 501          default:
 502                  log_event( LOG_FILTERING, 'view_all_set.php: default - do nothing' );
 503                  break;
 504      }
 505  
 506      $tc_setting_arr = filter_ensure_valid_filter( $t_setting_arr );
 507  
 508      $t_settings_serialized = serialize( $tc_setting_arr );
 509      $t_settings_string = $t_cookie_version . '#' . $t_settings_serialized;
 510  
 511      # If only using a temporary filter, don't store it in the database
 512      if ( !$f_temp_filter ) {
 513          # Store the filter string in the database: its the current filter, so some values won't change
 514          $t_project_id = helper_get_current_project();
 515          $t_project_id = ( $t_project_id * -1 );
 516          $t_row_id = filter_db_set_for_current_user( $t_project_id, false, '', $t_settings_string );
 517  
 518          # set cookie values
 519          gpc_set_cookie( config_get( 'view_all_cookie' ), $t_row_id, time()+config_get( 'cookie_time_length' ), config_get( 'cookie_path' ) );
 520      }
 521  
 522      # redirect to print_all or view_all page
 523      if ( $f_print ) {
 524          $t_redirect_url = 'print_all_bug_page.php';
 525      } else {
 526          $t_redirect_url = 'view_all_bug_page.php';
 527      }
 528  
 529      if ( $f_temp_filter ) {
 530          $t_token_id = token_set( TOKEN_FILTER, $t_settings_serialized );
 531          $t_redirect_url = $t_redirect_url . '?filter=' . $t_token_id;
 532          html_meta_redirect( $t_redirect_url, 0 );
 533      } else {
 534          print_header_redirect( $t_redirect_url );
 535      }
 536  ?>


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