forked from extern/egroupware
Consider AB accounts as pariticipants when do mail integration to calendar
This commit is contained in:
parent
c57bd20379
commit
d399bb72f2
@ -2582,6 +2582,9 @@ class calendar_uiforms extends calendar_ui
|
||||
|
||||
if (is_array($mailContent))
|
||||
{
|
||||
// Addressbook
|
||||
$AB = new addressbook_bo();
|
||||
$accounts = array(0 => $GLOBALS['egw_info']['user']['account_id']);
|
||||
|
||||
$participants[0] = array (
|
||||
'uid' => $GLOBALS['egw_info']['user']['account_id'],
|
||||
@ -2592,6 +2595,20 @@ class calendar_uiforms extends calendar_ui
|
||||
'role' => 'REQ-PARTICIPANT'
|
||||
);
|
||||
foreach($mailContent['addresses'] as $address)
|
||||
{
|
||||
// Get available contacts from the email
|
||||
$contact = $AB->search(array(
|
||||
'email' => $address['email'],
|
||||
'email_home' => $address['email']
|
||||
),'contact_id,contact_email,contact_email_home,egw_addressbook.account_id as account_id','','','',false,'OR',false,array('owner' => 0),'',false);
|
||||
if (is_array($contact))
|
||||
{
|
||||
foreach($contact as $account)
|
||||
{
|
||||
$accounts[] = $account['account_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$participants []= array (
|
||||
'app' => 'email',
|
||||
@ -2600,6 +2617,12 @@ class calendar_uiforms extends calendar_ui
|
||||
'old_status' => 'U'
|
||||
);
|
||||
}
|
||||
}
|
||||
$participants = array_merge($participants , array(
|
||||
"account" => $accounts,
|
||||
"role" => "REQ-PARTICIPANT",
|
||||
"add" => "pressed"
|
||||
));
|
||||
|
||||
// Prepare calendar event draft
|
||||
$event = array(
|
||||
|
Loading…
Reference in New Issue
Block a user