- Add $$user/primary_group$$ common placeholder

- Add calendar_owner/<contact> sub-placeholders, including primary_group
This commit is contained in:
Nathan Gray 2014-07-08 19:05:09 +00:00
parent d10dd0b6ed
commit 210ebb5706
2 changed files with 8 additions and 0 deletions

View File

@ -204,6 +204,13 @@ class calendar_merge extends bo_merge
$duration = ($event['end'] - $event['start'])/60;
$replacements['$$'.($prefix?$prefix.'/':'').'calendar_duration$$'] = floor($duration/60).lang('h').($duration%60 ? $duration%60 : '');
// Add in contact stuff for owner
if (strpos($content,'$$calendar_owner/') !== null && ($user = $GLOBALS['egw']->accounts->id2name($event['owner'],'person_id')))
{
$replacements += $this->contact_replacements($user,($prefix ? $prefix.'/':'').'calendar_owner');
$replacements['$$'.($prefix?$prefix.'/':'').'calendar_owner/primary_group$$'] = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw']->accounts->id2name($event['owner'],'account_primary_group'));
}
if($content && strpos($content, '$$#') !== 0)
{
$this->cf_link_to_expand($event, $content, $replacements);

View File

@ -765,6 +765,7 @@ abstract class bo_merge
if (strpos($content,'$$user/') !== null && ($user = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id')))
{
$replacements += $this->contact_replacements($user,'user');
$replacements['$$user/primary_group$$'] = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'account_primary_group'));
}
$replacements['$$date$$'] = egw_time::to('now',true);
$replacements['$$datetime$$'] = egw_time::to('now');