From d36d18a14845f60849946a13dd66a0bfe6eacf9c Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 22 Oct 2018 10:31:10 -0600 Subject: [PATCH] Calendar - In week view always display name of selected user if not self --- calendar/js/et2_widget_timegrid.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index c754be7b15..57a103ee6f 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1602,6 +1602,17 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. this.owner.set_label(''); this.div.removeClass('calendar_TimeGridNoLabel'); + // Check to see if it's our own calendar, with just us showing + if(typeof _owner == 'object' && _owner.length == 1 && _owner[0] == this.egw().user('account_id')) + { + var rowCount = 0; + this._parent.iterateOver(function(widget) { + if(!widget.disabled) rowCount++; + },this, et2_calendar_timegrid); + // Just us, show week number + if(rowCount == 1) _owner = false; + } + if(typeof _owner == 'string' && isNaN(_owner)) { this.set_label(''); @@ -1610,7 +1621,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. // Label is empty, but give extra space for the owner name this.div.removeClass('calendar_TimeGridNoLabel'); } - else if (!_owner || typeof _owner == 'object' && _owner.length) + else if (!_owner || typeof _owner == 'object' && _owner.length > 1) { // Don't show owners if more than one, show week number this.owner.set_value('');