forked from extern/egroupware
Try to set some default values for export definitions
This commit is contained in:
parent
2e752e17b6
commit
83bbea7669
@ -175,14 +175,6 @@ 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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,4 +33,15 @@ while (false !== ($appdir = $egwdir->read())) {
|
||||
if ( $extension != 'xml' ) continue;
|
||||
importexport_definitions_bo::import( $file );
|
||||
}
|
||||
|
||||
// Set as default definition for the app, if there is no site default yet
|
||||
if(!$GLOBALS['egw']->preferences->default[$appdir]['nextmatch-export-definition']) {
|
||||
$bo = new importexport_definitions_bo(array('name' => "export-$appdir"));
|
||||
$definitions = $bo->get_definitions();
|
||||
if($definitions[0]) {
|
||||
$definition = $definition[0];
|
||||
$GLOBALS['egw']->preferences->add($appdir, 'nextmatch-export-definition', "export-$appdir", 'default');
|
||||
$GLOBALS['egw']->preferences->save_repository(true, 'default');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
$setup_info['importexport']['name'] = 'importexport';
|
||||
$setup_info['importexport']['version'] = '1.9.001';
|
||||
$setup_info['importexport']['version'] = '1.9.002';
|
||||
$setup_info['importexport']['app_order'] = 2;
|
||||
$setup_info['importexport']['enable'] = 2;
|
||||
$setup_info['importexport']['tables'] = array('egw_importexport_definitions');
|
||||
|
@ -55,3 +55,23 @@ function importexport_upgrade1_8()
|
||||
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.001';
|
||||
}
|
||||
|
||||
function importexport_upgrade1_9_001()
|
||||
{
|
||||
$egwdir = dir(EGW_INCLUDE_ROOT);
|
||||
while (false !== ($appdir = $egwdir->read())) {
|
||||
$defdir = EGW_INCLUDE_ROOT. "/$appdir/setup/";
|
||||
if ( !is_dir( $defdir ) ) continue;
|
||||
|
||||
// Set as default definition for the app, if there is no site default yet
|
||||
if(!$GLOBALS['egw']->preferences->default[$appdir]['nextmatch-export-definition']) {
|
||||
$bo = new importexport_definitions_bo(array('name' => "export-$appdir*"));
|
||||
$definitions = $bo->get_definitions();
|
||||
if($definitions[0]) {
|
||||
$definition = $bo->read($definitions[0]);
|
||||
$GLOBALS['egw']->preferences->add($appdir, 'nextmatch-export-definition', $definition['name'], 'default');
|
||||
}
|
||||
}
|
||||
}
|
||||
$GLOBALS['egw']->preferences->save_repository(true, 'default');
|
||||
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.002';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user