* Calendar/CalDAV: rejected meeting-requests were not returned when searching for free time

This commit is contained in:
Ralf Becker 2015-07-16 12:09:19 +00:00
parent 6bb7c50642
commit ca8a6328d5
2 changed files with 18 additions and 1 deletions

View File

@ -3222,6 +3222,7 @@ class calendar_ical extends calendar_boupdate
{
if ($event['non_blocking']) continue;
if ($event['uid'] === $extra['X-CALENDARSERVER-MASK-UID']) continue;
if ($event['participants'][$user] == 'R') continue;
$fbtype = $event['participants'][$user] == 'T' ? 'BUSY-TENTATIVE' : 'BUSY';

View File

@ -2145,7 +2145,7 @@ class calendar_uiforms extends calendar_ui
*/
function freetime($participants,$start,$end,$duration=1,$cal_id=0)
{
if ($this->debug > 2) $this->bo->debug_message('uiforms::freetime(participants=%1, start=%2, end=%3, duration=%4, cal_id=%5)',true,$participants,$start,$end,$duration,$cal_id);
if ($this->debug > 2) $this->bo->debug_message(__METHOD__.'(participants=%1, start=%2, end=%3, duration=%4, cal_id=%5)',true,$participants,$start,$end,$duration,$cal_id);
$busy = $this->bo->search(array(
'start' => $start,
@ -2166,6 +2166,22 @@ class calendar_uiforms extends calendar_ui
if ($event['non_blocking']) continue; // ignore non_blocking events
// check if from all wanted participants at least one has a not rejected status in found event
$non_rejected_found = false;
foreach($participants as $uid)
{
if ($event['participants'][$uid] == 'R') continue;
if (isset($event['participants'][$uid]) ||
$uid > 0 && array_intersect(array_keys((array)$event['participants']),
$GLOBALS['egw']->accounts->memberships($uid, true)))
{
$non_rejected_found = true;
break;
}
}
if (!$non_rejected_found) continue;
if ($this->debug)
{
echo "<p>ft_start=".date('D d.m.Y H:i',$ft_start)."<br>\n";