From 4e86a27a983dc74ebc7357fd87e5778229e769aa Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 2 Oct 2006 07:53:26 +0000 Subject: [PATCH] fixing older contacts with no cats: they use '' or '0' in the cat_id column, new ones use allways NULL --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 0efc40c6c9..3c613a86b6 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -14,7 +14,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'eGroupWare API'; - $setup_info['phpgwapi']['version'] = '1.3.012'; + $setup_info['phpgwapi']['version'] = '1.3.013'; $setup_info['phpgwapi']['versions']['current_header'] = '1.28'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index ced3640faf..136f643e7a 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -650,4 +650,13 @@ return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.3.012'; } -?> + + + $test[] = '1.3.012'; + function phpgwapi_upgrade1_3_012() + { + // setting old contacts without cat to cat_id=NULL, they cat be '0' or '' + $GLOBALS['egw_setup']->db->query("UPDATE egw_addressbook SET cat_id=NULL WHERE cat_id IN ('','0')",__LINE__,__FILE__); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.3.013'; + }