From d5c65bb384f9eabb189cc56726fbd2755d88c83d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 7 May 2016 07:49:38 +0000 Subject: [PATCH] fix home-accounts in egw_customfields and egw_links to api-accounts --- api/setup/setup.inc.php | 2 +- api/setup/tables_update.inc.php | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index c10bb91cd8..c6cfcc6f37 100755 --- a/api/setup/setup.inc.php +++ b/api/setup/setup.inc.php @@ -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; diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index 49d998d5cf..6a5f2e7d43 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -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'; +}