Set free_busy status to transparent when declining an invitation (#4425)

This commit is contained in:
Thomas Bruederli 2015-01-29 12:26:50 +01:00
parent d735c4721e
commit 44216168f1
2 changed files with 13 additions and 0 deletions

View file

@ -972,6 +972,7 @@ class calendar extends rcube_plugin
$ev = $this->driver->get_event($event);
$ev['attendees'] = $event['attendees'];
$ev['free_busy'] = $event['free_busy'];
// send invitation to delegatee + add it as attendee
if ($status == 'delegated' && $event['to']) {
@ -2687,6 +2688,7 @@ class calendar extends rcube_plugin
$metadata['attendee'] = $attendee['email'];
$metadata['rsvp'] = $attendee['role'] != 'NON-PARTICIPANT';
$reply_sender = $attendee['email'];
$event_attendee = $attendee;
}
}
@ -2809,6 +2811,9 @@ class calendar extends rcube_plugin
$error_msg = $this->gettext('newerversionexists');
}
else if (!$existing && ($status != 'declined' || $this->rc->config->get('kolab_invitation_calendars'))) {
if ($status == 'declined' || $event['status'] == 'CANCELLED' || $event_attendee['role'] == 'NON-PARTICIPANT') {
$event['free_busy'] = 'free';
}
$success = $this->driver->new_event($event);
}
else if ($status == 'declined')

View file

@ -2401,6 +2401,14 @@ function rcube_calendar_ui(settings)
}
}
}
// set free_busy status to transparent if declined (#4425)
if (data.status == 'DECLINED' || data.role == 'NON-PARTICIPANT') {
me.selected_event.free_busy = 'free';
}
else {
me.selected_event.free_busy = 'busy';
}
}
// submit status change to server