diff --git a/calendar/js/app.js b/calendar/js/app.js index be8c76cb55..421aca7418 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -1987,12 +1987,12 @@ app.classes.calendar = AppJS.extend( break; case 'day': var end = state.state.last = view.end_date(state.state).toJSON(); - value.push({ + value.push({ id: app.classes.calendar._daywise_cache_id(date,state.state.owner), - start_date: state.state.first, - end_date: state.state.last, - owner: view.owner(state.state) - }); + start_date: state.state.first, + end_date: state.state.last, + owner: view.owner(state.state) + }); break; default: var end = state.state.last = view.end_date(state.state).toJSON(); @@ -2009,7 +2009,25 @@ app.classes.calendar = AppJS.extend( break; } // If we have cached data for the timespan, pass it along - this._need_data(value,state.state); + // Single day with multiple owners still needs owners split to satisfy + // caching keys, otherwise they'll fetch & cache consolidated + if(state.state.view == 'day' && state.state.owner.length < parseInt(this.egw.preference('day_consolidate','calendar'))) + { + day_value = []; + for(var i = 0; i < state.state.owner.length; i++) + { + day_value.push({ + start_date: state.state.first, + end_date: state.state.last, + owner: state.state.owner[i] + }); + } + this._need_data(day_value,state.state); + } + else + { + this._need_data(value,state.state); + } var row_index = 0; @@ -2083,22 +2101,6 @@ app.classes.calendar = AppJS.extend( widget.set_value(value[row_index++]); } },this, et2_calendar_view); - - // Single day with multiple owners still needs owners split to satisfy - // caching keys, otherwise they'll cache consolidated - if(state.state.view == 'day' && state.state.owner.length < parseInt(this.egw.preference('day_consolidate','calendar'))) - { - value = []; - for(var i = 0; i < state.state.owner.length; i++) - { - value.push({ - start_date: state.state.first, - end_date: state.state.last, - owner: state.state.owner[i] - }); - } - this._need_data(value,state.state); - } } else { diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 418ccc2921..38dadae98d 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -652,8 +652,8 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], if(event.participants && this._parent.options.owner) { var parent_owner = this._parent.options.owner; - var match = false; - for(var i = 0; !match && i < this._parent.options.owner.length; i++ ) + var owner_match = false; + for(var i = 0; i < this._parent.options.owner.length; i++ ) { if (parseInt(this._parent.options.owner[i]) < 0) { @@ -669,20 +669,20 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], parent_owner.indexOf && parent_owner.indexOf(id) >= 0) { - match = true; + owner_match = true; break; } } - if(!match) + if(!owner_match) { - return(this._parent.options.owner == event.owner || + owner_match = (this._parent.options.owner == event.owner || parent_owner.indexOf && parent_owner.indexOf(event.owner) >= 0); } } // Simple, same day - if(this.options.value.date && event.date == this.options.value.date) + if(owner_match && this.options.value.date && event.date == this.options.value.date) { return true; } @@ -690,15 +690,18 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], // Multi-day non-recurring event spans days - date does not match var event_start = new Date(event.start); var event_end = new Date(event.end); - if(this._parent.date >= event_start && this._parent.date <= event_end) + if(owner_match && this._parent.date >= event_start && this._parent.date <= event_end) { return true; } // Delete all old actions - this._actionObject.clear(); - this._actionObject.unregisterActions(); - this._actionObject = null; + if(this._actionObject) + { + this._actionObject.clear(); + this._actionObject.unregisterActions(); + this._actionObject = null; + } // Update daywise caches var new_cache_id = app.classes.calendar._daywise_cache_id(event.date,this._parent.options.owner); diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 0d5d184c3b..30e4b83952 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -649,7 +649,6 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.scrolling - .css('height', (this.div.innerHeight() - header_height)+'px') .on('scroll', jQuery.proxy(this._scroll, this)); // Percent @@ -684,7 +683,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this._top_time = 0 for(var t = 0,i = 0; t < 1440; t += granularity,++i) { - html += '