Change missing owner label lookup to deal with async request

This commit is contained in:
nathangray 2018-10-11 12:03:04 -06:00
parent 117b559a5e
commit 0f016bcd7b

View File

@ -364,7 +364,7 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend
if(options && options.find) if(options && options.find)
{ {
var found = options.find(function(element) {return element.id == user;}) || {}; var found = options.find(function(element) {return element.id == user;}) || {};
if(found && found.label) if(found && found.label && found.label !== user)
{ {
label = found.label; label = found.label;
} }
@ -373,7 +373,10 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend
{ {
// No sidebox? Must be in home or sitemgr (no caching) - ask directly // No sidebox? Must be in home or sitemgr (no caching) - ask directly
label = '?'; label = '?';
egw.json('calendar_owner_etemplate_widget::ajax_owner',user,function(data) {label = data;}, this).sendRequest(); egw.json('calendar_owner_etemplate_widget::ajax_owner',user,function(data) {
et2_calendar_view.owner_name_cache[user] = data;
this.invalidate(true);
}.bind(this), this).sendRequest();
} }
} }
if(label) if(label)