fixing calender empty resource problem (add event, edit participants)

This commit is contained in:
Klaus Leithoff 2009-07-02 11:26:52 +00:00
parent 078edd98fd
commit 234bd6dba6

View File

@ -286,7 +286,7 @@ class calendar_uiforms extends calendar_ui
if ($app != 'addressbook' || !($data = $GLOBALS['egw']->accounts->name2id($id,'person_id')))
{
$quantity = $content['participants']['quantity'] ? $content['participants']['quantity'] : 1;
if ($app == "resources" && $id) {
if ($app == "resources" && !empty($id)) {
$bores =& CreateObject('resources.bo_resources');
$selectedres = $bores->read($id);
$cats = $bores->acl->get_cats(EGW_ACL_DIRECT_BOOKING);
@ -305,9 +305,15 @@ class calendar_uiforms extends calendar_ui
break;
}
}
if ($uid && $id)
{
$status = isset($this->bo->resources[$type]['new_status']) ? ExecMethod($this->bo->resources[$type]['new_status'],$id) : 'U';
if ($uid) $event['participants'][$uid] = $event['participant_types'][$type][$id] =
$status.((int) $quantity > 1 ? (int)$quantity : '');
$event['participants'][$uid] = $event['participant_types'][$type][$id] = $status.((int) $quantity > 1 ? (int)$quantity : '');
}
else
{
unset($quantity);
}
break;
}
// fall-through for accounts entered as contact