diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index c9c44763c0..1eb34f05ee 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -1063,6 +1063,8 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte */ click: function(_ev) { + if(this._parent.options.readonly ) return; + // Drag to create in progress if(this._parent.drag_create.start !== null) return; diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index fd5b87837f..6cb40f1f69 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -958,7 +958,7 @@ et2_calendar_event.owner_check = function owner_check(event, parent, owner_too) { options = parent.getArrayMgr("sel_options").getRoot().getEntry('owner'); } - if(event.participants && parent.options.owner) + if(event.participants && parent.options.owner.length > 0) { var parent_owner = jQuery.extend([], typeof parent.options.owner !== 'object' ? [parent.options.owner] : diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 22df041a02..6ac61fbe5b 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -132,7 +132,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. destroy: function() { // Stop listening to tab changes - if(framework.getApplicationByName('calendar').tab) + if(typeof framework !== 'undefined' && framework.getApplicationByName('calendar').tab) { jQuery(framework.getApplicationByName('calendar').tab.contentDiv).off('show.' + this.id); } @@ -164,7 +164,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. this._super.apply(this, arguments); // Listen to tab show to make sure we scroll to the day start, not top - if(framework.getApplicationByName('calendar').tab) + if(typeof framework !== 'undefined' && framework.getApplicationByName('calendar').tab) { jQuery(framework.getApplicationByName('calendar').tab.contentDiv) .on('show.' + this.id, jQuery.proxy( @@ -1276,6 +1276,9 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. * @param {type} actionLinks */ _init_links_dnd: function(mgr,actionLinks) { + + if (this.options.readonly) return; + var self = this; var drop_link = mgr.getActionById('egw_link_drop'); @@ -1788,6 +1791,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. click: function(_ev) { var result = true; + if(this.options.readonly ) return; // Drag to create in progress if(this.drag_create.start !== null) return; @@ -1875,6 +1879,8 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. _mouse_down: function(event) { if(event.which !== 1) return; + + if (this.options.readonly) return; var start = jQuery.extend({},this.gridHover[0].dataset); if(start.date) @@ -1951,6 +1957,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. */ _mouse_up: function(event) { + if (this.options.readonly) return; var end = jQuery.extend({}, this.gridHover[0].dataset); if(end.date) { diff --git a/calendar/js/et2_widget_view.js b/calendar/js/et2_widget_view.js index 109e089040..acd1f7186d 100644 --- a/calendar/js/et2_widget_view.js +++ b/calendar/js/et2_widget_view.js @@ -151,6 +151,8 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend else if(typeof new_date === "string") { this.date_helper.set_year(new_date.substring(0,4)); + // Avoid overflow into next month, since we re-use date_helper + this.date_helper.set_date(1); this.date_helper.set_month(new_date.substring(4,6)); this.date_helper.set_date(new_date.substring(6,8)); } @@ -190,6 +192,8 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend else if(typeof new_date === "string") { this.date_helper.set_year(new_date.substring(0,4)); + // Avoid overflow into next month, since we re-use date_helper + this.date_helper.set_date(1); this.date_helper.set_month(new_date.substring(4,6)); this.date_helper.set_date(new_date.substring(6,8)); }