mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 23:58:54 +01:00
Allow to use account_id as unique key in csv import and added it to cvs
export.
This commit is contained in:
parent
57ce5a4c4c
commit
e642601607
@ -158,6 +158,7 @@ switch($_POST['action'])
|
|||||||
$addr_names['owner'] .= ': id or account name of user or group, defaults to importing user';
|
$addr_names['owner'] .= ': id or account name of user or group, defaults to importing user';
|
||||||
$addr_names['bday'] .= ': YYYY-mm-dd';
|
$addr_names['bday'] .= ': YYYY-mm-dd';
|
||||||
$addr_names['uid'] = lang('Unique ID (UID)');
|
$addr_names['uid'] = lang('Unique ID (UID)');
|
||||||
|
$addr_names['account_id'] = lang('Account ID');
|
||||||
unset($addr_names['jpegphoto']); // cant cvs import that
|
unset($addr_names['jpegphoto']); // cant cvs import that
|
||||||
$cfs=array();
|
$cfs=array();
|
||||||
foreach($bocontacts->customfields as $name => $data)
|
foreach($bocontacts->customfields as $name => $data)
|
||||||
@ -195,6 +196,7 @@ switch($_POST['action'])
|
|||||||
$GLOBALS['egw']->template->set_var('unique_id',html::select('unique_id',$unique_id,array(
|
$GLOBALS['egw']->template->set_var('unique_id',html::select('unique_id',$unique_id,array(
|
||||||
'id' => $addr_names['id'],
|
'id' => $addr_names['id'],
|
||||||
'uid' => $addr_names['uid'],
|
'uid' => $addr_names['uid'],
|
||||||
|
'account_id' => $addr_names['account_id'],
|
||||||
)+$cfs)."\n".html::select('unique_id2',$unique_id2,array(
|
)+$cfs)."\n".html::select('unique_id2',$unique_id2,array(
|
||||||
'*none*' => lang('No fallback'),
|
'*none*' => lang('No fallback'),
|
||||||
'id' => $addr_names['id'],
|
'id' => $addr_names['id'],
|
||||||
@ -423,6 +425,10 @@ switch($_POST['action'])
|
|||||||
{
|
{
|
||||||
$existing = $bocontacts->read($values[$unique_id]);
|
$existing = $bocontacts->read($values[$unique_id]);
|
||||||
}
|
}
|
||||||
|
elseif ($unique_id == 'account_id')
|
||||||
|
{
|
||||||
|
$existing = $bocontacts->read('account:'.$values[$unique_id]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list($existing) = $bocontacts->search(array($unique_id => $values[$unique_id]),false);
|
list($existing) = $bocontacts->search(array($unique_id => $values[$unique_id]),false);
|
||||||
@ -448,7 +454,7 @@ switch($_POST['action'])
|
|||||||
$values = array_merge($existing,$values);
|
$values = array_merge($existing,$values);
|
||||||
}
|
}
|
||||||
// convert user-names to user-id's
|
// convert user-names to user-id's
|
||||||
foreach(array('owner','modifier','creator') as $user)
|
foreach(array('owner','modifier','creator','account_id') as $user)
|
||||||
{
|
{
|
||||||
if (isset($values[$user]) && !is_numeric($values[$user]))
|
if (isset($values[$user]) && !is_numeric($values[$user]))
|
||||||
{
|
{
|
||||||
|
@ -205,6 +205,7 @@ class addressbook_bo extends addressbook_so
|
|||||||
'modified' => lang('last modified'),
|
'modified' => lang('last modified'),
|
||||||
'modifier' => lang('last modified by'),
|
'modifier' => lang('last modified by'),
|
||||||
'jpegphoto' => lang('photo'),
|
'jpegphoto' => lang('photo'),
|
||||||
|
'account_id' => lang('Account ID'),
|
||||||
);
|
);
|
||||||
$this->business_contact_fields = array(
|
$this->business_contact_fields = array(
|
||||||
'org_name' => lang('Company'),
|
'org_name' => lang('Company'),
|
||||||
|
Loading…
Reference in New Issue
Block a user