2 commits - plugins/calendar plugins/libcalendaring

Thomas Brüderli bruederli at kolabsys.com
Mon Mar 24 16:56:25 CET 2014


 plugins/calendar/calendar.php                 |   22 ++++++++++++++++++----
 plugins/libcalendaring/localization/en_US.inc |    2 +-
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 1c56c2c44c9a360d52206b1227e7d76d71d4a22d
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Mon Mar 24 16:55:49 2014 +0100

    Send CANCEL iTip notifications for removed (uninvited) attendees

diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 3221144..9b33136 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1673,8 +1673,10 @@ class calendar extends rcube_plugin
     }
 
     // send to every attendee
-    $sent = 0;
+    $sent = 0; $current = array();
     foreach ((array)$event['attendees'] as $attendee) {
+      $current[] = $attendee['email'];
+      
       // skip myself for obvious reasons
       if (!$attendee['email'] || in_array(strtolower($attendee['email']), $emails))
         continue;
@@ -1690,9 +1692,21 @@ class calendar extends rcube_plugin
       else
         $sent = -100;
     }
-    
-    // TODO: send CANCEL message to remove attendees
-    
+
+    // send CANCEL message to removed attendees
+    foreach ((array)$old['attendees'] as $attendee) {
+      if ($attendee['ROLE'] == 'ORGANIZER' || !$attendee['email'] || in_array(strtolower($attendee['email']), $current))
+        continue;
+
+      $vevent = $old;
+      $vevent['cancelled'] = $is_cancelled;
+      $vevent['attendees'] = array($attendee);
+      if ($itip->send_itip_message($vevent, 'CANCEL', $attendee, 'eventcancelsubject', 'eventcancelmailbody'))
+        $sent++;
+      else
+        $sent = -100;
+    }
+
     return $sent;
   }
 


commit e4a26975153b61c8bffaed547afafa1224138876
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Mon Mar 24 16:54:02 2014 +0100

    Fix typo

diff --git a/plugins/libcalendaring/localization/en_US.inc b/plugins/libcalendaring/localization/en_US.inc
index 4565cc1..5eecd29 100644
--- a/plugins/libcalendaring/localization/en_US.inc
+++ b/plugins/libcalendaring/localization/en_US.inc
@@ -38,7 +38,7 @@ $labels['itiptentative'] = 'Maybe';
 $labels['itipdeclined'] = 'Decline';
 $labels['itipcomment'] = 'Your response';
 $labels['itipeditresponse'] = 'Enter a response text';
-$labeöls['itipsendercomment'] = 'Sender\'s comment: ';
+$labels['itipsendercomment'] = 'Sender\'s comment: ';
 
 $labels['itipobjectnotfound'] = 'The object referred by this message was not found in your account.';
 $labels['itipsubjectaccepted'] = '"$title" has been accepted by $name';




More information about the commits mailing list