Fix legacy options not being read for some widgets

This commit is contained in:
nathangray 2020-03-30 10:28:48 -06:00
parent c937f50193
commit 1da1cb7b99
42 changed files with 320 additions and 323 deletions

View File

@ -123,9 +123,6 @@ var et2_widget = /** @class */ (function (_super) {
*/ */
function et2_widget(_parent, _attrs, _child) { function et2_widget(_parent, _attrs, _child) {
var _this = _super.call(this) || this; 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._children = [];
_this._mgrs = {}; _this._mgrs = {};
/** /**
@ -900,6 +897,9 @@ var et2_widget = /** @class */ (function (_super) {
"description": "Object of widget attributes" "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; return et2_widget;
}(et2_core_inheritance_1.ClassWithAttributes)); }(et2_core_inheritance_1.ClassWithAttributes));
exports.et2_widget = et2_widget; exports.et2_widget = et2_widget;

View File

@ -16,7 +16,7 @@
et2_core_arrayMgr; 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 * 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" // Set the legacyOptions array to the names of the properties the "options"
// attribute defines. // attribute defines.
legacyOptions: string[] = []; public static readonly legacyOptions: string[] = [];
private _type: string; private _type: string;
id: string; id: string;

View File

@ -382,10 +382,10 @@ var et2_dataview = /** @class */ (function () {
// Create the collection of column ids // Create the collection of column ids
var colIds = []; var colIds = [];
for (var i = 0; i < this.columns.length; i++) { for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].visible) { if (this.columns[i].visible) {
colIds[i] = this.columns[i].id; colIds[i] = this.columns[i].id;
} }
} }
// Create the row provider // Create the row provider
if (this.rowProvider) { if (this.rowProvider) {
this.rowProvider.destroy(); this.rowProvider.destroy();

View File

@ -85,22 +85,22 @@ var et2_dataview_rowProvider = /** @class */ (function () {
this._prototypes["fullRow"] = tr; this._prototypes["fullRow"] = tr;
}; };
et2_dataview_rowProvider.prototype._createDefaultPrototype = function () { et2_dataview_rowProvider.prototype._createDefaultPrototype = function () {
var tr = jQuery(document.createElement("tr")); var tr = jQuery(document.createElement("tr"));
// Append a td for each column // Append a td for each column
for (var _i = 0, _a = this._columnIds; _i < _a.length; _i++) { for (var _i = 0, _a = this._columnIds; _i < _a.length; _i++) {
var column = _a[_i]; var column = _a[_i];
if (!column) if (!column)
continue; continue;
var td = jQuery(document.createElement("td")) var td = jQuery(document.createElement("td"))
.addClass(this._outerId + "_td_" + column) .addClass(this._outerId + "_td_" + column)
.appendTo(tr); .appendTo(tr);
var div = jQuery(document.createElement("div")) var div = jQuery(document.createElement("div"))
.addClass(this._outerId + "_div_" + column) .addClass(this._outerId + "_div_" + column)
.addClass("innerContainer") .addClass("innerContainer")
.appendTo(td); .appendTo(td);
} }
this._prototypes["default"] = tr; this._prototypes["default"] = tr;
}; };
et2_dataview_rowProvider.prototype._createEmptyPrototype = function () { et2_dataview_rowProvider.prototype._createEmptyPrototype = function () {
this._prototypes["empty"] = jQuery(document.createElement("tr")); this._prototypes["empty"] = jQuery(document.createElement("tr"));
}; };

View File

@ -38,7 +38,6 @@ var et2_customfields_list = /** @class */ (function (_super) {
__extends(et2_customfields_list, _super); __extends(et2_customfields_list, _super);
function et2_customfields_list(_parent, _attrs, _child) { 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; 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.rows = {};
_this.widgets = {}; _this.widgets = {};
_this.detachedNodes = []; _this.detachedNodes = [];
@ -602,6 +601,7 @@ var et2_customfields_list = /** @class */ (function (_super) {
"description": "JS code which is executed when the value changes." "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.PREFIX = '#';
et2_customfields_list.DEFAULT_ID = "custom_fields"; et2_customfields_list.DEFAULT_ID = "custom_fields";
return et2_customfields_list; return et2_customfields_list;

View File

@ -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 = '#'; public static readonly PREFIX = '#';

View File

@ -3652,7 +3652,7 @@ export class et2_nextmatch_sortheader extends et2_nextmatch_header implements et
"translate": false "translate": false
} }
}; };
legacyOptions: ['sortmode']; public static readonly legacyOptions: ['sortmode'];
private sortmode: string; private sortmode: string;
/** /**
@ -4022,7 +4022,7 @@ class et2_nextmatch_customfilter extends et2_nextmatch_filterheader
"default": {} "default": {}
} }
}; };
legacyOptions: ["widget_type","widget_options"]; public static readonly legacyOptions: ["widget_type","widget_options"];
real_node: et2_selectbox; real_node: et2_selectbox;

View File

@ -218,55 +218,55 @@ var et2_nextmatch_rowProvider = /** @class */ (function () {
* @param {et2_widget} _widget * @param {et2_widget} _widget
*/ */
et2_nextmatch_rowProvider.prototype._getVariableAttributeSet = function (_widget) { et2_nextmatch_rowProvider.prototype._getVariableAttributeSet = function (_widget) {
var variableAttributes = []; var variableAttributes = [];
var process = function (_widget) { var process = function (_widget) {
// Create the attribtues // Create the attribtues
var hasAttr = false; var hasAttr = false;
var widgetData = { var widgetData = {
"widget": _widget, "widget": _widget,
"data": [] "data": []
}; };
// Get all attribute values // Get all attribute values
for (var key in _widget.attributes) { for (var key in _widget.attributes) {
if (!_widget.attributes[key].ignore && if (!_widget.attributes[key].ignore &&
typeof _widget.options[key] != "undefined") { typeof _widget.options[key] != "undefined") {
var val = _widget.options[key]; var val = _widget.options[key];
// TODO: Improve detection // TODO: Improve detection
if (typeof val == "string" && val.indexOf("$") >= 0) { if (typeof val == "string" && val.indexOf("$") >= 0) {
hasAttr = true; hasAttr = true;
widgetData.data.push({ widgetData.data.push({
"attribute": key, "attribute": key,
"expression": val "expression": val
}); });
} }
} }
} }
// Add the entry if there is any data in it // Add the entry if there is any data in it
if (hasAttr) { if (hasAttr) {
variableAttributes.push(widgetData); variableAttributes.push(widgetData);
} }
}; };
// Check each column // Check each column
var columns = _widget._widgets; var columns = _widget._widgets;
for (var i = 0; i < columns.length; i++) { for (var i = 0; i < columns.length; i++) {
// If column is hidden, don't process it // 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) { if (typeof columns[i] === 'undefined' || this._context && this._context.columns && this._context.columns[i] && !this._context.columns[i].visible) {
continue; continue;
} }
columns[i].iterateOver(process, this); columns[i].iterateOver(process, this);
} }
return variableAttributes; return variableAttributes;
}; };
et2_nextmatch_rowProvider.prototype._seperateWidgets = function (_varAttrs) { et2_nextmatch_rowProvider.prototype._seperateWidgets = function (_varAttrs) {
// The detachable array contains all widgets which implement the // The detachable array contains all widgets which implement the
// et2_IDetachedDOM interface for all needed attributes // et2_IDetachedDOM interface for all needed attributes
var detachable = []; var detachable = [];
// The remaining array creates all widgets which have to be completely // The remaining array creates all widgets which have to be completely
// cloned when the widget tree is created // cloned when the widget tree is created
var remaining = []; var remaining = [];
// Iterate over the widgets // Iterate over the widgets
for (var i = 0; i < _varAttrs.length; i++) { for (var i = 0; i < _varAttrs.length; i++) {
var widget = _varAttrs[i].widget; var widget = _varAttrs[i].widget;
// Check whether the widget parents are not allready in the "remaining" // Check whether the widget parents are not allready in the "remaining"
// slot - if this is the case do not include the widget at all. // slot - if this is the case do not include the widget at all.
var insertWidget = true; var insertWidget = true;
@ -476,22 +476,22 @@ var et2_nextmatch_rowWidget = /** @class */ (function (_super) {
* @param {array} _widgets * @param {array} _widgets
*/ */
et2_nextmatch_rowWidget.prototype.createWidgets = function (_widgets) { et2_nextmatch_rowWidget.prototype.createWidgets = function (_widgets) {
// Clone the given the widgets with this element as parent // Clone the given the widgets with this element as parent
this._widgets = []; this._widgets = [];
var row_id = 0; var row_id = 0;
for (var i = 0; i < _widgets.length; i++) { for (var i = 0; i < _widgets.length; i++) {
// Disabled columns might be missing widget - skip it // Disabled columns might be missing widget - skip it
if (!_widgets[i]) if (!_widgets[i])
continue; continue;
this._widgets[i] = _widgets[i].clone(this); this._widgets[i] = _widgets[i].clone(this);
this._widgets[i].loadingFinished(); this._widgets[i].loadingFinished();
// Set column alignment from widget // Set column alignment from widget
if (this._widgets[i].align) { if (this._widgets[i].align) {
this._row.childNodes[row_id].align = this._widgets[i].align; this._row.childNodes[row_id].align = this._widgets[i].align;
} }
row_id++; row_id++;
} }
}; };
/** /**
* Returns the column node for the given sender * Returns the column node for the given sender
* *
@ -499,16 +499,16 @@ var et2_nextmatch_rowWidget = /** @class */ (function (_super) {
* @return {DOMElement} * @return {DOMElement}
*/ */
et2_nextmatch_rowWidget.prototype.getDOMNode = function (_sender) { et2_nextmatch_rowWidget.prototype.getDOMNode = function (_sender) {
var row_id = 0; var row_id = 0;
for (var i = 0; i < this._widgets.length; i++) { for (var i = 0; i < this._widgets.length; i++) {
// Disabled columns might be missing widget - skip it // Disabled columns might be missing widget - skip it
if (!this._widgets[i]) if (!this._widgets[i])
continue; continue;
if (this._widgets[i] == _sender) { if (this._widgets[i] == _sender) {
return this._row.childNodes[row_id].childNodes[0]; // Return the i-th td tag return this._row.childNodes[row_id].childNodes[0]; // Return the i-th td tag
} }
row_id++; row_id++;
} }
return null; return null;
}; };
return et2_nextmatch_rowWidget; return et2_nextmatch_rowWidget;

View File

@ -44,7 +44,6 @@ var et2_button = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_button._attributes, _child || {})) || this; _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_button._attributes, _child || {})) || this;
_this.legacyOptions = ["image", "ro_image"];
_this.label = ""; _this.label = "";
_this.clicked = false; _this.clicked = false;
_this.btn = null; _this.btn = null;
@ -357,6 +356,7 @@ var et2_button = /** @class */ (function (_super) {
"ignore": true "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 * images to be used as background-image, if none is explicitly applied and id matches given regular expression
*/ */

View File

@ -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 * images to be used as background-image, if none is explicitly applied and id matches given regular expression

View File

@ -48,7 +48,6 @@ var et2_checkbox = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_checkbox._attributes, _child || {})) || this; _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.input = null;
_this.toggle = null; _this.toggle = null;
_this.input = null; _this.input = null;
@ -189,6 +188,7 @@ var et2_checkbox = /** @class */ (function (_super) {
"translate": true "translate": true
} }
}; };
et2_checkbox.legacyOptions = ["selected_value", "unselected_value", "ro_true", "ro_false"];
return et2_checkbox; return et2_checkbox;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
et2_core_widget_1.et2_register_widget(et2_checkbox, ["checkbox"]); et2_core_widget_1.et2_register_widget(et2_checkbox, ["checkbox"]);

View File

@ -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; input : JQuery = null;
toggle : JQuery = null; toggle : JQuery = null;
value : string | boolean; value : string | boolean;

View File

@ -57,7 +57,6 @@ var et2_date = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date._attributes, _child || {})) || this; _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.input_date = null;
_this.is_mobile = false; _this.is_mobile = false;
_this.date = new Date(); _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" "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; return et2_date;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
exports.et2_date = et2_date; exports.et2_date = et2_date;
@ -587,7 +587,6 @@ var et2_date_duration = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date_duration._attributes, _child || {})) || this; _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; _this.format = null;
// Legacy option put percent in with display format // Legacy option put percent in with display format
if (_this.options.display_format.indexOf("%") != -1) { 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." "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; return et2_date_duration;
}(et2_date)); }(et2_date));
exports.et2_date_duration = et2_date_duration; exports.et2_date_duration = et2_date_duration;

View File

@ -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; date: Date;
span: JQuery; span: JQuery;
input_date: JQuery = null; 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"}; 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} year_range: {ignore: true}
}; };
legacyOptions: ["data_format"]; public static readonly legacyOptions: ["data_format"];
/** /**
* Internal container for working easily with dates * Internal container for working easily with dates

View File

@ -51,8 +51,6 @@ var et2_description = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_description._attributes, _child || {})) || this; _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; _this._labelContainer = null;
// Create the span/label tag which contains the label text // Create the span/label tag which contains the label text
_this.span = jQuery(document.createElement(_this.options["for"] ? "label" : "span")) _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" "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)))); _a))));
exports.et2_description = et2_description; exports.et2_description = et2_description;
; ;

View File

@ -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"]; "extra_link_target", "extra_link_popup", "statustext"];
span: JQuery; span: JQuery;

View File

@ -47,7 +47,6 @@ var et2_entry = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_entry._attributes, _child || {})) || this; _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; _this.widget = null;
// Often the ID conflicts, so check prefix // Often the ID conflicts, so check prefix
if (_attrs.id && _attrs.id.indexOf(et2_entry.prefix) < 0) { if (_attrs.id && _attrs.id.indexOf(et2_entry.prefix) < 0) {
@ -163,6 +162,7 @@ var et2_entry = /** @class */ (function (_super) {
default: true default: true
} }
}; };
et2_entry.legacyOptions = ["field", "compare", "alternate_fields"];
return et2_entry; return et2_entry;
}(et2_core_valueWidget_1.et2_valueWidget)); }(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']); et2_core_widget_1.et2_register_widget(et2_entry, ["entry", 'contact-value', 'contact-account', 'contact-template', 'infolog-value', 'tracker-value', 'records-value']);

View File

@ -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: '~'; static readonly prefix: '~';
protected widget = null; protected widget = null;

View File

@ -49,7 +49,6 @@ var et2_historylog = /** @class */ (function (_super) {
*/ */
function et2_historylog(_parent, _attrs, _child) { function et2_historylog(_parent, _attrs, _child) {
var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_historylog._attributes, _child || {})) || this; 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")) _this.div = jQuery(document.createElement("div"))
.addClass("et2_historylog"); .addClass("et2_historylog");
_this.innerDiv = jQuery(document.createElement("div")) _this.innerDiv = jQuery(document.createElement("div"))
@ -574,6 +573,7 @@ var et2_historylog = /** @class */ (function (_super) {
"description": "Method to get rows" "description": "Method to get rows"
} }
}; };
et2_historylog.legacyOptions = ["status_id"];
et2_historylog.columns = [ et2_historylog.columns = [
{ 'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time', widget: null, nodes: null }, { '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 }, { 'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account', widget: null, nodes: null },

View File

@ -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 = [ protected static columns = [
{'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time', widget: null, nodes: null}, {'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}, {'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account', widget: null, nodes: null},

View File

@ -48,7 +48,6 @@ var et2_image = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_image._attributes, _child || {})) || this; _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; _this.image = null;
// Create the image or a/image tag // Create the image or a/image tag
_this.image = jQuery(document.createElement("img")); _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." 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; return et2_image;
}(et2_core_baseWidget_1.et2_baseWidget)); }(et2_core_baseWidget_1.et2_baseWidget));
et2_core_widget_1.et2_register_widget(et2_image, ["image"]); et2_core_widget_1.et2_register_widget(et2_image, ["image"]);

View File

@ -19,7 +19,7 @@
*/ */
import {et2_baseWidget} from './et2_core_baseWidget'; 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"; 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; image : JQuery = null;

View File

@ -52,7 +52,6 @@ var et2_itempicker = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_itempicker._attributes, _child || {})) || this; _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.last_search = ""; // Remember last search value
_this.action = null; // Action function for button _this.action = null; // Action function for button
_this.current_app = ""; // Remember currently chosen application _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." "description": "Callback before query to server. Must return true, or false to abort query."
} }
}; };
et2_itempicker.legacyOptions = ["application"];
return et2_itempicker; return et2_itempicker;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
et2_core_widget_1.et2_register_widget(et2_itempicker, ["itempicker"]); et2_core_widget_1.et2_register_widget(et2_itempicker, ["itempicker"]);

View File

@ -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 last_search : string = ""; // Remember last search value
private action : egwFnct = null; // Action function for button private action : egwFnct = null; // Action function for button
private current_app : string = ""; // Remember currently chosen application private current_app : string = ""; // Remember currently chosen application

View File

@ -1052,7 +1052,6 @@ var et2_link = /** @class */ (function (_super) {
*/ */
function et2_link(_parent, _attrs, _child) { function et2_link(_parent, _attrs, _child) {
var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_link._attributes, _child || {})) || this; 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")) _this.label_span = jQuery(document.createElement("label"))
.addClass("et2_label"); .addClass("et2_label");
_this.link = jQuery(document.createElement("span")) _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" "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; return et2_link;
}(et2_core_valueWidget_1.et2_valueWidget)); }(et2_core_valueWidget_1.et2_valueWidget));
exports.et2_link = et2_link; exports.et2_link = et2_link;

View File

@ -9,25 +9,25 @@
* @copyright 2011 Nathan Gray * @copyright 2011 Nathan Gray
*/ */
/*egw:uses /*egw:uses
/vendor/bower-asset/jquery/dist/jquery.js; /vendor/bower-asset/jquery/dist/jquery.js;
/vendor/bower-asset/jquery-ui/jquery-ui.js; /vendor/bower-asset/jquery-ui/jquery-ui.js;
et2_core_inputWidget; et2_core_inputWidget;
et2_core_valueWidget; et2_core_valueWidget;
// Include menu system for list context menu // Include menu system for list context menu
egw_action.egw_menu_dhtmlx; egw_action.egw_menu_dhtmlx;
*/ */
import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget"; import {et2_register_widget, et2_widget, WidgetConfig} from "./et2_core_widget";
import {ClassWithAttributes} from "./et2_core_inheritance"; import {ClassWithAttributes} from "./et2_core_inheritance";
import {et2_valueWidget} from "./et2_core_valueWidget"; import {et2_valueWidget} from "./et2_core_valueWidget";
import {et2_inputWidget} from "./et2_core_inputWidget"; import {et2_inputWidget} from "./et2_core_inputWidget";
import {et2_selectbox} from "./et2_widget_selectbox"; import {et2_selectbox} from "./et2_widget_selectbox";
import {et2_button} from "./et2_widget_button"; import {et2_button} from "./et2_widget_button";
import {et2_vfs_select} from "./et2_widget_vfs"; import {et2_vfs_select} from "./et2_widget_vfs";
/** /**
* UI widgets for Egroupware linking system * UI widgets for Egroupware linking system
*/ */
export class et2_link_to extends et2_inputWidget 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" "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 label_span: JQuery;
private link: JQuery; private link: JQuery;

View File

@ -46,7 +46,6 @@ var et2_progress = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_progress._attributes, _child || {})) || this; _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; _this.progress = null;
var outer = document.createElement("div"); var outer = document.createElement("div");
outer.className = "et2_progress"; outer.className = "et2_progress";
@ -165,6 +164,7 @@ var et2_progress = /** @class */ (function (_super) {
"translate": true "translate": true
} }
}; };
et2_progress.legacyOptions = ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"];
return et2_progress; return et2_progress;
}(et2_core_valueWidget_1.et2_valueWidget)); }(et2_core_valueWidget_1.et2_valueWidget));
et2_core_widget_1.et2_register_widget(et2_progress, ["progress"]); et2_core_widget_1.et2_register_widget(et2_progress, ["progress"]);

View File

@ -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; private progress : HTMLElement = null;
/** /**

View File

@ -50,7 +50,6 @@ var et2_radiobox = /** @class */ (function (_super) {
*/ */
function et2_radiobox(_parent, _attrs, _child) { function et2_radiobox(_parent, _attrs, _child) {
var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_radiobox._attributes, _child || {})) || this; 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.input = null;
_this.id = ""; _this.id = "";
_this.createInputWidget(); _this.createInputWidget();
@ -159,6 +158,7 @@ var et2_radiobox = /** @class */ (function (_super) {
"description": "What should be displayed when readonly and not selected" "description": "What should be displayed when readonly and not selected"
} }
}; };
et2_radiobox.legacyOptions = ["set_value", "ro_true", "ro_false"];
return et2_radiobox; return et2_radiobox;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
et2_core_widget_1.et2_register_widget(et2_radiobox, ["radio"]); et2_core_widget_1.et2_register_widget(et2_radiobox, ["radio"]);
@ -176,7 +176,6 @@ var et2_radiobox_ro = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_radiobox_ro._attributes, _child || {})) || this; _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.value = "";
_this.span = null; _this.span = null;
_this.span = jQuery(document.createElement("span")) _this.span = jQuery(document.createElement("span"))
@ -243,6 +242,7 @@ var et2_radiobox_ro = /** @class */ (function (_super) {
"type": "string" "type": "string"
} }
}; };
et2_radiobox_ro.legacyOptions = ["set_value", "ro_true", "ro_false"];
return et2_radiobox_ro; return et2_radiobox_ro;
}(et2_core_valueWidget_1.et2_valueWidget)); }(et2_core_valueWidget_1.et2_valueWidget));
et2_core_widget_1.et2_register_widget(et2_radiobox_ro, ["radio_ro"]); et2_core_widget_1.et2_register_widget(et2_radiobox_ro, ["radio_ro"]);

View File

@ -16,8 +16,9 @@
*/ */
import {et2_inputWidget} from "./et2_core_inputWidget"; import {et2_inputWidget} from "./et2_core_inputWidget";
import {ClassWithAttributes} from "./et2_core_inheritance"; 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'; import {et2_valueWidget} from './et2_core_valueWidget';
/** /**
* Class which implements the "radiobox" XET-Tag * 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; input : JQuery = null;
id : string = ""; 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 = ""; value : string = "";
span : JQuery = null; span : JQuery = null;

View File

@ -626,7 +626,6 @@ var et2_selectAccount_ro = /** @class */ (function (_super) {
*/ */
function et2_selectAccount_ro(_parent, _attrs, _child) { 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; 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 Resolve some circular dependency problems here
selectAccount extends link, link is in a file that needs select, selectAccount extends link, link is in a file that needs select,
@ -720,6 +719,7 @@ var et2_selectAccount_ro = /** @class */ (function (_super) {
translate: true translate: true
} }
}; };
et2_selectAccount_ro.legacyOptions = ["empty_label"];
return et2_selectAccount_ro; return et2_selectAccount_ro;
}(et2_widget_link_2.et2_link_string)); }(et2_widget_link_2.et2_link_string));
exports.et2_selectAccount_ro = et2_selectAccount_ro; exports.et2_selectAccount_ro = et2_selectAccount_ro;

View File

@ -18,11 +18,10 @@
*/ */
import {et2_selectbox} from "./et2_widget_selectbox"; 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 {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_dialog} from "./et2_widget_dialog";
import {et2_link_string} from "./et2_widget_link";
/** /**
* Account selection widget * 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 * Constructor

View File

@ -50,7 +50,6 @@ var et2_selectbox = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_selectbox._attributes, _child || {})) || this; _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.input = null;
_this.value = ''; _this.value = '';
_this.selected_first = true; _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)" 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 = {}; et2_selectbox.type_cache = {};
return et2_selectbox; return et2_selectbox;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));

View File

@ -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; input: JQuery = null;
value: string | string[] = ''; value: string | string[] = '';
expand_button: JQuery; expand_button: JQuery;

View File

@ -71,7 +71,7 @@ var et2_split = /** @class */ (function (_super) {
this.div.trigger("destroy"); this.div.trigger("destroy");
// Destroy dynamic full-height // Destroy dynamic full-height
this.dynheight.destroy(); this.dynheight.destroy();
_super.prototype.destroy.call(this); _super.prototype.destroy.call(this);
// Remove placeholder children // Remove placeholder children
if (this._children.length == 0) { if (this._children.length == 0) {
this.div.empty(); this.div.empty();

View File

@ -47,7 +47,6 @@ var et2_textbox = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_textbox._attributes, _child || {})) || this; _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.input = null; _this.input = null;
_this.createInputWidget(); _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." 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; return et2_textbox;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
exports.et2_textbox = et2_textbox; exports.et2_textbox = et2_textbox;

View File

@ -15,12 +15,11 @@
*/ */
import './et2_core_common'; import './et2_core_common';
import { ClassWithAttributes } from "./et2_core_inheritance"; import {ClassWithAttributes} from "./et2_core_inheritance";
import { et2_widget, et2_createWidget, et2_register_widget, WidgetConfig } from "./et2_core_widget"; import {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_valueWidget } from './et2_core_valueWidget' import {et2_inputWidget} from './et2_core_inputWidget'
import { et2_inputWidget } from './et2_core_inputWidget' import {et2_button} from './et2_widget_button'
import { et2_button } from './et2_widget_button'
import './et2_types'; 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; input: JQuery = null;
size: number; size: number;
maxLength: number; maxLength: number;

View File

@ -450,7 +450,6 @@ var et2_vfsMime = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsMime._attributes, _child || {})) || this; _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsMime._attributes, _child || {})) || this;
_this.legacyOptions = ["size"];
_this.iconOverlayContainer = null; _this.iconOverlayContainer = null;
_this.image = null; _this.image = null;
_this.iconOverlayContainer = jQuery(document.createElement('span')).addClass('iconOverlayContainer'); _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)" 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)))); _a))));
; ;
et2_core_widget_1.et2_register_widget(et2_vfsMime, ["vfs-mime"]); et2_core_widget_1.et2_register_widget(et2_vfsMime, ["vfs-mime"]);
@ -828,7 +828,6 @@ var et2_vfsUpload = /** @class */ (function (_super) {
var _this = var _this =
// Call the inherited constructor // Call the inherited constructor
_super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsUpload._attributes, _child || {})) || this; _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_vfsUpload._attributes, _child || {})) || this;
_this.legacyOptions = ["mime"];
_this.asyncOptions = { _this.asyncOptions = {
target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload") target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload")
}; };
@ -989,6 +988,7 @@ var et2_vfsUpload = /** @class */ (function (_super) {
"default": '' "default": ''
} }
}; };
et2_vfsUpload.legacyOptions = ["mime"];
return et2_vfsUpload; return et2_vfsUpload;
}(et2_widget_file_1.et2_file)); }(et2_widget_file_1.et2_file));
et2_core_widget_1.et2_register_widget(et2_vfsUpload, ["vfs-upload"]); et2_core_widget_1.et2_register_widget(et2_vfsUpload, ["vfs-upload"]);

View File

@ -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; iconOverlayContainer : JQuery = null;
overlayContainer : JQuery; overlayContainer : JQuery;
image : JQuery = null; 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} = { asyncOptions : {target : any} = {
target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload") target: egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_upload")

View File

@ -11,7 +11,7 @@
</columns> </columns>
<rows> <rows>
<row> <row>
<radio id="index" options="$row_cont[index]"/> <radio id="index" set_value="$row_cont[index]"/>
<description/> <description/>
<description id="${row}[label]"/> <description id="${row}[label]"/>
</row> </row>

View File

@ -33,16 +33,16 @@
</columns> </columns>
<rows> <rows>
<row class="row"> <row class="row">
<vfs-mime align="center" id="$row" options="16" class="selectIcon"/> <vfs-mime align="center" id="$row" size="16" class="selectIcon"/>
<vfs id="$row" onclick="app.vfsSelectUI.select_clicked"/> <vfs id="$row" onclick="app.vfsSelectUI.select_clicked"/>
<checkbox align="right" id="selected[]" options="&quot;$row_cont[name]&quot;"/> <checkbox align="right" id="selected[]" selected_value="&quot;$row_cont[name]&quot;"/>
</row> </row>
</rows> </rows>
</grid> </grid>
</hbox> </hbox>
</row> </row>
<row disabled="!@showmime"> <row disabled="!@showmime">
<select id="mime" onchange="app.vfsSelectUI.do_action('mime', widget)" options="All files" class="et2_fullWidth"/> <select id="mime" onchange="app.vfsSelectUI.do_action('mime', widget)" empty_label="All files" class="et2_fullWidth"/>
</row> </row>
</rows> </rows>
</grid> </grid>

View File

@ -167,35 +167,35 @@ var et2_calendar_event = /** @class */ (function (_super) {
* Callback for changes in cached data * Callback for changes in cached data
*/ */
et2_calendar_event.prototype._UID_callback = function (event) { et2_calendar_event.prototype._UID_callback = function (event) {
// Copy to avoid changes, which may cause nm problems // Copy to avoid changes, which may cause nm problems
var value = event === null ? null : jQuery.extend({}, event); var value = event === null ? null : jQuery.extend({}, event);
var parent = this.getParent(); var parent = this.getParent();
var parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner; var parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner;
// Make sure id is a string, check values // Make sure id is a string, check values
if (value) { if (value) {
this._values_check(value); this._values_check(value);
} }
// Check for changing days in the grid view // Check for changing days in the grid view
if (!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent_owner)) { 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 // May need to update parent to remove out-of-view events
parent.removeChild(this); parent.removeChild(this);
if (event === null && parent && parent.instanceOf(et2_widget_daycol_1.et2_calendar_daycol)) { if (event === null && parent && parent.instanceOf(et2_widget_daycol_1.et2_calendar_daycol)) {
parent._out_of_view(); parent._out_of_view();
} }
// This should now cease to exist, as new events have been created // This should now cease to exist, as new events have been created
this.destroy(); this.destroy();
return; return;
} }
// Copy to avoid changes, which may cause nm problems // Copy to avoid changes, which may cause nm problems
this.options.value = jQuery.extend({}, value); this.options.value = jQuery.extend({}, value);
if (this.getParent().options.date) { if (this.getParent().options.date) {
this.options.value.date = this.getParent().options.date; this.options.value.date = this.getParent().options.date;
} }
// Let parent position - could also be et2_calendar_planner_row // Let parent position - could also be et2_calendar_planner_row
this.getParent().position_event(this); this.getParent().position_event(this);
// Parent may remove this if the date isn't the same // Parent may remove this if the date isn't the same
if (this.getParent()) { if (this.getParent()) {
this._update(); this._update();
} }
}; };
/** /**
@ -653,127 +653,125 @@ var et2_calendar_event = /** @class */ (function (_super) {
this._actionObject = null; this._actionObject = null;
} }
// Update daywise caches // Update daywise caches
var new_cache_id = CalendarApp._daywise_cache_id(event.date, this.getParent().options.owner); var new_cache_id = CalendarApp._daywise_cache_id(event.date, this.getParent().options.owner);
var new_daywise = egw.dataGetUIDdata(new_cache_id); var new_daywise = egw.dataGetUIDdata(new_cache_id);
new_daywise = new_daywise && new_daywise.data ? new_daywise.data : []; new_daywise = new_daywise && new_daywise.data ? new_daywise.data : [];
var old_cache_id = ''; var old_cache_id = '';
if (this.options.value && this.options.value.date) { if (this.options.value && this.options.value.date) {
old_cache_id = CalendarApp._daywise_cache_id(this.options.value.date, parent.options.owner); old_cache_id = CalendarApp._daywise_cache_id(this.options.value.date, parent.options.owner);
} }
if (new_cache_id != old_cache_id) { if (new_cache_id != old_cache_id) {
var old_daywise = egw.dataGetUIDdata(old_cache_id); var old_daywise = egw.dataGetUIDdata(old_cache_id);
old_daywise = old_daywise && old_daywise.data ? old_daywise.data : []; old_daywise = old_daywise && old_daywise.data ? old_daywise.data : [];
old_daywise.splice(old_daywise.indexOf(this.options.value.row_id), 1); old_daywise.splice(old_daywise.indexOf(this.options.value.row_id), 1);
egw.dataStoreUID(old_cache_id, old_daywise); egw.dataStoreUID(old_cache_id, old_daywise);
if (new_daywise.indexOf(event.row_id) < 0) { if (new_daywise.indexOf(event.row_id) < 0) {
new_daywise.push(event.row_id); new_daywise.push(event.row_id);
} }
if (egw.dataHasUID(new_cache_id)) { if (egw.dataHasUID(new_cache_id)) {
egw.dataStoreUID(new_cache_id, new_daywise); egw.dataStoreUID(new_cache_id, new_daywise);
} }
} }
return false; return false;
}; };
/** /**
* Check that the event passes the given status filter. * 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 * 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. * for an event, it may no longer match and have to be removed.
* *
* @param event * @param event
* @param filter * @param filter
* @private * @private
*/ */
et2_calendar_event.prototype._status_check = function (event, filter, owner) { et2_calendar_event.prototype._status_check = function (event, filter, owner) {
if (!owner || !event) { if (!owner || !event) {
return false; return false;
} }
// If we're doing a bunch, just one passing is enough // If we're doing a bunch, just one passing is enough
if (typeof owner !== "string") { if (typeof owner !== "string") {
var pass = false; var pass = false;
for (var j = 0; j < owner.length && pass == false; j++) { for (var j = 0; j < owner.length && pass == false; j++) {
pass = pass || this._status_check(event, filter, owner[j]); pass = pass || this._status_check(event, filter, owner[j]);
} }
return pass; return pass;
} }
// Show also events just owned by selected user // Show also events just owned by selected user
if (filter == 'owner') { if (filter == 'owner') {
return owner == event.owner; return owner == event.owner;
} }
// Get the relevant participant // Get the relevant participant
var participant = event.participants[owner]; var participant = event.participants[owner];
// If filter says don't look in groups, skip it all // If filter says don't look in groups, skip it all
if (!participant && filter === 'no-enum-groups') { if (!participant && filter === 'no-enum-groups') {
return false; return false;
} }
// Couldn't find the current owner in the participant list, check groups & resources // Couldn't find the current owner in the participant list, check groups & resources
if (!participant) { if (!participant) {
var options = null; var options = null;
if (app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner')) { if (app.calendar && app.calendar.sidebox_et2 && app.calendar.sidebox_et2.getWidgetById('owner')) {
options = app.calendar.sidebox_et2.getWidgetById('owner').taglist.getSelection(); options = app.calendar.sidebox_et2.getWidgetById('owner').taglist.getSelection();
} }
if ((isNaN(parseInt(owner)) || parseInt(owner) < 0) && options && typeof options.find == "function") { if ((isNaN(parseInt(owner)) || parseInt(owner) < 0) && options && typeof options.find == "function") {
var resource = options.find(function (element) { var resource = options.find(function (element) {
return element.id == owner; return element.id == owner;
}) || {}; }) || {};
if (resource && resource.resources) { if (resource && resource.resources) {
var matching_participant = resource.resources.filter(function (id) { var matching_participant = resource.resources.filter(function (id) { return typeof event.participants[id] != "undefined"; });
return typeof event.participants[id] != "undefined"; return this._status_check(event, filter, matching_participant);
}); }
return this._status_check(event, filter, matching_participant); }
} }
} var status = et2_calendar_event.split_status(participant);
} switch (filter) {
var status = et2_calendar_event.split_status(participant); default:
switch (filter) { case 'all':
default: return true;
case 'all': case 'default': // Show all status, but rejected
return true; return status !== 'R';
case 'default': // Show all status, but rejected case 'accepted': //Show only accepted events
return status !== 'R'; return status === 'A';
case 'accepted': //Show only accepted events case 'unknown': // Show only invitations, not yet accepted or rejected
return status === 'A'; return status === 'U';
case 'unknown': // Show only invitations, not yet accepted or rejected case 'tentative': // Show only tentative accepted events
return status === 'U'; return status === 'T';
case 'tentative': // Show only tentative accepted events case 'delegated': // Show only delegated events
return status === 'T'; return status === 'D';
case 'delegated': // Show only delegated events case 'rejected': // Show only rejected events
return status === 'D'; return status === 'R';
case 'rejected': // Show only rejected events // Handled above
return status === 'R'; //case 'owner': // Show also events just owned by selected user
// Handled above case 'hideprivate': // Show all events, as if they were private
//case 'owner': // Show also events just owned by selected user // handled server-side
case 'hideprivate': // Show all events, as if they were private return true;
// handled server-side case 'showonlypublic': // Show only events flagged as public, -not checked as private
return true; return event.public == '1';
case 'showonlypublic': // Show only events flagged as public, -not checked as private // Handled above
return event.public == '1'; // case 'no-enum-groups': // Do not include events of group members
// Handled above case 'not-unknown': // Show all status, but unknown
// case 'no-enum-groups': // Do not include events of group members return status !== 'U';
case 'not-unknown': // Show all status, but unknown case 'deleted': // Show events that have been deleted
return status !== 'U'; return event.deleted;
case 'deleted': // Show events that have been deleted }
return event.deleted; };
} et2_calendar_event.prototype.attachToDOM = function () {
}; var result = _super.prototype.attachToDOM.call(this);
et2_calendar_event.prototype.attachToDOM = function () { // Remove the binding for the click handler, unless there's something
var result = _super.prototype.attachToDOM.call(this); // custom here.
// Remove the binding for the click handler, unless there's something if (!this.onclick) {
// custom here. jQuery(this.node).off("click");
if (!this.onclick) { }
jQuery(this.node).off("click"); return result;
} };
return result; /**
}; * Click handler calling custom handler set via onclick attribute to this.onclick.
/** * All other handling is done by the timegrid widget.
* 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}
* @param {Event} _ev */
* @returns {boolean} et2_calendar_event.prototype.click = function (_ev) {
*/ var result = true;
et2_calendar_event.prototype.click = function (_ev) { if (typeof this.onclick == 'function') {
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 // Make sure function gets a reference to the widget, splice it in as 2. argument if not
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
if (args.indexOf(this) == -1) if (args.indexOf(this) == -1)