mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Calendar: Even faster initial loading by not triggering the user list at all
This commit is contained in:
parent
ec6a3881e3
commit
a15a7dd6a8
@ -69,7 +69,7 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
|
||||
continue; // ignore that resource, we would get a PHP Fatal: Unsupported operand types
|
||||
}
|
||||
}
|
||||
else if (!in_array($owner, array_keys($accounts)))
|
||||
else
|
||||
{
|
||||
$resource = array('app'=> 'api-accounts');
|
||||
}
|
||||
|
@ -53,10 +53,6 @@ var et2_calendar_owner = /** @class */ (function (_super) {
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
et2_calendar_owner.prototype.transformAttributes = function (_attrs) {
|
||||
_super.prototype.transformAttributes.call(this, _attrs);
|
||||
_attrs.select_options = this._get_accounts(_attrs.select_options);
|
||||
};
|
||||
et2_calendar_owner.prototype.doLoadingFinished = function () {
|
||||
_super.prototype.doLoadingFinished.call(this);
|
||||
var widget = this;
|
||||
@ -93,42 +89,6 @@ var et2_calendar_owner = /** @class */ (function (_super) {
|
||||
return null;
|
||||
return this.taglist.getValue();
|
||||
};
|
||||
/**
|
||||
* Get account info for select options from common client-side account cache
|
||||
*
|
||||
* @return {Array} select options
|
||||
*/
|
||||
et2_calendar_owner.prototype._get_accounts = function (select_options) {
|
||||
if (!jQuery.isArray(select_options)) {
|
||||
var options = jQuery.extend({}, select_options);
|
||||
select_options = [];
|
||||
for (var key in options) {
|
||||
if (typeof options[key] == 'object') {
|
||||
if (typeof (options[key].key) == 'undefined') {
|
||||
options[key].value = key;
|
||||
}
|
||||
select_options.push(options[key]);
|
||||
}
|
||||
else {
|
||||
select_options.push({ value: key, label: options[key] });
|
||||
}
|
||||
}
|
||||
}
|
||||
var type = this.egw().preference('account_selection', 'common');
|
||||
var accounts = this.egw().accounts('accounts');
|
||||
var _loop_1 = function (option) {
|
||||
if (!select_options.find(function (element) { return element.value == option.value; })) {
|
||||
option.app = this_1.egw().lang('api-accounts');
|
||||
select_options.push(option);
|
||||
}
|
||||
};
|
||||
var this_1 = this;
|
||||
for (var _i = 0, accounts_1 = accounts; _i < accounts_1.length; _i++) {
|
||||
var option = accounts_1[_i];
|
||||
_loop_1(option);
|
||||
}
|
||||
return select_options;
|
||||
};
|
||||
/**
|
||||
* Override parent to handle our special additional data types (c#,r#,etc.) when they
|
||||
* are not available client side.
|
||||
|
@ -64,14 +64,6 @@ export class et2_calendar_owner extends et2_taglist_email
|
||||
toggleOnClick: true
|
||||
};
|
||||
|
||||
|
||||
|
||||
transformAttributes( _attrs)
|
||||
{
|
||||
super.transformAttributes(_attrs);
|
||||
_attrs.select_options = this._get_accounts(_attrs.select_options);
|
||||
}
|
||||
|
||||
doLoadingFinished()
|
||||
{
|
||||
super.doLoadingFinished();
|
||||
@ -115,47 +107,6 @@ export class et2_calendar_owner extends et2_taglist_email
|
||||
return this.taglist.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get account info for select options from common client-side account cache
|
||||
*
|
||||
* @return {Array} select options
|
||||
*/
|
||||
_get_accounts(select_options)
|
||||
{
|
||||
if (!jQuery.isArray(select_options))
|
||||
{
|
||||
var options = jQuery.extend({}, select_options);
|
||||
select_options = [];
|
||||
for(var key in options)
|
||||
{
|
||||
if (typeof options[key] == 'object')
|
||||
{
|
||||
if (typeof(options[key].key) == 'undefined')
|
||||
{
|
||||
options[key].value = key;
|
||||
}
|
||||
select_options.push(options[key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
select_options.push({value: key, label: options[key]});
|
||||
}
|
||||
}
|
||||
}
|
||||
var type = this.egw().preference('account_selection', 'common');
|
||||
var accounts = this.egw().accounts('accounts');
|
||||
for(const option of accounts)
|
||||
{
|
||||
if(!select_options.find(element => element.value == option.value))
|
||||
{
|
||||
option.app = this.egw().lang('api-accounts');
|
||||
select_options.push(option);
|
||||
}
|
||||
}
|
||||
|
||||
return select_options
|
||||
}
|
||||
|
||||
/**
|
||||
* Override parent to handle our special additional data types (c#,r#,etc.) when they
|
||||
* are not available client side.
|
||||
|
Loading…
Reference in New Issue
Block a user