summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-07-10 08:09:34 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-07-10 08:14:55 (GMT)
commit7758e47e378d66819fa11657fdfbe3eaf12a87fd (patch)
tree3ce5ed6e206554113130e24e744548d42250e17f
parentfc73732cc6c994fa20c6c3c6c501fcac0bcf6535 (diff)
downloadroundcubemail-plugins-kolab-7758e47e378d66819fa11657fdfbe3eaf12a87fd.tar.gz
Allow to invite/edit attendees to other user's shared events when either
a) in a globally shared (anonymous) calendar or b) when enabled by config using the new option 'calendar_allow_invite_shared' Fixes bug #1758
-rw-r--r--plugins/calendar/calendar.php2
-rw-r--r--plugins/calendar/calendar_ui.js13
-rw-r--r--plugins/calendar/config.inc.php.dist3
3 files changed, 12 insertions, 6 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index fcfe909..2762e6d 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -56,6 +56,7 @@ class calendar extends rcube_plugin
'calendar_agenda_sections' => 'smart',
'calendar_event_coloring' => 0,
'calendar_time_indicator' => true,
+ 'calendar_allow_invite_shared' => false,
);
private $default_categories = array(
@@ -1050,6 +1051,7 @@ class calendar extends rcube_plugin
$settings['agenda_sections'] = $this->rc->config->get('calendar_agenda_sections', $this->defaults['calendar_agenda_sections']);
$settings['event_coloring'] = (int)$this->rc->config->get('calendar_event_coloring', $this->defaults['calendar_event_coloring']);
$settings['time_indicator'] = (int)$this->rc->config->get('calendar_time_indicator', $this->defaults['calendar_time_indicator']);
+ $settings['invite_shared'] = (int)$this->rc->config->get('calendar_allow_invite_shared', $this->defaults['calendar_allow_invite_shared']);
// get user identity to create default attendee
if ($this->ui->screen == 'calendar') {
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index ec1bd4f..89e7fd9 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -525,20 +525,21 @@ function rcube_calendar_ui(settings)
$('#edit-recurring-warning').hide();
// init attendees tab
- var organizer = !event.attendees || is_organizer(event);
+ var organizer = !event.attendees || is_organizer(event),
+ allow_invitations = organizer || (calendar.owner && calendar.owner == 'anonymous') || settings.invite_shared;
event_attendees = [];
attendees_list = $('#edit-attendees-table > tbody').html('');
- $('#edit-attendees-notify')[(notify.checked && organizer ? 'show' : 'hide')]();
- $('#edit-localchanges-warning')[(has_attendees(event) && !(organizer || (calendar.owner && is_organizer(event, calendar.owner))) ? 'show' : 'hide')]();
+ $('#edit-attendees-notify')[(notify.checked && allow_invitations ? 'show' : 'hide')]();
+ $('#edit-localchanges-warning')[(has_attendees(event) && !(allow_invitations || (calendar.owner && is_organizer(event, calendar.owner))) ? 'show' : 'hide')]();
var load_attendees_tab = function()
{
if (event.attendees) {
for (var j=0; j < event.attendees.length; j++)
- add_attendee(event.attendees[j], !organizer);
+ add_attendee(event.attendees[j], !allow_invitations);
}
- $('#edit-attendees-form')[(organizer?'show':'hide')]();
+ $('#edit-attendees-form')[(allow_invitations?'show':'hide')]();
$('#edit-attendee-schedule')[(calendar.freebusy?'show':'hide')]();
};
@@ -621,7 +622,7 @@ function rcube_calendar_ui(settings)
data.attendees = [];
// tell server to send notifications
- if ((data.attendees.length || (event.id && event.attendees.length)) && organizer && (notify.checked || invite.checked)) {
+ if ((data.attendees.length || (event.id && event.attendees.length)) && allow_invitations && (notify.checked || invite.checked)) {
data._notify = 1;
}
diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist
index cea4878..3e3f2b9 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -109,6 +109,9 @@ $rcmail_config['calendar_categories'] = array(
'Holiday' => 'ff6600',
);
+// enable users to invite/edit attendees for shared events organized by others
+$rcmail_config['calendar_allow_invite_shared'] = false;
+
// enable asynchronous free-busy triggering after data changed
$rcmail_config['calendar_freebusy_trigger'] = false;