Fix misleading warning when editing/deleting a shared event (T1357)
and properly notify attendees of such a change.
This commit is contained in:
parent
24143cc17e
commit
dfacbe01bc
3 changed files with 31 additions and 13 deletions
|
@ -2562,7 +2562,15 @@ function rcube_calendar_ui(settings)
|
||||||
if (_has_attendees) {
|
if (_has_attendees) {
|
||||||
var checked = (settings.itip_notify & 1 ? ' checked="checked"' : '');
|
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 += '<div class="message">' +
|
||||||
|
'<label><input class="confirm-attendees-decline" type="checkbox"' + checked + ' value="1" name="decline" /> ' +
|
||||||
|
rcmail.gettext('itipdeclineevent', 'calendar') +
|
||||||
|
'</label></div>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
notify = true;
|
notify = true;
|
||||||
if (settings.itip_notify & 2) {
|
if (settings.itip_notify & 2) {
|
||||||
html += '<div class="message">' +
|
html += '<div class="message">' +
|
||||||
|
@ -2574,17 +2582,6 @@ function rcube_calendar_ui(settings)
|
||||||
data._notify = settings.itip_notify;
|
data._notify = settings.itip_notify;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action == 'remove' && is_attendee(event)) {
|
|
||||||
decline = true;
|
|
||||||
checked = event.status != 'CANCELLED' ? checked : '';
|
|
||||||
html += '<div class="message">' +
|
|
||||||
'<label><input class="confirm-attendees-decline" type="checkbox"' + checked + ' value="1" name="decline" /> ' +
|
|
||||||
rcmail.gettext('itipdeclineevent', 'calendar') +
|
|
||||||
'</label></div>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
html += '<div class="message">' + rcmail.gettext('localchangeswarning', 'calendar') + '</div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// recurring event: user needs to select the savemode
|
// recurring event: user needs to select the savemode
|
||||||
|
|
|
@ -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
|
// compose multipart message using PEAR:Mail_Mime
|
||||||
$message = new Mail_mime("\r\n");
|
$message = new Mail_mime("\r\n");
|
||||||
$message->setParam('text_encoding', 'quoted-printable');
|
$message->setParam('text_encoding', 'quoted-printable');
|
||||||
|
|
|
@ -45,6 +45,12 @@ class libvcalendar implements Iterator
|
||||||
'delegated-from' => 'DELEGATED-FROM',
|
'delegated-from' => 'DELEGATED-FROM',
|
||||||
'delegated-to' => 'DELEGATED-TO',
|
'delegated-to' => 'DELEGATED-TO',
|
||||||
'schedule-status' => 'SCHEDULE-STATUS',
|
'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 $iteratorkey = 0;
|
||||||
private $charset;
|
private $charset;
|
||||||
|
@ -1173,7 +1179,7 @@ class libvcalendar implements Iterator
|
||||||
|
|
||||||
if ($event['organizer']) {
|
if ($event['organizer']) {
|
||||||
$ve->add('ORGANIZER', 'mailto:' . $event['organizer']['email'],
|
$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) {
|
foreach ((array)$event['url'] as $url) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue