Fix broken check if calendar was for just a group, or owner was set as a string

This commit is contained in:
Nathan Gray 2016-01-19 16:52:05 +00:00
parent a253a7b568
commit df0592f7c8
2 changed files with 11 additions and 6 deletions

View File

@ -636,14 +636,17 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM],
var owner_match = true; var owner_match = true;
if(event.participants && this._parent.options.owner) if(event.participants && this._parent.options.owner)
{ {
var parent_owner = this._parent.options.owner; var parent_owner = typeof this._parent.options.owner !== 'object' ?
[this._parent.options.owner] :
this._parent.options.owner;
owner_match = false; owner_match = false;
for(var i = 0; i < this._parent.options.owner.length; i++ ) var length = parent_owner.length;
for(var i = 0; i < length; i++ )
{ {
if (parseInt(this._parent.options.owner[i]) < 0) if (parseInt(parent_owner[i]) < 0)
{ {
// Add in groups, if we can get them (this is syncronous) // Add in groups, if we can get them (this is syncronous)
egw.accountData(this._parent.options.owner[i],'account_id',true,function(members) { egw.accountData(parent_owner[i],'account_id',true,function(members) {
parent_owner = parent_owner.concat(Object.keys(members)); parent_owner = parent_owner.concat(Object.keys(members));
}); });
} }

View File

@ -1365,9 +1365,11 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
} }
if(this.isAttached() && ( if(this.isAttached() && (
typeof old == "number" && typeof _owner == "number" && old !== this.options.owner || typeof old === "number" && typeof _owner === "number" && old !== this.options.owner ||
// Array of ids will not compare as equal // Array of ids will not compare as equal
((typeof old === 'object' || typeof _owner === 'object') && old.toString() !== _owner.toString()) ((typeof old === 'object' || typeof _owner === 'object') && old.toString() !== _owner.toString()) ||
// Strings
typeof old === 'string' && ''+old !== ''+this.options.owner
)) ))
{ {
this.invalidate(true); this.invalidate(true);