From 6b3adf212944bcacadde77f1ab73f56cc19cd514 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 1 Mar 2011 23:06:21 +0000 Subject: [PATCH] Add preference to use import/export definition for exporting from nextmatch --- calendar/inc/class.calendar_hooks.inc.php | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index a76db786cb..3094471652 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -611,6 +611,37 @@ class calendar_hooks 'admin' => False, ); } + // Import / Export for nextmatch + if ($GLOBALS['egw_info']['user']['apps']['importexport']) + { + $definitions = new importexport_definitions_bo(array( + 'type' => 'export', + 'application' => 'calendar' + )); + $options = array(); + foreach ((array)$definitions->get_definitions() as $identifier) { + try { + $definition = new importexport_definition($identifier); + } catch (Exception $e) { + // permission error + continue; + } + if ($title = $definition->get_title()) { + $options[$title] = $title; + } + unset($definition); + } + $settings['nextmatch-export-definition'] = array( + 'type' => 'select', + 'values' => $options, + 'label' => 'Export definitition to use for nextmatch export', + 'name' => 'nextmatch-export-definition', + 'help' => lang('If you specify an export definition, it will be used when you export'), + 'run_lang' => false, + 'xmlrpc' => True, + 'admin' => False, + ); + } return $settings; }