Fix bug that did not let you select All for relative date

This commit is contained in:
Nathan Gray 2013-01-30 17:58:59 +00:00
parent 685cc0ab26
commit 31eed45551
2 changed files with 6 additions and 11 deletions

View File

@ -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)
{

View File

@ -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'])