Fix bug where the refresh did not happen with multiple users selected

This commit is contained in:
Nathan Gray 2015-11-23 16:50:44 +00:00
parent c51e9db46b
commit d08a91dcff

View File

@ -264,19 +264,31 @@ app.classes.calendar = AppJS.extend(
!(_type == 'add' && event.data.recur_type) !(_type == 'add' && event.data.recur_type)
) )
{ {
var new_cache_id = app.classes.calendar._daywise_cache_id(event.data.date,this.state.owner) var multiple_owner = typeof this.state.owner != 'string' &&
this.state.owner.length < parseInt(this.egw.config('calview_no_consolidate','phpgwapi') || 5) ? true : false;
for(var i = 0; i < this.state.owner.length; i++)
{
var owner = multiple_owner ? this.state.owner[i] : this.state.owner
var new_cache_id = app.classes.calendar._daywise_cache_id(event.data.date, owner)
var daywise = egw.dataGetUIDdata(new_cache_id); var daywise = egw.dataGetUIDdata(new_cache_id);
daywise = daywise ? daywise.data : []; daywise = daywise ? daywise.data : [];
if(_type === 'delete') if(_type === 'delete' ||
// Make sure we only update the calendars of those actually in the event
multiple_owner && typeof event.data.participants[owner] == 'undefined')
{ {
daywise.splice(daywise.indexOf(_id),1); daywise.splice(daywise.indexOf(_id),1);
egw.dataStoreUID('calendar::'+_id, null);
} }
else if (daywise.indexOf(_id) < 0) else if (daywise.indexOf(_id) < 0)
{ {
daywise.push(_id); daywise.push(_id);
} }
if(_type === 'delete')
{
egw.dataStoreUID('calendar::'+_id, null);
}
egw.dataStoreUID(new_cache_id,daywise); egw.dataStoreUID(new_cache_id,daywise);
if(!multiple_owner) break;
}
return false; return false;
} }
else else