diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 7c3d15ee55..eae402e0e9 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -12,7 +12,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'EGroupware API'; -$setup_info['phpgwapi']['version'] = '1.9.013'; +$setup_info['phpgwapi']['version'] = '1.9.014'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; @@ -74,5 +74,3 @@ $setup_info['groupdav']['author'] = $setup_info['groupdav']['maintainer'] = arra $setup_info['groupdav']['license'] = 'GPL'; $setup_info['groupdav']['hooks']['preferences'] = 'groupdav_hooks::menus'; $setup_info['groupdav']['hooks']['settings'] = 'groupdav_hooks::settings'; - - diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index 96d5dcf24f..5d1c87a860 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -366,12 +366,17 @@ $phpgw_baseline = array( 'list_name' => array('type' => 'varchar','precision' => '80','nullable' => False), 'list_owner' => array('type' => 'int','precision' => '4','nullable' => False), 'list_created' => array('type' => 'int','precision' => '8'), - 'list_creator' => array('type' => 'int','precision' => '4') + 'list_creator' => array('type' => 'int','precision' => '4'), + 'list_uid' => array('type' => 'varchar','precision' => '255'), + 'list_carddav_name' => array('type' => 'varchar','precision' => '64'), + 'list_etag' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'list_modified' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), + 'list_modifier' => array('type' => 'int','precision' => '4') ), 'pk' => array('list_id'), 'fk' => array(), 'ix' => array(), - 'uc' => array(array('list_owner','list_name')) + 'uc' => array('list_uid','list_carddav_name',array('list_owner','list_name')) ), 'egw_addressbook2list' => array( 'fd' => array( diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 1ca0c51f59..0e3d6a051b 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -336,3 +336,48 @@ function phpgwapi_upgrade1_9_012() return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.013'; } + +/** + * Adding neccessary information to return list to (Apple) CardDAV clients as "Group" + */ +function phpgwapi_upgrade1_9_013() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_lists','list_uid',array( + 'type' => 'varchar', + 'precision' => '255' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_lists','list_carddav_name',array( + 'type' => 'varchar', + 'precision' => '64' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_lists','list_etag',array( + 'type' => 'int', + 'precision' => '4', + 'nullable' => False, + 'default' => '0' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_lists','list_modified',array( + 'type' => 'timestamp', + 'nullable' => False, + 'default' => 'current_timestamp' + )); + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook_lists','list_modified'); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_lists','list_modifier',array( + 'type' => 'int', + 'precision' => '4' + )); + $install_id = $GLOBALS['egw_setup']->db->select('egw_config','config_value',array( + 'config_app' => 'phpgwapi', + 'config_name' => 'install_id', + ),__LINE__,__FILE__)->fetchColumn(); + // setting values for existing lists + $GLOBALS['egw_setup']->db->query('UPDATE egw_addressbook_lists SET '. + 'list_uid='.$GLOBALS['egw_setup']->db->concat("'addressbook-lists-'",'list_id',"'-$install_id'"). + ',list_carddav_name='.$GLOBALS['egw_setup']->db->concat("'addressbook-lists-'",'list_id',"'-$install_id.vcf'"), + __LINE__,__FILE__); + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook_lists','list_uid',true); + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook_lists','list_carddav_name',true); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.014'; +} +