mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
advanced emailing allows to send on behalf of
This commit is contained in:
parent
7eff94a52d
commit
6a57ebb641
@ -61,12 +61,42 @@ class calendar__
|
|||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
|
$phpgw_info['user']['preferences'] = $phpgw->common->create_emailpreferences($phpgw_info['user']['preferences']);
|
||||||
|
$sender = $phpgw_info['user']['preferences']['email']['address'];
|
||||||
|
|
||||||
$temp_tz_offset = $phpgw_info['user']['preferences']['common']['tz_offset'];
|
$temp_tz_offset = $phpgw_info['user']['preferences']['common']['tz_offset'];
|
||||||
$temp_timeformat = $phpgw_info['user']['preferences']['common']['timeformat'];
|
$temp_timeformat = $phpgw_info['user']['preferences']['common']['timeformat'];
|
||||||
$temp_dateformat = $phpgw_info['user']['preferences']['common']['dateformat'];
|
$temp_dateformat = $phpgw_info['user']['preferences']['common']['dateformat'];
|
||||||
|
|
||||||
$tz_offset = ((60 * 60) * intval($temp_tz_offset));
|
$tz_offset = ((60 * 60) * intval($temp_tz_offset));
|
||||||
|
|
||||||
|
$temp_user = $phpgw_info['user'];
|
||||||
|
|
||||||
|
if((is_int($this->user) && $this->user != $temp_user['account_id']) ||
|
||||||
|
(is_string($this->user) && $this->user != $temp_user['account_lid']))
|
||||||
|
{
|
||||||
|
if(is_string($this->user))
|
||||||
|
{
|
||||||
|
$user = $phpgw->accounts->name2id($this->user);
|
||||||
|
}
|
||||||
|
elseif(is_int($this->user))
|
||||||
|
{
|
||||||
|
$user = $this->user;
|
||||||
|
}
|
||||||
|
|
||||||
|
$accounts = CreateObject('phpgwapi.accounts',$user);
|
||||||
|
$phpgw_info['user'] = $accounts->read_repository();
|
||||||
|
|
||||||
|
$pref = CreateObject('phpgwapi.preferences',$user);
|
||||||
|
$phpgw_info['user']['preferences'] = $pref->read_repository();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$user = $phpgw_info['user']['account_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpgw_info['user']['preferences'] = $phpgw->common->create_emailpreferences($phpgw_info['user']['preferences'],$user);
|
||||||
|
|
||||||
$send = CreateObject('phpgwapi.send');
|
$send = CreateObject('phpgwapi.send');
|
||||||
|
|
||||||
switch($msg_type)
|
switch($msg_type)
|
||||||
@ -141,11 +171,17 @@ class calendar__
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$subject = 'Calendar Event ('.$action.') #'.$event_id.': '.$action_date.' (L)';
|
$subject = 'Calendar Event ('.$action.') #'.$event_id.': '.$action_date.' (L)';
|
||||||
$send->msg('email',$to,$subject,$body,$msgtype);
|
$send->msg('email',$to,$subject,$body,$msgtype,'','','',$sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($send);
|
unset($send);
|
||||||
|
|
||||||
|
if((is_int($this->user) && $this->user != $temp_user['account_id']) ||
|
||||||
|
(is_string($this->user) && $this->user != $temp_user['account_lid']))
|
||||||
|
{
|
||||||
|
$phpgw_info['user'] = $temp_user;
|
||||||
|
}
|
||||||
|
|
||||||
$phpgw_info['user']['preferences']['common']['tz_offset'] = $temp_tz_offset;
|
$phpgw_info['user']['preferences']['common']['tz_offset'] = $temp_tz_offset;
|
||||||
$phpgw_info['user']['preferences']['common']['timeformat'] = $temp_timeformat;
|
$phpgw_info['user']['preferences']['common']['timeformat'] = $temp_timeformat;
|
||||||
$phpgw_info['user']['preferences']['common']['dateformat'] = $temp_dateformat;
|
$phpgw_info['user']['preferences']['common']['dateformat'] = $temp_dateformat;
|
||||||
|
Loading…
Reference in New Issue
Block a user