Branch 'dev/recurring-invitations' - plugins/calendar

Thomas Brüderli bruederli at kolabsys.com
Sun Feb 15 15:12:14 CET 2015


 plugins/calendar/calendar_ui.js                 |   13 +++++++++++--
 plugins/calendar/drivers/kolab/kolab_driver.php |    3 ++-
 plugins/calendar/skins/larry/calendar.css       |    4 ++++
 3 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit f09948eefe6b7b1d275bc6d5465c02e8c0dbe9c2
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Sun Feb 15 15:12:08 2015 +0100

    Disable recurrence and attachments forms when editing a single recurrence instance. These properties cannot be stored in recurrence exceptions

diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 1f9f399..f9e0d28 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -691,6 +691,8 @@ function rcube_calendar_ui(settings)
 
       // reset dialog first
       $('#eventtabs').get(0).reset();
+      $('#event-panel-recurrence input, #event-panel-recurrence select, #event-panel-attachments input').prop('disabled', false);
+      $('#event-panel-recurrence, #event-panel-attachments').removeClass('disabled');
 
       // allow other plugins to do actions when event form is opened
       rcmail.triggerEvent('calendar-event-init', {o: event});
@@ -752,7 +754,7 @@ function rcube_calendar_ui(settings)
       if (event.id && event.recurrence) {
         var sel = event._savemode || (event.thisandfuture ? 'future' : (event.isexception ? 'current' : 'all'));
         $('#edit-recurring-warning').show();
-        $('input.edit-recurring-savemode[value="'+sel+'"]').prop('checked', true);
+        $('input.edit-recurring-savemode[value="'+sel+'"]').prop('checked', true).change();
       }
       else
         $('#edit-recurring-warning').hide();
@@ -803,7 +805,7 @@ function rcube_calendar_ui(settings)
       // attachments
       var load_attachments_tab = function()
       {
-        rcmail.enable_command('remove-attachment', !calendar.readonly);
+        rcmail.enable_command('remove-attachment', !calendar.readonly && !event.recurrence_id);
         rcmail.env.deleted_attachments = [];
         // we're sharing some code for uploads handling with app.js
         rcmail.env.attachments = [];
@@ -4163,6 +4165,13 @@ function rcube_calendar_ui(settings)
         event_rsvp($(this).attr('rel'))
       });
 
+      $('#eventedit input.edit-recurring-savemode').change(function(e) {
+        var sel = $('input.edit-recurring-savemode:checked').val(),
+          disabled = sel == 'current' || sel == 'future';
+        $('#event-panel-recurrence input, #event-panel-recurrence select, #event-panel-attachments input').prop('disabled', disabled);
+        $('#event-panel-recurrence, #event-panel-attachments')[(disabled?'addClass':'removeClass')]('disabled');
+      })
+
       $('#eventshow .changersvp').click(function(e) {
         var d = $('#eventshow'),
           h = -$(this).closest('.event-line').toggle().height();
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 1e3f0ea..4b450f8 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -918,9 +918,10 @@ class kolab_driver extends calendar_driver
 
       case 'future':
       case 'current':
-        // recurring instances shall not store recurrence rules
+        // recurring instances shall not store recurrence rules and attachments
         $event['recurrence'] = array();
         $event['thisandfuture'] = $savemode == 'future';
+        unset($event['attachments']);
 
         // increment sequence of this instance if scheduling is affected
         if ($reschedule) {
diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css
index 1c2eca5..0fec69c 100644
--- a/plugins/calendar/skins/larry/calendar.css
+++ b/plugins/calendar/skins/larry/calendar.css
@@ -676,6 +676,10 @@ a.miniColors-trigger {
 	outline: none;
 }
 
+#event-panel-attachments.disabled .attachmentslist li a.delete {
+	visibility: hidden;
+}
+
 .event-attendees span.attendee {
 	padding-right: 18px;
 	margin-right: 0.5em;




More information about the commits mailing list