account for imported events that end up having no participants.

This commit is contained in:
mgalgoci 2004-08-19 15:38:01 +00:00
parent b9601ff903
commit d51ed17fab
2 changed files with 21 additions and 12 deletions

View File

@ -1524,6 +1524,8 @@
{
// Check if the $user is one of the participants or has a read-grant from one of them
//
if (isset($event['participants']) && is_array($event['participants']))
{
foreach($event['participants'] as $uid => $accept)
{
if ($this->grants[$uid] & PHPGW_ACL_READ || $uid == $user)
@ -1533,6 +1535,7 @@
}
}
}
}
if ($GLOBALS['phpgw']->accounts->get_type($owner) == 'g' && $needed == PHPGW_ACL_ADD)
{
@ -3137,6 +3140,8 @@
);
}
if (isset($event['participants']) && is_array($event['participants']))
{
$participants = array();
foreach($event['participants'] as $user => $short_status)
{
@ -3145,6 +3150,7 @@
$participants[$user] = $GLOBALS['phpgw']->common->grab_owner_name($user).' ('.$this->get_long_status($short_status).')';
}
}
}
$var['participants'] = Array(
'field' => lang('Participants'),
'data' => $participants

View File

@ -3487,6 +3487,8 @@ return;
$vars['title']['tr_color'] = $this->theme['th_bg'];
if (isset($vars['participants']['data']) && is_array($vars['participants']['data']))
{
foreach($vars['participants']['data'] as $user => $str)
{
if ($this->bo->check_perms(PHPGW_ACL_EDIT,0,$user) && ereg('^(.*) \((.*)\)$',$str,$parts))
@ -3495,6 +3497,7 @@ return;
}
}
$vars['participants']['data'] = implode("<br>\n",$vars['participants']['data']);
}
foreach($vars as $var)
{