summaryrefslogtreecommitdiff
path: root/plugins
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:23:03 (GMT)
commitc5a2eba629202bc6fb42db770ac828634d110101 (patch)
treed970d1ab9ae7e49a60c9358f2f7e1eeea49213b6 /plugins
parent9e321380a7b19a1b78f273b53bf87805c05fdb21 (diff)
downloadroundcubemail-plugins-kolab-c5a2eba629202bc6fb42db770ac828634d110101.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
Diffstat (limited to 'plugins')
-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 69df2e4..af700d1 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 $ics_parts = array();
@@ -1047,6 +1048,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 d5a86a7..68ff6c9 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -531,17 +531,18 @@ 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);
}
// select the correct organizer identity
@@ -553,7 +554,7 @@ function rcube_calendar_ui(settings)
}
});
$('#edit-identities-list').val(identity_id);
- $('#edit-attendees-form')[(organizer?'show':'hide')]();
+ $('#edit-attendees-form')[(allow_invitations?'show':'hide')]();
$('#edit-attendee-schedule')[(calendar.freebusy?'show':'hide')]();
};
@@ -638,7 +639,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 fb642ec..a8d5da8 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -104,6 +104,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;