From da16cd319c0a7336c1707877b56e18d45a8a1489 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 14 Mar 2011 23:07:46 +0000 Subject: [PATCH] Set default export- definitions as the site-wide default if no default is set --- .../inc/class.importexport_definitions_bo.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/importexport/inc/class.importexport_definitions_bo.inc.php b/importexport/inc/class.importexport_definitions_bo.inc.php index eed39ca10d..b1d65a6cee 100644 --- a/importexport/inc/class.importexport_definitions_bo.inc.php +++ b/importexport/inc/class.importexport_definitions_bo.inc.php @@ -175,6 +175,14 @@ class importexport_definitions_bo { $definition->set_record( $definition_data ); $definition->save( $definition_id ); } + + // Set as default definition for the app, if there is no site default yet + if($definition->type == 'export' && $definition->name == 'export-'.$definition->application && + !$GLOBALS['egw']->preferences->default[$definition->application]['nextmatch-export-definition']) + { + $GLOBALS['egw']->preferences->add($definition->application, 'nextmatch-export-definition', $definition->name, 'default'); + $GLOBALS['egw']->preferences->save_repository(true, 'default'); + } } }