From 8dba9967e34b24ddbfcd4f23ba8b9685f60e87c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 18 Aug 2017 09:49:02 +0200 Subject: [PATCH] * Calendar/CalDAV: do not report non-participants as busy or conflict --- calendar/inc/class.calendar_boupdate.inc.php | 17 +++++++++-------- calendar/inc/class.calendar_ical.inc.php | 7 +++++-- calendar/inc/class.calendar_uiforms.inc.php | 5 ++++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index b7ed7d2fa2..d2668c8770 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -99,7 +99,7 @@ class calendar_boupdate extends calendar_bo * @param boolean $ignore_conflicts =false just ignore conflicts or do a conflict check and return the conflicting events * @param boolean $touch_modified =true NOT USED ANYMORE (was only used in old csv-import), modified&modifier is always updated! * @param boolean $ignore_acl =false should we ignore the acl - * @param boolean $updateTS =true update the content history of the event + * @param boolean $updateTS =true update the content history of the event (ignored, as updating timestamps is required for sync!) * @param array &$messages=null messages about because of missing ACL removed participants or categories * @param boolean $skip_notification =false true: send NO notifications, default false = send them * @return mixed on success: int $cal_id > 0, on error false or array with conflicting events (only if $check_conflicts) @@ -118,6 +118,7 @@ class calendar_boupdate extends calendar_bo */ function update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false,$updateTS=true,&$messages=null, $skip_notification=false) { + unset($updateTS); // ignored, as updating timestamps is required for sync! //error_log(__METHOD__."(".array2string($event).",$ignore_conflicts,$touch_modified,$ignore_acl)"); if (!is_array($messages)) $messages = $messages ? (array)$messages : array(); @@ -310,9 +311,9 @@ class calendar_boupdate extends calendar_bo $quantity = $users = array(); foreach($event['participants'] as $uid => $status) { - $q = $r = null; - calendar_so::split_status($status,$q,$r); - if ($status[0] == 'R') continue; // ignore rejected participants + $q = $role = null; + calendar_so::split_status($status, $q, $role); + if ($status == 'R' || $role == 'NON-PARTICIPANT') continue; // ignore rejected or non-participants if ($uid < 0) // group, check it's members too { @@ -396,8 +397,8 @@ class calendar_boupdate extends calendar_bo foreach($common_parts as $n => $uid) { $status = $overlap['participants'][$uid]; - calendar_so::split_status($status, $q, $r); - if ($status == 'R') + calendar_so::split_status($status, $q, $role); + if ($status == 'R' || $role == 'NON-PARTICIPANT') { unset($common_parts[$n]); continue; @@ -1070,7 +1071,7 @@ class calendar_boupdate extends calendar_bo ) )); } - $notification->set_popupmessage($response."\n\n".$notify_body."\n\n".$details['description']."\n\n".$details_body."\n\n"); + $notification->set_popupmessage($subject."\n\n".$notify_body."\n\n".$details['description']."\n\n".$details_body."\n\n"); $notification->set_popuplinks(array($details['link_arr']+array('app'=>'calendar'))); if(is_array($attachment)) { $notification->set_attachments(array($attachment)); } @@ -1265,7 +1266,7 @@ class calendar_boupdate extends calendar_bo //$time->setServer(); $time->setTime(23, 59, 59); - + $event['recur_enddate'] = $save_event['recur_enddate'] = $time; } $timestamps = array('modified','created'); diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 564b64eac3..1af5c9b723 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -3367,9 +3367,12 @@ 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; + $status = $event['participants'][$user]; + $quantity = $role = null; + calendar_so::split_status($status, $quantity, $role); + if ($status == 'R' || $role == 'NON-PARTICIPANT') continue; - $fbtype = $event['participants'][$user] == 'T' ? 'BUSY-TENTATIVE' : 'BUSY'; + $fbtype = $status == 'T' ? 'BUSY-TENTATIVE' : 'BUSY'; if ($utc) { diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 016364c74c..ec0abf92d1 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -2369,7 +2369,10 @@ class calendar_uiforms extends calendar_ui $non_rejected_found = false; foreach($participants as $uid) { - if ($event['participants'][$uid] == 'R') continue; + $status = $event['participants'][$uid]; + $quantity = $role = null; + calendar_so::split_status($status, $quantity, $role); + if ($status == 'R' || $role == 'NON-PARTICIPANT') continue; if (isset($event['participants'][$uid]) || $uid > 0 && array_intersect(array_keys((array)$event['participants']),