diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js index b99d4e49..a99ec4f1 100644 --- a/plugins/calendar/calendar_ui.js +++ b/plugins/calendar/calendar_ui.js @@ -2562,7 +2562,15 @@ function rcube_calendar_ui(settings) if (_has_attendees) { var checked = (settings.itip_notify & 1 ? ' checked="checked"' : ''); - if (_is_organizer) { + if (action == 'remove' && cal.group == 'personal' && is_attendee(event)) { + decline = true; + checked = event.status != 'CANCELLED' ? checked : ''; + html += '
' + + '
'; + } + else { notify = true; if (settings.itip_notify & 2) { html += '
' + @@ -2574,17 +2582,6 @@ function rcube_calendar_ui(settings) data._notify = settings.itip_notify; } } - else if (action == 'remove' && is_attendee(event)) { - decline = true; - checked = event.status != 'CANCELLED' ? checked : ''; - html += '
' + - '
'; - } - else { - html += '
' + rcmail.gettext('localchangeswarning', 'calendar') + '
'; - } } // recurring event: user needs to select the savemode diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php index c7986175..41a5c825 100644 --- a/plugins/libcalendaring/lib/libcalendaring_itip.php +++ b/plugins/libcalendaring/lib/libcalendaring_itip.php @@ -261,6 +261,21 @@ class libcalendaring_itip } } + // Set SENT-BY property if the sender is not the organizer + if ($method == 'CANCEL' || $method == 'REQUEST') { + foreach ((array)$event['attendees'] as $idx => $attendee) { + if ($attendee['role'] == 'ORGANIZER' + && $attendee['email'] + && strcasecmp($attendee['email'], $from) != 0 + && strcasecmp($attendee['email'], $from_utf) != 0 + ) { + $attendee['sent-by'] = 'mailto:' . $from_utf; + $event['organizer'] = $event['attendees'][$idx] = $attendee; + break; + } + } + } + // compose multipart message using PEAR:Mail_Mime $message = new Mail_mime("\r\n"); $message->setParam('text_encoding', 'quoted-printable'); diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php index b47cf81e..78a9e2c1 100644 --- a/plugins/libcalendaring/libvcalendar.php +++ b/plugins/libcalendaring/libvcalendar.php @@ -45,6 +45,12 @@ class libvcalendar implements Iterator 'delegated-from' => 'DELEGATED-FROM', 'delegated-to' => 'DELEGATED-TO', 'schedule-status' => 'SCHEDULE-STATUS', + 'sent-by' => 'SENT-BY', + ); + private $organizer_keymap = array( + 'name' => 'CN', + 'schedule-status' => 'SCHEDULE-STATUS', + 'sent-by' => 'SENT-BY', ); private $iteratorkey = 0; private $charset; @@ -1173,7 +1179,7 @@ class libvcalendar implements Iterator if ($event['organizer']) { $ve->add('ORGANIZER', 'mailto:' . $event['organizer']['email'], - array_filter(self::map_keys($event['organizer'], array('name' => 'CN', 'schedule-status' => 'SCHEDULE-STATUS')))); + array_filter(self::map_keys($event['organizer'], $this->organizer_keymap))); } foreach ((array)$event['url'] as $url) {