summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-29 11:26:50 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-29 11:26:50 (GMT)
commit44216168f1e03add8581e3235a8b7d8ccd116857 (patch)
treeb6e1b2c7d67fe6adbb596dbf7b0c87f344eb7dd6
parentd735c4721ef4976f3c128e1a32d22cd8a7c6020a (diff)
downloadroundcubemail-plugins-kolab-44216168f1e03add8581e3235a8b7d8ccd116857.tar.gz
Set free_busy status to transparent when declining an invitation (#4425)
-rw-r--r--plugins/calendar/calendar.php5
-rw-r--r--plugins/calendar/calendar_ui.js8
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 59008db..a288cb5 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -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')
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 598a4d7..8e903c5 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -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