Allow accept/decline/delegate (again) on event update request (Bifrost#T27859)
When handling an iTip request for an updated event where start or end date has been changed, user will be able to change his participant status. In such cases we display RSVP buttons instead of "Update in my calendar" button and highlight the event date. So, e.g. if you accepted the event and then its time has been changed by the organizer, you will be able to decline it or vice-versa.
This commit is contained in:
parent
b692c6f6fa
commit
3840ffc5fe
3 changed files with 31 additions and 11 deletions
|
@ -2222,6 +2222,11 @@ div.calendar-invitebox td em {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.calendar-invitebox td.date.modified {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
#event-rsvp .rsvp-buttons,
|
||||
div.calendar-invitebox .itip-buttons div {
|
||||
margin-top: 0.5em;
|
||||
|
|
|
@ -359,7 +359,7 @@ class libcalendaring_itip
|
|||
{
|
||||
$action = $event['rsvp'] ? 'rsvp' : '';
|
||||
$status = $event['fallback'];
|
||||
$latest = false;
|
||||
$latest = $resheduled = false;
|
||||
$html = '';
|
||||
|
||||
if (is_numeric($event['changed']))
|
||||
|
@ -384,6 +384,13 @@ class libcalendaring_itip
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect re-sheduling
|
||||
if (!$latest) {
|
||||
// FIXME: This is probably to simplistic, or maybe we should just check
|
||||
// attendee's RSVP flag in the new event?
|
||||
$resheduled = $existing['start'] != $event['start'] || $existing['end'] > $event['end'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rsvp = $event['rsvp'] && $this->rc->config->get('calendar_allow_itip_uninvited', true);
|
||||
|
@ -406,6 +413,9 @@ class libcalendaring_itip
|
|||
else if (!$existing && !$rsvp) {
|
||||
$action = 'import';
|
||||
}
|
||||
else if ($resheduled) {
|
||||
$action = 'rsvp';
|
||||
}
|
||||
else if ($status_lc != 'needs-action') {
|
||||
$action = !$latest ? 'update' : '';
|
||||
}
|
||||
|
@ -460,6 +470,7 @@ class libcalendaring_itip
|
|||
'latest' => $latest,
|
||||
'status' => $status,
|
||||
'action' => $action,
|
||||
'resheduled' => $resheduled,
|
||||
'html' => $html,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1291,6 +1291,10 @@ rcube_libcalendaring.update_itip_object_status = function(p)
|
|||
// show rsvp/import buttons (with calendar selector)
|
||||
$('#'+p.action+'-'+p.id).show().find('input.button').last().after(p.select);
|
||||
|
||||
// highlight date if date change detected
|
||||
if (p.resheduled)
|
||||
$('.calendar-eventdetails td.date').addClass('modified');
|
||||
|
||||
// show itip box appendix after replacing the given placeholders
|
||||
if (p.append && p.append.selector) {
|
||||
var elem = $(p.append.selector);
|
||||
|
|
Loading…
Add table
Reference in a new issue