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.
This commit is contained in:
parent
a12fcba096
commit
d44bd8eaa8
1 changed files with 6 additions and 10 deletions
|
@ -7,7 +7,7 @@
|
||||||
* @licstart The following is the entire license notice for the
|
* @licstart The following is the entire license notice for the
|
||||||
* JavaScript code in this file.
|
* JavaScript code in this file.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012, Kolab Systems AG <contact@kolabsys.com>
|
* Copyright (C) 2011-2015, Kolab Systems AG <contact@kolabsys.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* 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;
|
var d, delegator;
|
||||||
|
|
||||||
$.each(this.env.namespace, function(i, v) {
|
// derive delegator from the calendar owner property
|
||||||
var delim = v[v.length-1], pos;
|
if (this.env.calendars[calendar] && this.env.calendars[calendar].owner) {
|
||||||
if (calendar.indexOf(v) === 0 && (pos = calendar.indexOf(delim, v.length))) {
|
delegator = this.env.calendars[calendar].owner.replace(/@.+$/, '');
|
||||||
delegator = calendar.substr(v.length, pos - v.length)
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (delegator && (d = this.env.delegators[delegator])) {
|
if (delegator && (d = this.env.delegators[delegator])) {
|
||||||
// find delegator's identity id
|
// find delegator's identity id
|
||||||
|
@ -299,9 +296,8 @@ rcube_webmail.prototype.calendar_change = function()
|
||||||
|
|
||||||
// change organizer identity in identity selector
|
// change organizer identity in identity selector
|
||||||
if (select.length && old != this.env.calendar_settings.identity) {
|
if (select.length && old != this.env.calendar_settings.identity) {
|
||||||
// @TODO: run freebusy update?
|
|
||||||
var id = this.env.calendar_settings.identity.identity_id;
|
var id = this.env.calendar_settings.identity.identity_id;
|
||||||
select.val(id ? id : '');
|
select.val(id || select.find('option').first().val()).change();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue