2 commits - plugins/calendar plugins/kolab_delegation

Thomas Brüderli bruederli at kolabsys.com
Wed Jan 21 13:27:39 CET 2015


 plugins/calendar/calendar_ui.js              |   11 +++++++++++
 plugins/kolab_delegation/kolab_delegation.js |   16 ++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit d44bd8eaa85dfe5036ee189ba3a05c7ff3f1c0c8
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Jan 21 13:21:33 2015 +0100

    Fix delegator identity selection for calendar events (#4274)
    
    The delegator cannot be extracted from the calendar ID which is no
    longer an imap folder path. Use the 'owner' attribute instead.

diff --git a/plugins/kolab_delegation/kolab_delegation.js b/plugins/kolab_delegation/kolab_delegation.js
index 4ecaa51..01d6d30 100644
--- a/plugins/kolab_delegation/kolab_delegation.js
+++ b/plugins/kolab_delegation/kolab_delegation.js
@@ -7,7 +7,7 @@
  * @licstart  The following is the entire license notice for the
  * JavaScript code in this file.
  *
- * Copyright (C) 2011-2012, Kolab Systems AG <contact at kolabsys.com>
+ * Copyright (C) 2011-2015, Kolab Systems AG <contact at kolabsys.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -260,13 +260,10 @@ rcube_webmail.prototype.calendar_folder_delegator = function(calendar)
 {
   var d, delegator;
 
-  $.each(this.env.namespace, function(i, v) {
-    var delim = v[v.length-1], pos;
-    if (calendar.indexOf(v) === 0 && (pos = calendar.indexOf(delim, v.length))) {
-      delegator = calendar.substr(v.length, pos - v.length)
-      return false;
-    }
-  });
+  // derive delegator from the calendar owner property
+  if (this.env.calendars[calendar] && this.env.calendars[calendar].owner) {
+    delegator = this.env.calendars[calendar].owner.replace(/@.+$/, '');
+  }
 
   if (delegator && (d = this.env.delegators[delegator])) {
     // find delegator's identity id
@@ -299,9 +296,8 @@ rcube_webmail.prototype.calendar_change = function()
 
   // change organizer identity in identity selector
   if (select.length && old != this.env.calendar_settings.identity) {
-    // @TODO: run freebusy update?
     var id = this.env.calendar_settings.identity.identity_id;
-    select.val(id ? id : '');
+    select.val(id || select.find('option').first().val()).change();
   }
 };
 


commit a12fcba096f2afbef49d678d9dc752cfdbec9994
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Jan 21 13:11:52 2015 +0100

    Update the free-busy status when changing the organizer identity

diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index ade2240..2d2c467 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -4012,6 +4012,17 @@ function rcube_calendar_ui(settings)
       me.init_alarms_edit('#edit-alarms');
       me.init_recurrence_edit('#eventedit');
 
+      // reload free-busy status when changing the organizer identity
+      $('#eventedit').on('change', '#edit-identities-list', function(e) {
+        var email = settings.identities[$(this).val()],
+          icon = $(this).closest('tr').find('img.availabilityicon');
+
+        if (email && icon.length) {
+          icon.attr('data-email', email);
+          check_freebusy_status(icon, email, me.selected_event);
+        }
+      });
+
       $('#event-export-startdate').datepicker(datepicker_settings);
 
       // init attendees autocompletion




More information about the commits mailing list