Calendar - fix week view display name of other user, broken by 9742956c

This commit is contained in:
nathangray 2019-01-24 11:15:55 -07:00
parent 1ed0fd898f
commit 72c21bffcf
2 changed files with 11 additions and 5 deletions

View File

@ -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();

View File

@ -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))