From 8a3f81c77c9ed56a4fd76be8aaf2315a2b9583b0 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 24 Jan 2013 17:24:04 +0000 Subject: [PATCH] Stop using a preference for selection default. If the definition has a filter set, use filter, otherwise default to search results --- .../inc/class.importexport_export_ui.inc.php | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index 0b77df0a69..e1ef5fdfab 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -212,11 +212,6 @@ class importexport_export_ui { } else { - if($definition->filter) - { - $content['selection'] = 'filter'; - } - // Process relative dates into the current absolute date foreach($content['filter']['fields'] as $field => $settings) { @@ -235,13 +230,10 @@ class importexport_export_ui { $preserv['old_definition'] = $content['definition']; - // If not set by plugin, pre-set selection to preference, or 'search' - if (($prefs = $GLOBALS['egw_info']['user']['preferences']['importexport'][$definition->definition_id]) && - ($prefs = unserialize($prefs)) && !$content['selection']['plugin_override']) + // If not set by plugin, pre-set selection to filter if definition has one, or 'search' + if (!$content['selection'] && $definition->filter) { - $selection = $content['selection']; - $content = array_merge_recursive($content,$prefs); - $content['selection'] = $prefs['selection'] ? $prefs['selection'] : $selection; + $content['selection'] = 'filter'; } if(!$content['selection']) { @@ -366,12 +358,6 @@ class importexport_export_ui { } } - // Keep settings - $keep = array_diff_key($_content, array_flip(array('appname', 'definition', 'plugin', 'preview', 'export', $tabs))); - $GLOBALS['egw']->preferences->add('importexport',$definition->definition_id,serialize($keep)); - // save prefs, but do NOT invalid the cache (unnecessary) - $GLOBALS['egw']->preferences->save_repository(false,'user',false); - // Store charset to use in header egw_cache::setSession('importexport', $tmpfname, $charset, 100);