From 3992b96dbb1ec857df365cfd553b7c3083d2c275 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 2 Mar 2011 00:06:50 +0000 Subject: [PATCH] Add preference to use import/export definition for exporting from nextmatch --- timesheet/inc/class.timesheet_hooks.inc.php | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/timesheet/inc/class.timesheet_hooks.inc.php b/timesheet/inc/class.timesheet_hooks.inc.php index a2fc233e74..76c347cada 100644 --- a/timesheet/inc/class.timesheet_hooks.inc.php +++ b/timesheet/inc/class.timesheet_hooks.inc.php @@ -192,6 +192,37 @@ class timesheet_hooks 'admin' => False, ); } + // Import / Export for nextmatch + if ($GLOBALS['egw_info']['user']['apps']['importexport']) + { + $definitions = new importexport_definitions_bo(array( + 'type' => 'export', + 'application' => 'timesheet' + )); + $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; }