necessary update for distributions lists as groups in CardDAV, fixes SQL errors "unknows column list_...."

This commit is contained in:
Ralf Becker 2012-02-10 10:09:18 +00:00
parent 3ecd71cbc7
commit eef250747f
3 changed files with 53 additions and 5 deletions

View File

@ -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';

View File

@ -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(

View File

@ -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';
}