diff --git a/importexport/inc/class.filter_widget.inc.php b/importexport/inc/class.filter_widget.inc.php index d3200d5b75..959ff23bb1 100644 --- a/importexport/inc/class.filter_widget.inc.php +++ b/importexport/inc/class.filter_widget.inc.php @@ -24,6 +24,8 @@ class filter_widget extends customfields_widget { + // etemplate process_exec has trouble with the nulls, and returns the previous value + const ALL_DATES = '-all-'; public $prefix = ''; public $human_name = array( 'filter' => 'Import|Export filter' @@ -215,7 +217,7 @@ error_log('Trying to filter with unsupported field type: ' . $field['type']); 'readonly' => $readonly, 'no_lang' => true, 'options' => $options, - 'sel_options' => array('' => lang('all')) + 'sel_options' => array(self::ALL_DATES => lang('all')) )); foreach(importexport_helper_functions::$relative_dates as $label => $values) { diff --git a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php index 7b535d611b..9b439902fc 100644 --- a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php +++ b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php @@ -243,7 +243,7 @@ class importexport_wizard_basic_export_csv unset($content['set_filter']['fields']); foreach($content['set_filter'] as $key => $value) { - if($value) { + if($value && $value != '-all-') { $content['filter'][$key] = $value; } } @@ -267,20 +267,13 @@ class importexport_wizard_basic_export_csv $content['msg'] = $this->steps['wizard_step80']; $content['step'] = 'wizard_step80'; - // Find filterable fields - if(!$content['set_filter'] && $content['filter']) { - $load = true; - } $content['set_filter']['fields'] = importexport_helper_functions::get_filter_fields( $content['application'],$content['plugin'],$this ); // Load existing filter from either content or definition - if($load) + foreach($content['set_filter']['fields'] as $field => $settings) { - foreach($content['set_filter']['fields'] as $field => $settings) - { - $content['set_filter'][$field] = $content['filter'][$field]; - } + $content['set_filter'][$field] = $content['filter'][$field]; } if(!$content['set_filter']['fields'])