diff --git a/calendar/js/app.js b/calendar/js/app.js index 3d28c62d24..25b52d0c94 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -533,8 +533,6 @@ var CalendarApp = /** @class */ (function (_super) { // Calendar cares about calendar & infolog if (pushData.app !== this.appname && pushData.app !== 'infolog') return; - // pushData does not contain everything, just the minimum. See calendar_hooks::search_link(). - var event = pushData.acl || {}; if (pushData.type === 'delete') { return _super.prototype.push.call(this, pushData); } @@ -560,6 +558,8 @@ var CalendarApp = /** @class */ (function (_super) { * @param pushData */ CalendarApp.prototype.push_calendar = function (pushData) { + // pushData does not contain everything, just the minimum. See calendar_hooks::search_link(). + var cal_event = pushData.acl || {}; // check visibility - grants is ID => permission of people we're allowed to see var owners = []; if (typeof this._grants === 'undefined') { @@ -568,13 +568,13 @@ var CalendarApp = /** @class */ (function (_super) { // Filter what's allowed down to those we care about var filtered = Object.keys(this._grants).filter(function (account) { return app.calendar.state.owner.indexOf(account) >= 0; }); // Check if we're interested in displaying by owner / participant - var owner_check = et2_widget_event_1.et2_calendar_event.owner_check(event, { options: { owner: filtered } }); + var owner_check = et2_widget_event_1.et2_calendar_event.owner_check(cal_event, { options: { owner: filtered } }); if (!owner_check) { // The owner is not in the list of what we're allowed / care about return; } // Check if we're interested by date? - if (event.end <= new Date(this.state.first).valueOf() / 1000 || event.start > new Date(this.state.last).valueOf() / 1000) { + if (cal_event.end <= new Date(this.state.first).valueOf() / 1000 || cal_event.start > new Date(this.state.last).valueOf() / 1000) { // The event is outside our current view return; } diff --git a/calendar/js/app.ts b/calendar/js/app.ts index 45daf00cec..858c054bd8 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -461,9 +461,6 @@ class CalendarApp extends EgwApp // Calendar cares about calendar & infolog if(pushData.app !== this.appname && pushData.app !== 'infolog') return; - // pushData does not contain everything, just the minimum. See calendar_hooks::search_link(). - let event = pushData.acl || {}; - if(pushData.type === 'delete') { return super.push(pushData); @@ -496,6 +493,9 @@ class CalendarApp extends EgwApp */ private push_calendar(pushData) { + // pushData does not contain everything, just the minimum. See calendar_hooks::search_link(). + let cal_event = pushData.acl || {}; + // check visibility - grants is ID => permission of people we're allowed to see let owners = []; if(typeof this._grants === 'undefined') @@ -506,7 +506,7 @@ class CalendarApp extends EgwApp let filtered = Object.keys(this._grants).filter(account => app.calendar.state.owner.indexOf(account) >= 0); // Check if we're interested in displaying by owner / participant - let owner_check = et2_calendar_event.owner_check(event, {options: {owner: filtered}}); + let owner_check = et2_calendar_event.owner_check(cal_event, {options: {owner: filtered}}); if(!owner_check) { // The owner is not in the list of what we're allowed / care about @@ -514,7 +514,7 @@ class CalendarApp extends EgwApp } // Check if we're interested by date? - if(event.end <= new Date(this.state.first).valueOf() /1000 || event.start > new Date(this.state.last).valueOf()/1000) + if(cal_event.end <= new Date(this.state.first).valueOf() /1000 || cal_event.start > new Date(this.state.last).valueOf()/1000) { // The event is outside our current view return;