From ef5fe2728a42d0b726d1b4b37f496926b38ad600 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 23 Nov 2010 00:52:21 +0000 Subject: [PATCH] Keep user choices for next time they use the same export definition --- importexport/inc/class.importexport_export_ui.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index 302d6d6d7e..01206f4ed5 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -173,6 +173,7 @@ class importexport_export_ui { disable_button('exec[export]'); "); } + $content = array_merge($content,$GLOBALS['egw_info']['user']['preferences']['importexport'][$definition->definition_id]); unset ($plugin_object); (array)$apps = importexport_helper_functions::get_apps('export'); $sel_options['appname'] = array('' => lang('Select one')) + array_combine($apps,$apps); @@ -230,6 +231,13 @@ class importexport_export_ui { $plugin_object = new $definition->plugin; $plugin_object->export( $file, $definition ); + // Keep settings + $keep = array_diff_key($_content, array_flip(array('appname', 'definition', 'plugin', 'preview', 'export', $tabs))); + $GLOBALS['egw']->preferences->add('importexport',$definition->definition_id,$keep); + // save prefs, but do NOT invalid the cache (unnecessary) + $GLOBALS['egw']->preferences->save_repository(false,'user',false); + + if($_content['export'] == 'pressed') { fclose($file); $filename = pathinfo($tmpfname, PATHINFO_FILENAME);