forked from extern/egroupware
fix CRM view shown with [object Promise] instead of title
This commit is contained in:
parent
583ac1c6d6
commit
5859ce0c37
@ -327,25 +327,21 @@ class AddressbookApp extends EgwApp
|
||||
{
|
||||
return this.egw.open_link(url);
|
||||
}
|
||||
let open = function(_title)
|
||||
const title = _params.title ? Promise.resolve(_params.title) : this.egw.link_title('addressbook', contact_id, true);
|
||||
title.then(_title =>
|
||||
{
|
||||
let title = _title || this.egw.link_title('addressbook', contact_id, open);
|
||||
if (title)
|
||||
{
|
||||
this.egw.window.framework.tabLinkHandler(url, {
|
||||
displayName: title,
|
||||
icon: _params.icon || this.egw.link('/api/avatar.php', {
|
||||
contact_id: contact_id,
|
||||
etag: (new Date).valueOf()/86400|0 // cache for a day, better then no invalidation
|
||||
}),
|
||||
refreshCallback: function() {
|
||||
etemplate2.getById("addressbook-view-"+this.appName)?.app_obj.addressbook.view_set_list();
|
||||
},
|
||||
id: contact_id + '-'+crm_list
|
||||
});
|
||||
}
|
||||
}.bind(this);
|
||||
open(_params.title);
|
||||
this.egw.window.framework.tabLinkHandler(url, {
|
||||
displayName: _title,
|
||||
icon: _params.icon || this.egw.link('/api/avatar.php', {
|
||||
contact_id: contact_id,
|
||||
etag: (new Date).valueOf()/86400|0 // cache for a day, better then no invalidation
|
||||
}),
|
||||
refreshCallback: function() {
|
||||
etemplate2.getById("addressbook-view-"+this.appName)?.app_obj.addressbook.view_set_list();
|
||||
},
|
||||
id: contact_id + '-'+crm_list
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1626,4 +1622,4 @@ class AddressbookApp extends EgwApp
|
||||
}
|
||||
}
|
||||
|
||||
app.classes.addressbook = AddressbookApp;
|
||||
app.classes.addressbook = AddressbookApp;
|
13
api/js/jsapi/egw_global.d.ts
vendored
13
api/js/jsapi/egw_global.d.ts
vendored
@ -355,14 +355,19 @@ declare interface IegwGlobal
|
||||
/**
|
||||
* Query a title of _app/_id
|
||||
*
|
||||
* Deprecated default of returning string or null for no callback, will change in future to always return a Promise!
|
||||
*
|
||||
* @param {string} _app
|
||||
* @param {string|number} _id
|
||||
* @param {function} _callback optinal callback, required if for responses from the server
|
||||
* @param {object} _context context for the callback
|
||||
* @param {boolean|function|undefined} _callback true to always return a promise, false: just lookup title-cache or optional callback
|
||||
* NOT giving either a boolean value or a callback is deprecated!
|
||||
* @param {object|undefined} _context context for the callback
|
||||
* @param {boolean} _force_reload true load again from server, even if already cached
|
||||
* @return {string|null} string with title if it exist in local cache or null if not
|
||||
* @return {Promise<string>|string|null} Promise for _callback given (function or true), string with title if it exists in local cache or null if not
|
||||
*/
|
||||
link_title(_app : string, _id : string|number, _callback? : Function, _context? : object, _force_reload? : boolean) : string|null;
|
||||
link_title(_app : string, _id : string|number, _callback? : Function|boolean, _context? : object, _force_reload? : boolean) : Promise<string>|string|null;
|
||||
link_title(_app : string, _id : string|number, _callback : true) : Promise<string>;
|
||||
link_title(_app : string, _id : string|number, _callback? : false) : string|null;
|
||||
/**
|
||||
* Callback to add all current title requests
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user