From 72c21bffcfbd95efab4245240d18c72f37a42155 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 24 Jan 2019 11:15:55 -0700 Subject: [PATCH] Calendar - fix week view display name of other user, broken by 9742956c --- calendar/js/app.js | 14 ++++++++++---- calendar/js/et2_widget_timegrid.js | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index 3d4ad821b6..5bab26465f 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2488,18 +2488,23 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( row_index = 0; // Set rows that need it + var was_disabled = []; grid.iterateOver(function(widget) { - var was_disabled = false; + was_disabled[row_index] = false; if(row_index < value.length) { - was_disabled = widget.options.disabled; + was_disabled[row_index] = widget.options.disabled; widget.set_disabled(false); } else { widget.set_disabled(true); - return; } + row_index++; + },this, et2_calendar_view); + row_index = 0; + grid.iterateOver(function(widget) { + if(row_index >= value.length) return; if(widget.set_show_weekend) { widget.set_show_weekend(view.show_weekend(state.state)); @@ -2521,13 +2526,14 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( window.setTimeout(jQuery.proxy(widget.set_header_classes, widget),0); // If disabled while the daycols were loaded, they won't load their events - for(var day = 0; was_disabled && day < widget.day_widgets.length; day++) + for(var day = 0; was_disabled[row_index] && day < widget.day_widgets.length; day++) { egw.dataStoreUID( widget.day_widgets[day].registeredUID, egw.dataGetUIDdata(widget.day_widgets[day].registeredUID).data ); } + widget.set_owner(value[row_index].owner); // Hide loader widget.loader.hide(); diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index f017ffdd6d..be69df0539 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1610,7 +1610,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. if(!widget.disabled) rowCount++; },this, et2_calendar_timegrid); // Just us, show week number - if(rowCount == 1 || _owner.length == 1) _owner = false; + if(rowCount == 1 && _owner.length == 1 && _owner[0] == egw.user('account_id') || rowCount != 1) _owner = false; } if(typeof _owner == 'string' && isNaN(_owner))