Skip to content

Commit

Permalink
Honor the RECURRENCE-ID RANGE when deleting an event.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 21, 2013
1 parent 00561eb commit c0444f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions imp/lib/Ajax/Imple/ItipRequest.php
Expand Up @@ -89,14 +89,20 @@ protected function _handle(Horde_Variables $vars)
if ($registry->hasMethod('calendar/delete')) {
$guid = $components[$key]->getAttribute('UID');
$recurrenceId = null;

try {
// This is a cancellation of a recurring event instance.
$recurrenceId = $components[$key]->getAttribute('RECURRENCE-ID');
$atts = $components[$key]->getAttribute('RECURRENCE-ID', true);
$range = null;
foreach ($atts as $att) {
if (array_key_exists('RANGE', $att)) {
$range = $att['RANGE'];
}
}
} catch (Horde_Icalendar_Exception $e) {}

try {
$registry->call('calendar/delete', array($guid, $recurrenceId));
$registry->call('calendar/delete', array($guid, $recurrenceId, $range));
$notification->push(_("Event successfully deleted."), 'horde.success');
$result = true;
} catch (Horde_Exception $e) {
Expand Down

0 comments on commit c0444f5

Please sign in to comment.