Allow to update a cancelled event (from iTip) in the personal calendar

This commit is contained in:
Thomas Bruederli 2014-04-10 08:58:35 +02:00
parent 2123ea7d97
commit c4fb6b73b7
4 changed files with 11 additions and 6 deletions

View file

@ -2396,8 +2396,14 @@ class calendar extends rcube_plugin
else if ($event['sequence'] >= $existing['sequence'] || $event['changed'] >= $existing['changed']) {
$event['id'] = $existing['id'];
$event['calendar'] = $existing['calendar'];
if ($status == 'declined' || $event['status'] == 'CANCELLED') // show me as free when declined (#1670)
// set status=CANCELLED on CANCEL messages
if ($this->ical->method == 'CANCEL')
$event['status'] = 'CANCELLED';
// show me as free when declined (#1670)
if ($status == 'declined' || $event['status'] == 'CANCELLED')
$event['free_busy'] = 'free';
$success = $this->driver->edit_event($event);
}
else if (!empty($status)) {
@ -2422,7 +2428,7 @@ class calendar extends rcube_plugin
}
if ($success) {
$message = $this->ical->method == 'REPLY' ? 'attendeupdateesuccess' : ($deleted ? 'successremoval' : 'importedsuccessfully');
$message = $this->ical->method == 'REPLY' ? 'attendeupdateesuccess' : ($deleted ? 'successremoval' : ($existing ? 'updatedsuccessfully' : 'importedsuccessfully'));
$this->rc->output->command('display_message', $this->gettext(array('name' => $message, 'vars' => array('calendar' => $calendar['name']))), 'confirmation');
$metadata['rsvp'] = intval($metadata['rsvp']);

View file

@ -407,7 +407,7 @@ function rcube_calendar_ui(settings)
}
}
$('#event-rsvp')[(rsvp && !is_organizer(event) ? 'show' : 'hide')]();
$('#event-rsvp')[(rsvp && !is_organizer(event) && event.status != 'CANCELLED' ? 'show' : 'hide')]();
$('#event-rsvp .rsvp-buttons input').prop('disabled', false).filter('input[rel='+rsvp+']').prop('disabled', true);
}

View file

@ -199,6 +199,7 @@ $labels['importwarningexists'] = 'A copy of this event already exists in your ca
$labels['newerversionexists'] = 'A newer version of this event already exists! Aborted.';
$labels['nowritecalendarfound'] = 'No calendar found to save the event';
$labels['importedsuccessfully'] = 'The event was successfully added to \'$calendar\'';
$labels['updatedsuccessfully'] = 'The event was successfully updated in \'$calendar\'';
$labels['attendeupdateesuccess'] = 'Successfully updated the participant\'s status';
$labels['itipsendsuccess'] = 'Invitation sent to participants.';
$labels['itipresponseerror'] = 'Failed to send the response to this event invitation';

View file

@ -451,14 +451,12 @@ class libcalendaring_itip
));
// 2. update our copy with status=cancelled
/* TODO: implement CANCELLED status in calendar UI first
$button_update = html::tag('input', array(
'type' => 'button',
'class' => 'button',
'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "')",
'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')",
'value' => $this->gettext('updatemycopy'),
));
*/
$buttons[] = html::div(array('id' => 'rsvp-'.$dom_id, 'style' => 'display:none'), $button_remove . $button_update);