From 1da1cb7b99527fb45aa5bbd33936965113a82a2a Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 30 Mar 2020 10:28:48 -0600 Subject: [PATCH] Fix legacy options not being read for some widgets --- api/js/etemplate/et2_core_widget.js | 6 +- api/js/etemplate/et2_core_widget.ts | 4 +- api/js/etemplate/et2_dataview.js | 8 +- .../et2_dataview_view_rowProvider.js | 32 +- .../etemplate/et2_extension_customfields.js | 2 +- .../etemplate/et2_extension_customfields.ts | 2 +- api/js/etemplate/et2_extension_nextmatch.ts | 4 +- .../et2_extension_nextmatch_rowProvider.js | 148 ++++----- api/js/etemplate/et2_widget_button.js | 2 +- api/js/etemplate/et2_widget_button.ts | 2 +- api/js/etemplate/et2_widget_checkbox.js | 2 +- api/js/etemplate/et2_widget_checkbox.ts | 2 +- api/js/etemplate/et2_widget_date.js | 4 +- api/js/etemplate/et2_widget_date.ts | 6 +- api/js/etemplate/et2_widget_description.js | 4 +- api/js/etemplate/et2_widget_description.ts | 2 +- api/js/etemplate/et2_widget_entry.js | 2 +- api/js/etemplate/et2_widget_entry.ts | 2 +- api/js/etemplate/et2_widget_historylog.js | 2 +- api/js/etemplate/et2_widget_historylog.ts | 2 +- api/js/etemplate/et2_widget_image.js | 2 +- api/js/etemplate/et2_widget_image.ts | 4 +- api/js/etemplate/et2_widget_itempicker.js | 2 +- api/js/etemplate/et2_widget_itempicker.ts | 2 +- api/js/etemplate/et2_widget_link.js | 2 +- api/js/etemplate/et2_widget_link.ts | 34 +- api/js/etemplate/et2_widget_progress.js | 2 +- api/js/etemplate/et2_widget_progress.ts | 2 +- api/js/etemplate/et2_widget_radiobox.js | 4 +- api/js/etemplate/et2_widget_radiobox.ts | 7 +- api/js/etemplate/et2_widget_selectAccount.js | 2 +- api/js/etemplate/et2_widget_selectAccount.ts | 7 +- api/js/etemplate/et2_widget_selectbox.js | 2 +- api/js/etemplate/et2_widget_selectbox.ts | 2 +- api/js/etemplate/et2_widget_split.js | 2 +- api/js/etemplate/et2_widget_textbox.js | 2 +- api/js/etemplate/et2_widget_textbox.ts | 13 +- api/js/etemplate/et2_widget_vfs.js | 4 +- api/js/etemplate/et2_widget_vfs.ts | 4 +- api/templates/default/promptOpenedDialog.xet | 2 +- api/templates/default/vfsSelectUI.xet | 6 +- calendar/js/et2_widget_event.js | 298 +++++++++--------- 42 files changed, 320 insertions(+), 323 deletions(-) diff --git a/api/js/etemplate/et2_core_widget.js b/api/js/etemplate/et2_core_widget.js index 5595818e3a..2a8aa2f37a 100644 --- a/api/js/etemplate/et2_core_widget.js +++ b/api/js/etemplate/et2_core_widget.js @@ -123,9 +123,6 @@ var et2_widget = /** @class */ (function (_super) { */ function et2_widget(_parent, _attrs, _child) { var _this = _super.call(this) || this; - // Set the legacyOptions array to the names of the properties the "options" - // attribute defines. - _this.legacyOptions = []; _this._children = []; _this._mgrs = {}; /** @@ -900,6 +897,9 @@ var et2_widget = /** @class */ (function (_super) { "description": "Object of widget attributes" } }; + // Set the legacyOptions array to the names of the properties the "options" + // attribute defines. + et2_widget.legacyOptions = []; return et2_widget; }(et2_core_inheritance_1.ClassWithAttributes)); exports.et2_widget = et2_widget; diff --git a/api/js/etemplate/et2_core_widget.ts b/api/js/etemplate/et2_core_widget.ts index 3672b416ed..4d8e0ee077 100644 --- a/api/js/etemplate/et2_core_widget.ts +++ b/api/js/etemplate/et2_core_widget.ts @@ -16,7 +16,7 @@ et2_core_arrayMgr; */ -import { ClassWithAttributes } from './et2_core_inheritance'; +import {ClassWithAttributes} from './et2_core_inheritance'; /** * The registry contains all XML tag names and the corresponding widget @@ -176,7 +176,7 @@ export class et2_widget extends ClassWithAttributes // Set the legacyOptions array to the names of the properties the "options" // attribute defines. - legacyOptions: string[] = []; + public static readonly legacyOptions: string[] = []; private _type: string; id: string; diff --git a/api/js/etemplate/et2_dataview.js b/api/js/etemplate/et2_dataview.js index 50d1be8299..3c5ee56009 100644 --- a/api/js/etemplate/et2_dataview.js +++ b/api/js/etemplate/et2_dataview.js @@ -382,10 +382,10 @@ var et2_dataview = /** @class */ (function () { // Create the collection of column ids var colIds = []; for (var i = 0; i < this.columns.length; i++) { - if (this.columns[i].visible) { - colIds[i] = this.columns[i].id; - } - } + if (this.columns[i].visible) { + colIds[i] = this.columns[i].id; + } + } // Create the row provider if (this.rowProvider) { this.rowProvider.destroy(); diff --git a/api/js/etemplate/et2_dataview_view_rowProvider.js b/api/js/etemplate/et2_dataview_view_rowProvider.js index 166f60fb70..c8eadb189c 100644 --- a/api/js/etemplate/et2_dataview_view_rowProvider.js +++ b/api/js/etemplate/et2_dataview_view_rowProvider.js @@ -85,22 +85,22 @@ var et2_dataview_rowProvider = /** @class */ (function () { this._prototypes["fullRow"] = tr; }; et2_dataview_rowProvider.prototype._createDefaultPrototype = function () { - var tr = jQuery(document.createElement("tr")); - // Append a td for each column - for (var _i = 0, _a = this._columnIds; _i < _a.length; _i++) { - var column = _a[_i]; - if (!column) - continue; - var td = jQuery(document.createElement("td")) - .addClass(this._outerId + "_td_" + column) - .appendTo(tr); - var div = jQuery(document.createElement("div")) - .addClass(this._outerId + "_div_" + column) - .addClass("innerContainer") - .appendTo(td); - } - this._prototypes["default"] = tr; - }; + var tr = jQuery(document.createElement("tr")); + // Append a td for each column + for (var _i = 0, _a = this._columnIds; _i < _a.length; _i++) { + var column = _a[_i]; + if (!column) + continue; + var td = jQuery(document.createElement("td")) + .addClass(this._outerId + "_td_" + column) + .appendTo(tr); + var div = jQuery(document.createElement("div")) + .addClass(this._outerId + "_div_" + column) + .addClass("innerContainer") + .appendTo(td); + } + this._prototypes["default"] = tr; + }; et2_dataview_rowProvider.prototype._createEmptyPrototype = function () { this._prototypes["empty"] = jQuery(document.createElement("tr")); }; diff --git a/api/js/etemplate/et2_extension_customfields.js b/api/js/etemplate/et2_extension_customfields.js index 603d3c24d1..ab21fd1a1f 100644 --- a/api/js/etemplate/et2_extension_customfields.js +++ b/api/js/etemplate/et2_extension_customfields.js @@ -38,7 +38,6 @@ var et2_customfields_list = /** @class */ (function (_super) { __extends(et2_customfields_list, _super); function et2_customfields_list(_parent, _attrs, _child) { var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_customfields_list._attributes, _child || {})) || this; - _this.legacyOptions = ["type_filter", "private", "fields"]; // Field restriction & private done server-side _this.rows = {}; _this.widgets = {}; _this.detachedNodes = []; @@ -602,6 +601,7 @@ var et2_customfields_list = /** @class */ (function (_super) { "description": "JS code which is executed when the value changes." } }; + et2_customfields_list.legacyOptions = ["type_filter", "private", "fields"]; // Field restriction & private done server-side et2_customfields_list.PREFIX = '#'; et2_customfields_list.DEFAULT_ID = "custom_fields"; return et2_customfields_list; diff --git a/api/js/etemplate/et2_extension_customfields.ts b/api/js/etemplate/et2_extension_customfields.ts index e7ca1f0d55..8cd2474903 100644 --- a/api/js/etemplate/et2_extension_customfields.ts +++ b/api/js/etemplate/et2_extension_customfields.ts @@ -64,7 +64,7 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac } }; - legacyOptions = ["type_filter","private", "fields"]; // Field restriction & private done server-side + public static readonly legacyOptions = ["type_filter","private", "fields"]; // Field restriction & private done server-side public static readonly PREFIX = '#'; diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index f67b3d237e..1f01b1c4aa 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -3652,7 +3652,7 @@ export class et2_nextmatch_sortheader extends et2_nextmatch_header implements et "translate": false } }; - legacyOptions: ['sortmode']; + public static readonly legacyOptions: ['sortmode']; private sortmode: string; /** @@ -4022,7 +4022,7 @@ class et2_nextmatch_customfilter extends et2_nextmatch_filterheader "default": {} } }; - legacyOptions: ["widget_type","widget_options"]; + public static readonly legacyOptions: ["widget_type","widget_options"]; real_node: et2_selectbox; diff --git a/api/js/etemplate/et2_extension_nextmatch_rowProvider.js b/api/js/etemplate/et2_extension_nextmatch_rowProvider.js index 9e089dae0a..3ba0f14911 100644 --- a/api/js/etemplate/et2_extension_nextmatch_rowProvider.js +++ b/api/js/etemplate/et2_extension_nextmatch_rowProvider.js @@ -218,55 +218,55 @@ var et2_nextmatch_rowProvider = /** @class */ (function () { * @param {et2_widget} _widget */ et2_nextmatch_rowProvider.prototype._getVariableAttributeSet = function (_widget) { - var variableAttributes = []; - var process = function (_widget) { - // Create the attribtues - var hasAttr = false; - var widgetData = { - "widget": _widget, - "data": [] - }; - // Get all attribute values - for (var key in _widget.attributes) { - if (!_widget.attributes[key].ignore && - typeof _widget.options[key] != "undefined") { - var val = _widget.options[key]; - // TODO: Improve detection - if (typeof val == "string" && val.indexOf("$") >= 0) { - hasAttr = true; - widgetData.data.push({ - "attribute": key, - "expression": val - }); - } - } - } - // Add the entry if there is any data in it - if (hasAttr) { - variableAttributes.push(widgetData); - } - }; - // Check each column - var columns = _widget._widgets; - for (var i = 0; i < columns.length; i++) { - // If column is hidden, don't process it - if (typeof columns[i] === 'undefined' || this._context && this._context.columns && this._context.columns[i] && !this._context.columns[i].visible) { - continue; - } - columns[i].iterateOver(process, this); - } - return variableAttributes; - }; - et2_nextmatch_rowProvider.prototype._seperateWidgets = function (_varAttrs) { - // The detachable array contains all widgets which implement the - // et2_IDetachedDOM interface for all needed attributes - var detachable = []; - // The remaining array creates all widgets which have to be completely - // cloned when the widget tree is created - var remaining = []; - // Iterate over the widgets - for (var i = 0; i < _varAttrs.length; i++) { - var widget = _varAttrs[i].widget; + var variableAttributes = []; + var process = function (_widget) { + // Create the attribtues + var hasAttr = false; + var widgetData = { + "widget": _widget, + "data": [] + }; + // Get all attribute values + for (var key in _widget.attributes) { + if (!_widget.attributes[key].ignore && + typeof _widget.options[key] != "undefined") { + var val = _widget.options[key]; + // TODO: Improve detection + if (typeof val == "string" && val.indexOf("$") >= 0) { + hasAttr = true; + widgetData.data.push({ + "attribute": key, + "expression": val + }); + } + } + } + // Add the entry if there is any data in it + if (hasAttr) { + variableAttributes.push(widgetData); + } + }; + // Check each column + var columns = _widget._widgets; + for (var i = 0; i < columns.length; i++) { + // If column is hidden, don't process it + if (typeof columns[i] === 'undefined' || this._context && this._context.columns && this._context.columns[i] && !this._context.columns[i].visible) { + continue; + } + columns[i].iterateOver(process, this); + } + return variableAttributes; + }; + et2_nextmatch_rowProvider.prototype._seperateWidgets = function (_varAttrs) { + // The detachable array contains all widgets which implement the + // et2_IDetachedDOM interface for all needed attributes + var detachable = []; + // The remaining array creates all widgets which have to be completely + // cloned when the widget tree is created + var remaining = []; + // Iterate over the widgets + for (var i = 0; i < _varAttrs.length; i++) { + var widget = _varAttrs[i].widget; // Check whether the widget parents are not allready in the "remaining" // slot - if this is the case do not include the widget at all. var insertWidget = true; @@ -476,22 +476,22 @@ var et2_nextmatch_rowWidget = /** @class */ (function (_super) { * @param {array} _widgets */ et2_nextmatch_rowWidget.prototype.createWidgets = function (_widgets) { - // Clone the given the widgets with this element as parent - this._widgets = []; - var row_id = 0; - for (var i = 0; i < _widgets.length; i++) { - // Disabled columns might be missing widget - skip it - if (!_widgets[i]) - continue; - this._widgets[i] = _widgets[i].clone(this); - this._widgets[i].loadingFinished(); - // Set column alignment from widget - if (this._widgets[i].align) { - this._row.childNodes[row_id].align = this._widgets[i].align; - } - row_id++; - } - }; + // Clone the given the widgets with this element as parent + this._widgets = []; + var row_id = 0; + for (var i = 0; i < _widgets.length; i++) { + // Disabled columns might be missing widget - skip it + if (!_widgets[i]) + continue; + this._widgets[i] = _widgets[i].clone(this); + this._widgets[i].loadingFinished(); + // Set column alignment from widget + if (this._widgets[i].align) { + this._row.childNodes[row_id].align = this._widgets[i].align; + } + row_id++; + } + }; /** * Returns the column node for the given sender * @@ -499,16 +499,16 @@ var et2_nextmatch_rowWidget = /** @class */ (function (_super) { * @return {DOMElement} */ et2_nextmatch_rowWidget.prototype.getDOMNode = function (_sender) { - var row_id = 0; + var row_id = 0; for (var i = 0; i < this._widgets.length; i++) { - // Disabled columns might be missing widget - skip it - if (!this._widgets[i]) - continue; - if (this._widgets[i] == _sender) { - return this._row.childNodes[row_id].childNodes[0]; // Return the i-th td tag - } - row_id++; - } + // Disabled columns might be missing widget - skip it + if (!this._widgets[i]) + continue; + if (this._widgets[i] == _sender) { + return this._row.childNodes[row_id].childNodes[0]; // Return the i-th td tag + } + row_id++; + } return null; }; return et2_nextmatch_rowWidget; diff --git a/api/js/etemplate/et2_widget_button.js b/api/js/etemplate/et2_widget_button.js index 13fe2a5808..eed29269e0 100644 --- a/api/js/etemplate/et2_widget_button.js +++ b/api/js/etemplate/et2_widget_button.js @@ -44,7 +44,6 @@ var et2_button = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_button._attributes, _child || {})) || this; - _this.legacyOptions = ["image", "ro_image"]; _this.label = ""; _this.clicked = false; _this.btn = null; @@ -357,6 +356,7 @@ var et2_button = /** @class */ (function (_super) { "ignore": true } }; + et2_button.legacyOptions = ["image", "ro_image"]; /** * images to be used as background-image, if none is explicitly applied and id matches given regular expression */ diff --git a/api/js/etemplate/et2_widget_button.ts b/api/js/etemplate/et2_widget_button.ts index ca87766c94..a3484c2bad 100644 --- a/api/js/etemplate/et2_widget_button.ts +++ b/api/js/etemplate/et2_widget_button.ts @@ -76,7 +76,7 @@ export class et2_button extends et2_baseWidget implements et2_IInput, et2_IDetac } }; - legacyOptions: string[] = ["image", "ro_image"]; + public static readonly legacyOptions: string[] = ["image", "ro_image"]; /** * images to be used as background-image, if none is explicitly applied and id matches given regular expression diff --git a/api/js/etemplate/et2_widget_checkbox.js b/api/js/etemplate/et2_widget_checkbox.js index a4cc2f0f42..6fc8e5b3ed 100644 --- a/api/js/etemplate/et2_widget_checkbox.js +++ b/api/js/etemplate/et2_widget_checkbox.js @@ -48,7 +48,6 @@ var et2_checkbox = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_checkbox._attributes, _child || {})) || this; - _this.legacyOptions = ["selected_value", "unselected_value", "ro_true", "ro_false"]; _this.input = null; _this.toggle = null; _this.input = null; @@ -189,6 +188,7 @@ var et2_checkbox = /** @class */ (function (_super) { "translate": true } }; + et2_checkbox.legacyOptions = ["selected_value", "unselected_value", "ro_true", "ro_false"]; return et2_checkbox; }(et2_core_inputWidget_1.et2_inputWidget)); et2_core_widget_1.et2_register_widget(et2_checkbox, ["checkbox"]); diff --git a/api/js/etemplate/et2_widget_checkbox.ts b/api/js/etemplate/et2_widget_checkbox.ts index 2b330e8e82..a490dcec71 100644 --- a/api/js/etemplate/et2_widget_checkbox.ts +++ b/api/js/etemplate/et2_widget_checkbox.ts @@ -72,7 +72,7 @@ class et2_checkbox extends et2_inputWidget } }; - legacyOptions : string[] = ["selected_value", "unselected_value", "ro_true", "ro_false"]; + public static readonly legacyOptions : string[] = ["selected_value", "unselected_value", "ro_true", "ro_false"]; input : JQuery = null; toggle : JQuery = null; value : string | boolean; diff --git a/api/js/etemplate/et2_widget_date.js b/api/js/etemplate/et2_widget_date.js index f60caf6528..9ed30510c5 100644 --- a/api/js/etemplate/et2_widget_date.js +++ b/api/js/etemplate/et2_widget_date.js @@ -57,7 +57,6 @@ var et2_date = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date._attributes, _child || {})) || this; - _this.legacyOptions = ["data_format"]; _this.input_date = null; _this.is_mobile = false; _this.date = new Date(); @@ -571,6 +570,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates "description": "Instead of an input field with a popup calendar, the calendar is displayed inline, with no input field" } }; + et2_date.legacyOptions = ["data_format"]; return et2_date; }(et2_core_inputWidget_1.et2_inputWidget)); exports.et2_date = et2_date; @@ -587,7 +587,6 @@ var et2_date_duration = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date_duration._attributes, _child || {})) || this; - _this.legacyOptions = ["data_format", "display_format", "hours_per_day", "empty_not_0", "short_labels"]; _this.format = null; // Legacy option put percent in with display format if (_this.options.display_format.indexOf("%") != -1) { @@ -840,6 +839,7 @@ var et2_date_duration = /** @class */ (function (_super) { "description": "Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set." } }; + et2_date_duration.legacyOptions = ["data_format", "display_format", "hours_per_day", "empty_not_0", "short_labels"]; return et2_date_duration; }(et2_date)); exports.et2_date_duration = et2_date_duration; diff --git a/api/js/etemplate/et2_widget_date.ts b/api/js/etemplate/et2_widget_date.ts index 85d93ae0bc..84492e8bf1 100644 --- a/api/js/etemplate/et2_widget_date.ts +++ b/api/js/etemplate/et2_widget_date.ts @@ -93,7 +93,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates } }; - legacyOptions: string[] = ["data_format"]; + public static readonly legacyOptions: string[] = ["data_format"]; date: Date; span: JQuery; input_date: JQuery = null; @@ -703,7 +703,7 @@ export class et2_date_duration extends et2_date } }; - legacyOptions: string[] = ["data_format","display_format", "hours_per_day", "empty_not_0", "short_labels"]; + public static readonly legacyOptions: string[] = ["data_format","display_format", "hours_per_day", "empty_not_0", "short_labels"]; time_formats: {"d":"d","h":"h","m":"m"}; @@ -1085,7 +1085,7 @@ export class et2_date_ro extends et2_valueWidget implements et2_IDetachedDOM year_range: {ignore: true} }; - legacyOptions: ["data_format"]; + public static readonly legacyOptions: ["data_format"]; /** * Internal container for working easily with dates diff --git a/api/js/etemplate/et2_widget_description.js b/api/js/etemplate/et2_widget_description.js index c90be913d9..8dcb13499c 100644 --- a/api/js/etemplate/et2_widget_description.js +++ b/api/js/etemplate/et2_widget_description.js @@ -51,8 +51,6 @@ var et2_description = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_description._attributes, _child || {})) || this; - _this.legacyOptions = ["font_style", "href", "activate_links", "for", - "extra_link_target", "extra_link_popup", "statustext"]; _this._labelContainer = null; // Create the span/label tag which contains the label text _this.span = jQuery(document.createElement(_this.options["for"] ? "label" : "span")) @@ -359,6 +357,8 @@ var et2_description = /** @class */ (function (_super) { "description": "Text to show as tooltip of defined action" } }, + _a.legacyOptions = ["font_style", "href", "activate_links", "for", + "extra_link_target", "extra_link_popup", "statustext"], _a)))); exports.et2_description = et2_description; ; diff --git a/api/js/etemplate/et2_widget_description.ts b/api/js/etemplate/et2_widget_description.ts index c3cd63a0b3..6377986721 100644 --- a/api/js/etemplate/et2_widget_description.ts +++ b/api/js/etemplate/et2_widget_description.ts @@ -111,7 +111,7 @@ export class et2_description extends expose(class et2_description extends et2_ba }; - legacyOptions: string[] = ["font_style", "href", "activate_links", "for", + public static readonly legacyOptions: string[] = ["font_style", "href", "activate_links", "for", "extra_link_target", "extra_link_popup", "statustext"]; span: JQuery; diff --git a/api/js/etemplate/et2_widget_entry.js b/api/js/etemplate/et2_widget_entry.js index 095999402d..a8bb498c95 100644 --- a/api/js/etemplate/et2_widget_entry.js +++ b/api/js/etemplate/et2_widget_entry.js @@ -47,7 +47,6 @@ var et2_entry = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_entry._attributes, _child || {})) || this; - _this.legacyOptions = ["field", "compare", "alternate_fields"]; _this.widget = null; // Often the ID conflicts, so check prefix if (_attrs.id && _attrs.id.indexOf(et2_entry.prefix) < 0) { @@ -163,6 +162,7 @@ var et2_entry = /** @class */ (function (_super) { default: true } }; + et2_entry.legacyOptions = ["field", "compare", "alternate_fields"]; return et2_entry; }(et2_core_valueWidget_1.et2_valueWidget)); et2_core_widget_1.et2_register_widget(et2_entry, ["entry", 'contact-value', 'contact-account', 'contact-template', 'infolog-value', 'tracker-value', 'records-value']); diff --git a/api/js/etemplate/et2_widget_entry.ts b/api/js/etemplate/et2_widget_entry.ts index 6b8cec7c5b..4883e889a2 100644 --- a/api/js/etemplate/et2_widget_entry.ts +++ b/api/js/etemplate/et2_widget_entry.ts @@ -76,7 +76,7 @@ class et2_entry extends et2_valueWidget } }; - legacyOptions : string[] = ["field","compare","alternate_fields"]; + public static readonly legacyOptions : string[] = ["field","compare","alternate_fields"]; static readonly prefix: '~'; protected widget = null; diff --git a/api/js/etemplate/et2_widget_historylog.js b/api/js/etemplate/et2_widget_historylog.js index b96f98c6e5..7f039f3157 100644 --- a/api/js/etemplate/et2_widget_historylog.js +++ b/api/js/etemplate/et2_widget_historylog.js @@ -49,7 +49,6 @@ var et2_historylog = /** @class */ (function (_super) { */ function et2_historylog(_parent, _attrs, _child) { var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_historylog._attributes, _child || {})) || this; - _this.legacyOptions = ["status_id"]; _this.div = jQuery(document.createElement("div")) .addClass("et2_historylog"); _this.innerDiv = jQuery(document.createElement("div")) @@ -574,6 +573,7 @@ var et2_historylog = /** @class */ (function (_super) { "description": "Method to get rows" } }; + et2_historylog.legacyOptions = ["status_id"]; et2_historylog.columns = [ { 'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time', widget: null, nodes: null }, { 'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account', widget: null, nodes: null }, diff --git a/api/js/etemplate/et2_widget_historylog.ts b/api/js/etemplate/et2_widget_historylog.ts index dd49497834..08fd01f9cb 100644 --- a/api/js/etemplate/et2_widget_historylog.ts +++ b/api/js/etemplate/et2_widget_historylog.ts @@ -65,7 +65,7 @@ export class et2_historylog extends et2_valueWidget implements et2_IDataProvider } }; - legacyOptions = ["status_id"]; + public static readonly legacyOptions = ["status_id"]; protected static columns = [ {'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time', widget: null, nodes: null}, {'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account', widget: null, nodes: null}, diff --git a/api/js/etemplate/et2_widget_image.js b/api/js/etemplate/et2_widget_image.js index 8dbf4bd513..247ae52031 100644 --- a/api/js/etemplate/et2_widget_image.js +++ b/api/js/etemplate/et2_widget_image.js @@ -48,7 +48,6 @@ var et2_image = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_image._attributes, _child || {})) || this; - _this.legacyOptions = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; _this.image = null; // Create the image or a/image tag _this.image = jQuery(document.createElement("img")); @@ -249,6 +248,7 @@ var et2_image = /** @class */ (function (_super) { description: "Clicking on an image with href value would popup an expose view, and will show image referenced by href." } }; + et2_image.legacyOptions = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; return et2_image; }(et2_core_baseWidget_1.et2_baseWidget)); et2_core_widget_1.et2_register_widget(et2_image, ["image"]); diff --git a/api/js/etemplate/et2_widget_image.ts b/api/js/etemplate/et2_widget_image.ts index 7576538aae..38fc83a81b 100644 --- a/api/js/etemplate/et2_widget_image.ts +++ b/api/js/etemplate/et2_widget_image.ts @@ -19,7 +19,7 @@ */ import {et2_baseWidget} from './et2_core_baseWidget'; -import {WidgetConfig, et2_register_widget} from "./et2_core_widget"; +import {et2_register_widget, WidgetConfig} from "./et2_core_widget"; import {ClassWithAttributes} from "./et2_core_inheritance"; /** @@ -75,7 +75,7 @@ class et2_image extends et2_baseWidget implements et2_IDetachedDOM } }; - legacyOptions : string[] = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; + public static readonly legacyOptions : string[] = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; image : JQuery = null; diff --git a/api/js/etemplate/et2_widget_itempicker.js b/api/js/etemplate/et2_widget_itempicker.js index 17be9d3cd5..9aaf39dee9 100755 --- a/api/js/etemplate/et2_widget_itempicker.js +++ b/api/js/etemplate/et2_widget_itempicker.js @@ -52,7 +52,6 @@ var et2_itempicker = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_itempicker._attributes, _child || {})) || this; - _this.legacyOptions = ["application"]; _this.last_search = ""; // Remember last search value _this.action = null; // Action function for button _this.current_app = ""; // Remember currently chosen application @@ -347,6 +346,7 @@ var et2_itempicker = /** @class */ (function (_super) { "description": "Callback before query to server. Must return true, or false to abort query." } }; + et2_itempicker.legacyOptions = ["application"]; return et2_itempicker; }(et2_core_inputWidget_1.et2_inputWidget)); et2_core_widget_1.et2_register_widget(et2_itempicker, ["itempicker"]); diff --git a/api/js/etemplate/et2_widget_itempicker.ts b/api/js/etemplate/et2_widget_itempicker.ts index d6d6340686..1ec422a2e7 100644 --- a/api/js/etemplate/et2_widget_itempicker.ts +++ b/api/js/etemplate/et2_widget_itempicker.ts @@ -70,7 +70,7 @@ class et2_itempicker extends et2_inputWidget } }; - legacyOptions : string[] = ["application"]; + public static readonly legacyOptions : string[] = ["application"]; private last_search : string = ""; // Remember last search value private action : egwFnct = null; // Action function for button private current_app : string = ""; // Remember currently chosen application diff --git a/api/js/etemplate/et2_widget_link.js b/api/js/etemplate/et2_widget_link.js index 42a35d7606..d0d2eb6f39 100644 --- a/api/js/etemplate/et2_widget_link.js +++ b/api/js/etemplate/et2_widget_link.js @@ -1052,7 +1052,6 @@ var et2_link = /** @class */ (function (_super) { */ function et2_link(_parent, _attrs, _child) { var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_link._attributes, _child || {})) || this; - _this.legacyOptions = ["only_app"]; _this.label_span = jQuery(document.createElement("label")) .addClass("et2_label"); _this.link = jQuery(document.createElement("span")) @@ -1221,6 +1220,7 @@ var et2_link = /** @class */ (function (_super) { "description": "Optional parameter to be passed to egw().open in order to open links in specified target eg. _blank" } }; + et2_link.legacyOptions = ["only_app"]; return et2_link; }(et2_core_valueWidget_1.et2_valueWidget)); exports.et2_link = et2_link; diff --git a/api/js/etemplate/et2_widget_link.ts b/api/js/etemplate/et2_widget_link.ts index 8c6054458f..91c502d7c4 100644 --- a/api/js/etemplate/et2_widget_link.ts +++ b/api/js/etemplate/et2_widget_link.ts @@ -9,25 +9,25 @@ * @copyright 2011 Nathan Gray */ - /*egw:uses - /vendor/bower-asset/jquery/dist/jquery.js; - /vendor/bower-asset/jquery-ui/jquery-ui.js; - et2_core_inputWidget; - et2_core_valueWidget; +/*egw:uses + /vendor/bower-asset/jquery/dist/jquery.js; + /vendor/bower-asset/jquery-ui/jquery-ui.js; + et2_core_inputWidget; + et2_core_valueWidget; - // Include menu system for list context menu - egw_action.egw_menu_dhtmlx; - */ + // Include menu system for list context menu + egw_action.egw_menu_dhtmlx; +*/ - import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget"; - import {ClassWithAttributes} from "./et2_core_inheritance"; - import {et2_valueWidget} from "./et2_core_valueWidget"; - import {et2_inputWidget} from "./et2_core_inputWidget"; - import {et2_selectbox} from "./et2_widget_selectbox"; - import {et2_button} from "./et2_widget_button"; - import {et2_vfs_select} from "./et2_widget_vfs"; +import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget"; +import {ClassWithAttributes} from "./et2_core_inheritance"; +import {et2_valueWidget} from "./et2_core_valueWidget"; +import {et2_inputWidget} from "./et2_core_inputWidget"; +import {et2_selectbox} from "./et2_widget_selectbox"; +import {et2_button} from "./et2_widget_button"; +import {et2_vfs_select} from "./et2_widget_vfs"; - /** +/** * UI widgets for Egroupware linking system */ export class et2_link_to extends et2_inputWidget @@ -1317,7 +1317,7 @@ export class et2_link extends et2_valueWidget implements et2_IDetachedDOM "description": "Optional parameter to be passed to egw().open in order to open links in specified target eg. _blank" } }; - legacyOptions = ["only_app"]; + public static readonly legacyOptions = ["only_app"]; private label_span: JQuery; private link: JQuery; diff --git a/api/js/etemplate/et2_widget_progress.js b/api/js/etemplate/et2_widget_progress.js index 4e836f5aed..1381d24675 100644 --- a/api/js/etemplate/et2_widget_progress.js +++ b/api/js/etemplate/et2_widget_progress.js @@ -46,7 +46,6 @@ var et2_progress = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_progress._attributes, _child || {})) || this; - _this.legacyOptions = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; _this.progress = null; var outer = document.createElement("div"); outer.className = "et2_progress"; @@ -165,6 +164,7 @@ var et2_progress = /** @class */ (function (_super) { "translate": true } }; + et2_progress.legacyOptions = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; return et2_progress; }(et2_core_valueWidget_1.et2_valueWidget)); et2_core_widget_1.et2_register_widget(et2_progress, ["progress"]); diff --git a/api/js/etemplate/et2_widget_progress.ts b/api/js/etemplate/et2_widget_progress.ts index b9b0e1f4e7..fdf7f529f8 100644 --- a/api/js/etemplate/et2_widget_progress.ts +++ b/api/js/etemplate/et2_widget_progress.ts @@ -51,7 +51,7 @@ class et2_progress extends et2_valueWidget implements et2_IDetachedDOM } }; - legacyOptions : string[] = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; + public static readonly legacyOptions : string[] = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"]; private progress : HTMLElement = null; /** diff --git a/api/js/etemplate/et2_widget_radiobox.js b/api/js/etemplate/et2_widget_radiobox.js index 72079a5401..eff7ad8a63 100644 --- a/api/js/etemplate/et2_widget_radiobox.js +++ b/api/js/etemplate/et2_widget_radiobox.js @@ -50,7 +50,6 @@ var et2_radiobox = /** @class */ (function (_super) { */ function et2_radiobox(_parent, _attrs, _child) { var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_radiobox._attributes, _child || {})) || this; - _this.legacyOptions = ["set_value", "ro_true", "ro_false"]; _this.input = null; _this.id = ""; _this.createInputWidget(); @@ -159,6 +158,7 @@ var et2_radiobox = /** @class */ (function (_super) { "description": "What should be displayed when readonly and not selected" } }; + et2_radiobox.legacyOptions = ["set_value", "ro_true", "ro_false"]; return et2_radiobox; }(et2_core_inputWidget_1.et2_inputWidget)); et2_core_widget_1.et2_register_widget(et2_radiobox, ["radio"]); @@ -176,7 +176,6 @@ var et2_radiobox_ro = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_radiobox_ro._attributes, _child || {})) || this; - _this.legacyOptions = ["set_value", "ro_true", "ro_false"]; _this.value = ""; _this.span = null; _this.span = jQuery(document.createElement("span")) @@ -243,6 +242,7 @@ var et2_radiobox_ro = /** @class */ (function (_super) { "type": "string" } }; + et2_radiobox_ro.legacyOptions = ["set_value", "ro_true", "ro_false"]; return et2_radiobox_ro; }(et2_core_valueWidget_1.et2_valueWidget)); et2_core_widget_1.et2_register_widget(et2_radiobox_ro, ["radio_ro"]); diff --git a/api/js/etemplate/et2_widget_radiobox.ts b/api/js/etemplate/et2_widget_radiobox.ts index 9a805240ab..73fdd5e679 100644 --- a/api/js/etemplate/et2_widget_radiobox.ts +++ b/api/js/etemplate/et2_widget_radiobox.ts @@ -16,8 +16,9 @@ */ import {et2_inputWidget} from "./et2_core_inputWidget"; import {ClassWithAttributes} from "./et2_core_inheritance"; -import {WidgetConfig, et2_register_widget} from "./et2_core_widget"; +import {et2_register_widget, WidgetConfig} from "./et2_core_widget"; import {et2_valueWidget} from './et2_core_valueWidget'; + /** * Class which implements the "radiobox" XET-Tag * @@ -50,7 +51,7 @@ class et2_radiobox extends et2_inputWidget } }; - legacyOptions : string[] = ["set_value", "ro_true", "ro_false"]; + public static readonly legacyOptions : string[] = ["set_value", "ro_true", "ro_false"]; input : JQuery = null; id : string = ""; @@ -204,7 +205,7 @@ class et2_radiobox_ro extends et2_valueWidget implements et2_IDetachedDOM } }; - legacyOptions : string[] = ["set_value", "ro_true", "ro_false"]; + public static readonly legacyOptions : string[] = ["set_value", "ro_true", "ro_false"]; value : string = ""; span : JQuery = null; diff --git a/api/js/etemplate/et2_widget_selectAccount.js b/api/js/etemplate/et2_widget_selectAccount.js index cd1f1f092a..d3b01f8607 100644 --- a/api/js/etemplate/et2_widget_selectAccount.js +++ b/api/js/etemplate/et2_widget_selectAccount.js @@ -626,7 +626,6 @@ var et2_selectAccount_ro = /** @class */ (function (_super) { */ function et2_selectAccount_ro(_parent, _attrs, _child) { var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_selectAccount_ro._attributes, _child || {})) || this; - _this.legacyOptions = ["empty_label"]; /** Resolve some circular dependency problems here selectAccount extends link, link is in a file that needs select, @@ -720,6 +719,7 @@ var et2_selectAccount_ro = /** @class */ (function (_super) { translate: true } }; + et2_selectAccount_ro.legacyOptions = ["empty_label"]; return et2_selectAccount_ro; }(et2_widget_link_2.et2_link_string)); exports.et2_selectAccount_ro = et2_selectAccount_ro; diff --git a/api/js/etemplate/et2_widget_selectAccount.ts b/api/js/etemplate/et2_widget_selectAccount.ts index 1c8e1409be..9079a6a92d 100644 --- a/api/js/etemplate/et2_widget_selectAccount.ts +++ b/api/js/etemplate/et2_widget_selectAccount.ts @@ -18,11 +18,10 @@ */ import {et2_selectbox} from "./et2_widget_selectbox"; -import {et2_register_widget, WidgetConfig, et2_widget} from "./et2_core_widget"; +import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget"; import {ClassWithAttributes} from "./et2_core_inheritance"; -import {et2_link_entry} from "./et2_widget_link"; +import {et2_link_entry, et2_link_string} from "./et2_widget_link"; import {et2_dialog} from "./et2_widget_dialog"; -import {et2_link_string} from "./et2_widget_link"; /** * Account selection widget @@ -767,7 +766,7 @@ export class et2_selectAccount_ro extends et2_link_string } }; - legacyOptions : string[] = ["empty_label"]; + public static readonly legacyOptions : string[] = ["empty_label"]; /** * Constructor diff --git a/api/js/etemplate/et2_widget_selectbox.js b/api/js/etemplate/et2_widget_selectbox.js index f35684d00b..723c28d0ec 100644 --- a/api/js/etemplate/et2_widget_selectbox.js +++ b/api/js/etemplate/et2_widget_selectbox.js @@ -50,7 +50,6 @@ var et2_selectbox = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_selectbox._attributes, _child || {})) || this; - _this.legacyOptions = ["rows", "other"]; // Other is sub-type specific _this.input = null; _this.value = ''; _this.selected_first = true; @@ -1243,6 +1242,7 @@ var et2_selectbox = /** @class */ (function (_super) { description: "Allow to set a custom css class combined with selected value. (e.g. cat_23)" } }; + et2_selectbox.legacyOptions = ["rows", "other"]; // Other is sub-type specific et2_selectbox.type_cache = {}; return et2_selectbox; }(et2_core_inputWidget_1.et2_inputWidget)); diff --git a/api/js/etemplate/et2_widget_selectbox.ts b/api/js/etemplate/et2_widget_selectbox.ts index ad8047e800..59d6cc844d 100644 --- a/api/js/etemplate/et2_widget_selectbox.ts +++ b/api/js/etemplate/et2_widget_selectbox.ts @@ -112,7 +112,7 @@ export class et2_selectbox extends et2_inputWidget } }; - legacyOptions: string[] = ["rows","other"]; // Other is sub-type specific + public static readonly legacyOptions: string[] = ["rows","other"]; // Other is sub-type specific input: JQuery = null; value: string | string[] = ''; expand_button: JQuery; diff --git a/api/js/etemplate/et2_widget_split.js b/api/js/etemplate/et2_widget_split.js index 6a18468590..c8af89b0a8 100644 --- a/api/js/etemplate/et2_widget_split.js +++ b/api/js/etemplate/et2_widget_split.js @@ -71,7 +71,7 @@ var et2_split = /** @class */ (function (_super) { this.div.trigger("destroy"); // Destroy dynamic full-height this.dynheight.destroy(); - _super.prototype.destroy.call(this); + _super.prototype.destroy.call(this); // Remove placeholder children if (this._children.length == 0) { this.div.empty(); diff --git a/api/js/etemplate/et2_widget_textbox.js b/api/js/etemplate/et2_widget_textbox.js index e1f43d0f30..fe648a2e1b 100644 --- a/api/js/etemplate/et2_widget_textbox.js +++ b/api/js/etemplate/et2_widget_textbox.js @@ -47,7 +47,6 @@ var et2_textbox = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_textbox._attributes, _child || {})) || this; - _this.legacyOptions = ["size", "maxlength", "validator"]; _this.input = null; _this.input = null; _this.createInputWidget(); @@ -283,6 +282,7 @@ var et2_textbox = /** @class */ (function (_super) { description: "JS code or app.$app.$method called when key is pressed, return false cancels it." } }; + et2_textbox.legacyOptions = ["size", "maxlength", "validator"]; return et2_textbox; }(et2_core_inputWidget_1.et2_inputWidget)); exports.et2_textbox = et2_textbox; diff --git a/api/js/etemplate/et2_widget_textbox.ts b/api/js/etemplate/et2_widget_textbox.ts index 0ec1b1fe68..14710a4e65 100644 --- a/api/js/etemplate/et2_widget_textbox.ts +++ b/api/js/etemplate/et2_widget_textbox.ts @@ -15,12 +15,11 @@ */ import './et2_core_common'; -import { ClassWithAttributes } from "./et2_core_inheritance"; -import { et2_widget, et2_createWidget, et2_register_widget, WidgetConfig } from "./et2_core_widget"; -import { et2_DOMWidget } from './et2_core_DOMWidget' -import { et2_valueWidget } from './et2_core_valueWidget' -import { et2_inputWidget } from './et2_core_inputWidget' -import { et2_button } from './et2_widget_button' +import {ClassWithAttributes} from "./et2_core_inheritance"; +import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_widget"; +import {et2_valueWidget} from './et2_core_valueWidget' +import {et2_inputWidget} from './et2_core_inputWidget' +import {et2_button} from './et2_widget_button' import './et2_types'; /** @@ -88,7 +87,7 @@ export class et2_textbox extends et2_inputWidget implements et2_IResizeable } }; - legacyOptions: string[] = ["size", "maxlength", "validator"]; + public static readonly legacyOptions: string[] = ["size", "maxlength", "validator"]; input: JQuery = null; size: number; maxLength: number; diff --git a/api/js/etemplate/et2_widget_vfs.js b/api/js/etemplate/et2_widget_vfs.js index 3398a73149..3f1ad3f914 100644 --- a/api/js/etemplate/et2_widget_vfs.js +++ b/api/js/etemplate/et2_widget_vfs.js @@ -450,7 +450,6 @@ var et2_vfsMime = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsMime._attributes, _child || {})) || this; - _this.legacyOptions = ["size"]; _this.iconOverlayContainer = null; _this.image = null; _this.iconOverlayContainer = jQuery(document.createElement('span')).addClass('iconOverlayContainer'); @@ -618,6 +617,7 @@ var et2_vfsMime = /** @class */ (function (_super) { description: " Size of thumbnail in pixel for specified mime type with syntax of: mime_type(s),size (eg. image,video,128)" } }, + _a.legacyOptions = ["size"], _a)))); ; et2_core_widget_1.et2_register_widget(et2_vfsMime, ["vfs-mime"]); @@ -828,7 +828,6 @@ var et2_vfsUpload = /** @class */ (function (_super) { var _this = // Call the inherited constructor _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsUpload._attributes, _child || {})) || this; - _this.legacyOptions = ["mime"]; _this.asyncOptions = { target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload") }; @@ -989,6 +988,7 @@ var et2_vfsUpload = /** @class */ (function (_super) { "default": '' } }; + et2_vfsUpload.legacyOptions = ["mime"]; return et2_vfsUpload; }(et2_widget_file_1.et2_file)); et2_core_widget_1.et2_register_widget(et2_vfsUpload, ["vfs-upload"]); diff --git a/api/js/etemplate/et2_widget_vfs.ts b/api/js/etemplate/et2_widget_vfs.ts index 40c830d619..39fd125acc 100644 --- a/api/js/etemplate/et2_widget_vfs.ts +++ b/api/js/etemplate/et2_widget_vfs.ts @@ -518,7 +518,7 @@ class et2_vfsMime extends expose(class et2_vfsMime extends et2_valueWidget imple }; - legacyOptions : string[] = ["size"]; + public static readonly legacyOptions : string[] = ["size"]; iconOverlayContainer : JQuery = null; overlayContainer : JQuery; image : JQuery = null; @@ -932,7 +932,7 @@ class et2_vfsUpload extends et2_file } }; - legacyOptions : string[] = ["mime"]; + public static readonly legacyOptions : string[] = ["mime"]; asyncOptions : {target : any} = { target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload") diff --git a/api/templates/default/promptOpenedDialog.xet b/api/templates/default/promptOpenedDialog.xet index 6049b7011d..2875c73b50 100644 --- a/api/templates/default/promptOpenedDialog.xet +++ b/api/templates/default/promptOpenedDialog.xet @@ -11,7 +11,7 @@ - + diff --git a/api/templates/default/vfsSelectUI.xet b/api/templates/default/vfsSelectUI.xet index 909424d341..a1a57b3b31 100644 --- a/api/templates/default/vfsSelectUI.xet +++ b/api/templates/default/vfsSelectUI.xet @@ -33,16 +33,16 @@ - + - + - diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 119e5ed80e..08864b6b23 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -167,35 +167,35 @@ var et2_calendar_event = /** @class */ (function (_super) { * Callback for changes in cached data */ et2_calendar_event.prototype._UID_callback = function (event) { - // Copy to avoid changes, which may cause nm problems - var value = event === null ? null : jQuery.extend({}, event); - var parent = this.getParent(); - var parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner; - // Make sure id is a string, check values - if (value) { - this._values_check(value); - } - // Check for changing days in the grid view - if (!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent_owner)) { - // May need to update parent to remove out-of-view events - parent.removeChild(this); - if (event === null && parent && parent.instanceOf(et2_widget_daycol_1.et2_calendar_daycol)) { - parent._out_of_view(); - } - // This should now cease to exist, as new events have been created - this.destroy(); - return; - } - // Copy to avoid changes, which may cause nm problems - this.options.value = jQuery.extend({}, value); - if (this.getParent().options.date) { - this.options.value.date = this.getParent().options.date; - } - // Let parent position - could also be et2_calendar_planner_row - this.getParent().position_event(this); - // Parent may remove this if the date isn't the same - if (this.getParent()) { - this._update(); + // Copy to avoid changes, which may cause nm problems + var value = event === null ? null : jQuery.extend({}, event); + var parent = this.getParent(); + var parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner; + // Make sure id is a string, check values + if (value) { + this._values_check(value); + } + // Check for changing days in the grid view + if (!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent_owner)) { + // May need to update parent to remove out-of-view events + parent.removeChild(this); + if (event === null && parent && parent.instanceOf(et2_widget_daycol_1.et2_calendar_daycol)) { + parent._out_of_view(); + } + // This should now cease to exist, as new events have been created + this.destroy(); + return; + } + // Copy to avoid changes, which may cause nm problems + this.options.value = jQuery.extend({}, value); + if (this.getParent().options.date) { + this.options.value.date = this.getParent().options.date; + } + // Let parent position - could also be et2_calendar_planner_row + this.getParent().position_event(this); + // Parent may remove this if the date isn't the same + if (this.getParent()) { + this._update(); } }; /** @@ -653,127 +653,125 @@ var et2_calendar_event = /** @class */ (function (_super) { this._actionObject = null; } // Update daywise caches - var new_cache_id = CalendarApp._daywise_cache_id(event.date, this.getParent().options.owner); - var new_daywise = egw.dataGetUIDdata(new_cache_id); - new_daywise = new_daywise && new_daywise.data ? new_daywise.data : []; - var old_cache_id = ''; - if (this.options.value && this.options.value.date) { - old_cache_id = CalendarApp._daywise_cache_id(this.options.value.date, parent.options.owner); - } - if (new_cache_id != old_cache_id) { - var old_daywise = egw.dataGetUIDdata(old_cache_id); - old_daywise = old_daywise && old_daywise.data ? old_daywise.data : []; - old_daywise.splice(old_daywise.indexOf(this.options.value.row_id), 1); - egw.dataStoreUID(old_cache_id, old_daywise); - if (new_daywise.indexOf(event.row_id) < 0) { - new_daywise.push(event.row_id); - } - if (egw.dataHasUID(new_cache_id)) { - egw.dataStoreUID(new_cache_id, new_daywise); - } - } - return false; - }; - /** - * Check that the event passes the given status filter. - * Status filter is set in the sidebox and used when fetching several events, but if user changes their status - * for an event, it may no longer match and have to be removed. - * - * @param event - * @param filter - * @private - */ - et2_calendar_event.prototype._status_check = function (event, filter, owner) { - if (!owner || !event) { - return false; - } - // If we're doing a bunch, just one passing is enough - if (typeof owner !== "string") { - var pass = false; - for (var j = 0; j < owner.length && pass == false; j++) { - pass = pass || this._status_check(event, filter, owner[j]); - } - return pass; - } - // Show also events just owned by selected user - if (filter == 'owner') { - return owner == event.owner; - } - // Get the relevant participant - var participant = event.participants[owner]; - // If filter says don't look in groups, skip it all - if (!participant && filter === 'no-enum-groups') { - return false; - } - // Couldn't find the current owner in the participant list, check groups & resources - if (!participant) { - var options = null; - if (app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner')) { - options = app.calendar.sidebox_et2.getWidgetById('owner').taglist.getSelection(); - } - if ((isNaN(parseInt(owner)) || parseInt(owner) < 0) && options && typeof options.find == "function") { - var resource = options.find(function (element) { - return element.id == owner; - }) || {}; - if (resource && resource.resources) { - var matching_participant = resource.resources.filter(function (id) { - return typeof event.participants[id] != "undefined"; - }); - return this._status_check(event, filter, matching_participant); - } - } - } - var status = et2_calendar_event.split_status(participant); - switch (filter) { - default: - case 'all': - return true; - case 'default': // Show all status, but rejected - return status !== 'R'; - case 'accepted': //Show only accepted events - return status === 'A'; - case 'unknown': // Show only invitations, not yet accepted or rejected - return status === 'U'; - case 'tentative': // Show only tentative accepted events - return status === 'T'; - case 'delegated': // Show only delegated events - return status === 'D'; - case 'rejected': // Show only rejected events - return status === 'R'; - // Handled above - //case 'owner': // Show also events just owned by selected user - case 'hideprivate': // Show all events, as if they were private - // handled server-side - return true; - case 'showonlypublic': // Show only events flagged as public, -not checked as private - return event.public == '1'; - // Handled above - // case 'no-enum-groups': // Do not include events of group members - case 'not-unknown': // Show all status, but unknown - return status !== 'U'; - case 'deleted': // Show events that have been deleted - return event.deleted; - } - }; - et2_calendar_event.prototype.attachToDOM = function () { - var result = _super.prototype.attachToDOM.call(this); - // Remove the binding for the click handler, unless there's something - // custom here. - if (!this.onclick) { - jQuery(this.node).off("click"); - } - return result; - }; - /** - * Click handler calling custom handler set via onclick attribute to this.onclick. - * All other handling is done by the timegrid widget. - * - * @param {Event} _ev - * @returns {boolean} - */ - et2_calendar_event.prototype.click = function (_ev) { - var result = true; - if (typeof this.onclick == 'function') { + var new_cache_id = CalendarApp._daywise_cache_id(event.date, this.getParent().options.owner); + var new_daywise = egw.dataGetUIDdata(new_cache_id); + new_daywise = new_daywise && new_daywise.data ? new_daywise.data : []; + var old_cache_id = ''; + if (this.options.value && this.options.value.date) { + old_cache_id = CalendarApp._daywise_cache_id(this.options.value.date, parent.options.owner); + } + if (new_cache_id != old_cache_id) { + var old_daywise = egw.dataGetUIDdata(old_cache_id); + old_daywise = old_daywise && old_daywise.data ? old_daywise.data : []; + old_daywise.splice(old_daywise.indexOf(this.options.value.row_id), 1); + egw.dataStoreUID(old_cache_id, old_daywise); + if (new_daywise.indexOf(event.row_id) < 0) { + new_daywise.push(event.row_id); + } + if (egw.dataHasUID(new_cache_id)) { + egw.dataStoreUID(new_cache_id, new_daywise); + } + } + return false; + }; + /** + * Check that the event passes the given status filter. + * Status filter is set in the sidebox and used when fetching several events, but if user changes their status + * for an event, it may no longer match and have to be removed. + * + * @param event + * @param filter + * @private + */ + et2_calendar_event.prototype._status_check = function (event, filter, owner) { + if (!owner || !event) { + return false; + } + // If we're doing a bunch, just one passing is enough + if (typeof owner !== "string") { + var pass = false; + for (var j = 0; j < owner.length && pass == false; j++) { + pass = pass || this._status_check(event, filter, owner[j]); + } + return pass; + } + // Show also events just owned by selected user + if (filter == 'owner') { + return owner == event.owner; + } + // Get the relevant participant + var participant = event.participants[owner]; + // If filter says don't look in groups, skip it all + if (!participant && filter === 'no-enum-groups') { + return false; + } + // Couldn't find the current owner in the participant list, check groups & resources + if (!participant) { + var options = null; + if (app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner')) { + options = app.calendar.sidebox_et2.getWidgetById('owner').taglist.getSelection(); + } + if ((isNaN(parseInt(owner)) || parseInt(owner) < 0) && options && typeof options.find == "function") { + var resource = options.find(function (element) { + return element.id == owner; + }) || {}; + if (resource && resource.resources) { + var matching_participant = resource.resources.filter(function (id) { return typeof event.participants[id] != "undefined"; }); + return this._status_check(event, filter, matching_participant); + } + } + } + var status = et2_calendar_event.split_status(participant); + switch (filter) { + default: + case 'all': + return true; + case 'default': // Show all status, but rejected + return status !== 'R'; + case 'accepted': //Show only accepted events + return status === 'A'; + case 'unknown': // Show only invitations, not yet accepted or rejected + return status === 'U'; + case 'tentative': // Show only tentative accepted events + return status === 'T'; + case 'delegated': // Show only delegated events + return status === 'D'; + case 'rejected': // Show only rejected events + return status === 'R'; + // Handled above + //case 'owner': // Show also events just owned by selected user + case 'hideprivate': // Show all events, as if they were private + // handled server-side + return true; + case 'showonlypublic': // Show only events flagged as public, -not checked as private + return event.public == '1'; + // Handled above + // case 'no-enum-groups': // Do not include events of group members + case 'not-unknown': // Show all status, but unknown + return status !== 'U'; + case 'deleted': // Show events that have been deleted + return event.deleted; + } + }; + et2_calendar_event.prototype.attachToDOM = function () { + var result = _super.prototype.attachToDOM.call(this); + // Remove the binding for the click handler, unless there's something + // custom here. + if (!this.onclick) { + jQuery(this.node).off("click"); + } + return result; + }; + /** + * Click handler calling custom handler set via onclick attribute to this.onclick. + * All other handling is done by the timegrid widget. + * + * @param {Event} _ev + * @returns {boolean} + */ + et2_calendar_event.prototype.click = function (_ev) { + var result = true; + if (typeof this.onclick == 'function') { // Make sure function gets a reference to the widget, splice it in as 2. argument if not var args = Array.prototype.slice.call(arguments); if (args.indexOf(this) == -1)