fix home-accounts in egw_customfields and egw_links to api-accounts

This commit is contained in:
Ralf Becker 2016-05-07 07:49:38 +00:00
parent af9d5a6a66
commit d5c65bb384
2 changed files with 26 additions and 2 deletions

View File

@ -12,7 +12,7 @@
/* Basic information about this app */
$setup_info['api']['name'] = 'api';
$setup_info['api']['title'] = 'EGroupware API';
$setup_info['api']['version'] = '16.1.001';
$setup_info['api']['version'] = '16.1.002';
$setup_info['api']['versions']['current_header'] = '1.29';
$setup_info['api']['enable'] = 3;
$setup_info['api']['app_order'] = 1;

View File

@ -51,9 +51,14 @@ function api_upgrade14_3_907()
return $GLOBALS['setup_info']['api']['currentver'] = '16.1';
}
/**
* Add archive folder to mail accounts
*
* @return string
*/
function api_upgrade16_1()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_folder_archive', array(
$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_folder_archive', array(
'type' => 'varchar',
'precision' => '128',
'comment' => 'archive folder'
@ -61,3 +66,22 @@ function api_upgrade16_1()
return $GLOBALS['setup_info']['api']['currentver'] = '16.1.001';
}
/**
* Fix home-accounts in egw_customfields and egw_links to api-accounts
*
* @return string
*/
function api_upgrade16_1_001()
{
$db = new EGroupware\Api\Db;
foreach(array(
'cf_type' => 'egw_customfields',
'link_app1' => 'egw_links',
'link_app2' => 'egw_links',
) as $col => $table)
{
$db->query("UPDATE $table SET $col='api-accounts' WHERE $col='home-accounts'", __LINE__, __FILE__);
}
return $GLOBALS['setup_info']['api']['currentver'] = '16.1.002';
}