From 3ef567330b0808ad3e5818871bb2736d70384ba9 Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Sun, 27 Sep 2015 19:45:59 -0400 Subject: [PATCH] Request: 14118 Send CANCEL iTip when attendee is removed from meeting. --- kronolith/lib/Ajax/Application/Handler.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kronolith/lib/Ajax/Application/Handler.php b/kronolith/lib/Ajax/Application/Handler.php index 2741e7ada23..16a81b7ef07 100644 --- a/kronolith/lib/Ajax/Application/Handler.php +++ b/kronolith/lib/Ajax/Application/Handler.php @@ -309,7 +309,9 @@ public function saveEvent() } } else { try { + $old_attendees = $event->attendees; $event->readForm(); + $removed_attendees = array_diff(array_keys($old_attendees), array_keys($event->attendees)); $result = $this->_saveEvent($event); } catch (Exception $e) { $GLOBALS['notification']->push($e); @@ -321,6 +323,13 @@ public function saveEvent() $type = $event->status == Kronolith::STATUS_CANCELLED ? Kronolith::ITIP_CANCEL : Kronolith::ITIP_REQUEST; Kronolith::sendITipNotifications($event, $GLOBALS['notification'], $type); } + if (!empty($removed_attendees)) { + foreach ($removed_attendees as $email) { + $to_cancel[$email] = $old_attendees[$email]; + } + $event->attendees = $to_cancel; + Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_CANCEL); + } Kronolith::notifyOfResourceRejection($event); return $result;