diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index fb6257dd2d..48911c75a8 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -275,6 +275,38 @@ class addressbook_hooks 'admin' => False, ); } + + // Import / Export for nextmatch + if ($GLOBALS['egw_info']['user']['apps']['importexport']) + { + $definitions = new importexport_definitions_bo(array( + 'type' => 'export', + 'application' => 'addressbook' + )); + $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; } diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index ba020c606f..22d998d645 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -210,7 +210,9 @@ class addressbook_ui extends addressbook_bo 'manual' => $do_email ? ' ' : false, // space for the manual icon ); $csv_export = new addressbook_csv($this); - $content['nm']['csv_fields'] = $csv_export->csv_fields(null,true); + $content['nm']['csv_fields'] = $GLOBALS['egw_info']['user']['preferences']['addressbook']['nextmatch-export-definition'] ? + $GLOBALS['egw_info']['user']['preferences']['addressbook']['nextmatch-export-definition'] : + $csv_export->csv_fields(null,true); if ($do_email) {