WIP contact sharing

This commit is contained in:
Ralf Becker 2020-10-13 16:56:06 +02:00
parent 1f7ce98c50
commit b55da481e3
3 changed files with 42 additions and 1 deletions

View File

@ -11,7 +11,7 @@
/* Basic information about this app */
$setup_info['api']['name'] = 'api';
$setup_info['api']['title'] = 'EGroupware API';
$setup_info['api']['version'] = '20.1';
$setup_info['api']['version'] = '20.1.001';
$setup_info['api']['versions']['current_header'] = '1.29';
// maintenance release in sync with changelog in doc/rpm-build/debian.changes
$setup_info['api']['versions']['maintenance_release'] = '20.1.20201005';
@ -52,6 +52,7 @@ $setup_info['api']['tables'][] = 'egw_ea_credentials';
$setup_info['api']['tables'][] = 'egw_ea_identities';
$setup_info['api']['tables'][] = 'egw_ea_valid';
$setup_info['api']['tables'][] = 'egw_ea_notifications';
$setup_info['api']['tables'][] = 'egw_addressbook_shared';
// hooks used by vfs_home_hooks to manage user- and group-directories for the new stream based VFS
$setup_info['api']['hooks']['addaccount'] = array('EGroupware\\Api\\Vfs\\Hooks::addAccount', 'EGroupware\\Api\\Mail\\Hooks::addaccount');
@ -139,3 +140,4 @@ $setup_info['groupdav']['author'] = $setup_info['groupdav']['maintainer'] = arra
$setup_info['groupdav']['license'] = 'GPL';
$setup_info['groupdav']['hooks']['preferences'] = 'EGroupware\\Api\\CalDAV\\Hooks::menus';
$setup_info['groupdav']['hooks']['settings'] = 'EGroupware\\Api\\CalDAV\\Hooks::settings';

View File

@ -510,5 +510,19 @@ $phpgw_baseline = array(
'fk' => array(),
'ix' => array(array('account_id','acc_id')),
'uc' => array()
),
'egw_addressbook_shared' => array(
'fd' => array(
'shared_id' => array('type' => 'auto','nullable' => False),
'contact_id' => array('type' => 'int','precision' => '4','nullable' => False),
'shared_with' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),
'shared_by' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False),
'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0')
),
'pk' => array('shared_id'),
'fk' => array(),
'ix' => array('contact_id','shared_with'),
'uc' => array()
)
);

View File

@ -728,3 +728,28 @@ function api_upgrade19_1_004()
{
return $GLOBALS['setup_info']['api']['currentver'] = '20.1';
}
/**
* Table for per-contact sharing
*
* @return string
*/
function api_upgrade20_1()
{
$GLOBALS['egw_setup']->oProc->CreateTable('egw_addressbook_shared',array(
'fd' => array(
'shared_id' => array('type' => 'auto','nullable' => False),
'contact_id' => array('type' => 'int','precision' => '4','nullable' => False),
'shared_with' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),
'shared_by' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False),
'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0')
),
'pk' => array('shared_id'),
'fk' => array(),
'ix' => array('contact_id','shared_with'),
'uc' => array()
));
return $GLOBALS['setup_info']['api']['currentver'] = '20.1.001';
}