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))
|
if (is_array($mailContent))
|
||||||
{
|
{
|
||||||
|
// Addressbook
|
||||||
|
$AB = new addressbook_bo();
|
||||||
|
$accounts = array(0 => $GLOBALS['egw_info']['user']['account_id']);
|
||||||
|
|
||||||
$participants[0] = array (
|
$participants[0] = array (
|
||||||
'uid' => $GLOBALS['egw_info']['user']['account_id'],
|
'uid' => $GLOBALS['egw_info']['user']['account_id'],
|
||||||
@ -2593,13 +2596,33 @@ class calendar_uiforms extends calendar_ui
|
|||||||
);
|
);
|
||||||
foreach($mailContent['addresses'] as $address)
|
foreach($mailContent['addresses'] as $address)
|
||||||
{
|
{
|
||||||
$participants []= array (
|
// Get available contacts from the email
|
||||||
'app' => 'email',
|
$contact = $AB->search(array(
|
||||||
'uid' => 'e'.$address['email'],
|
'email' => $address['email'],
|
||||||
'status' => 'U',
|
'email_home' => $address['email']
|
||||||
'old_status' => 'U'
|
),'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',
|
||||||
|
'uid' => 'e'.$address['email'],
|
||||||
|
'status' => 'U',
|
||||||
|
'old_status' => 'U'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$participants = array_merge($participants , array(
|
||||||
|
"account" => $accounts,
|
||||||
|
"role" => "REQ-PARTICIPANT",
|
||||||
|
"add" => "pressed"
|
||||||
|
));
|
||||||
|
|
||||||
// Prepare calendar event draft
|
// Prepare calendar event draft
|
||||||
$event = array(
|
$event = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user