From 41671d733af11f73b095fdbd78d96f9a0c96444d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 17 Mar 2015 22:00:54 +0000 Subject: [PATCH] there should be no validation for disabled widgets --- etemplate/js/et2_core_inputWidget.js | 3 ++- etemplate/js/et2_widget_radiobox.js | 5 +++-- etemplate/js/et2_widget_template.js | 2 +- etemplate/js/et2_widget_textbox.js | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/etemplate/js/et2_core_inputWidget.js b/etemplate/js/et2_core_inputWidget.js index 6eeaa7e320..f7b67f4263 100644 --- a/etemplate/js/et2_core_inputWidget.js +++ b/etemplate/js/et2_core_inputWidget.js @@ -296,7 +296,8 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener], var ok = true; // Check for required - if(this.options && this.options.needed && !this.options.readonly && (this.getValue() == null || this.getValue().valueOf() == '')) + if (this.options && this.options.needed && !this.options.readonly && !this.disabled && + (this.getValue() == null || this.getValue().valueOf() == '')) { messages.push(this.egw().lang('Field must not be empty !!!')); ok = false; diff --git a/etemplate/js/et2_widget_radiobox.js b/etemplate/js/et2_widget_radiobox.js index 3fea2c146a..0a4ffe18f3 100644 --- a/etemplate/js/et2_widget_radiobox.js +++ b/etemplate/js/et2_widget_radiobox.js @@ -135,7 +135,7 @@ var et2_radiobox = et2_inputWidget.extend( return val == this.options.set_value ? this.options.set_value : null; }, - + /** * Overridden from parent so if it's required, only 1 in a group needs a value */ @@ -143,7 +143,8 @@ var et2_radiobox = et2_inputWidget.extend( var ok = true; // Check for required - if(this.options && this.options.needed && !this.options.readonly && (this.getValue() == null || this.getValue().valueOf() == '')) + if (this.options && this.options.needed && !this.options.readonly && !this.disabled && + (this.getValue() == null || this.getValue().valueOf() == '')) { if(jQuery.isEmptyObject(this.getInstanceManager().getValues(this.getInstanceManager().widgetContainer)[this.id.replace('[]', '')])) { diff --git a/etemplate/js/et2_widget_template.js b/etemplate/js/et2_widget_template.js index 8d8e783eda..4ec04a7fdb 100644 --- a/etemplate/js/et2_widget_template.js +++ b/etemplate/js/et2_widget_template.js @@ -120,7 +120,7 @@ var et2_template = et2_DOMWidget.extend( } // Read the XML structure of the requested template - this.loadFromXML(templates[template_name]); + if (typeof templates[template_name] != 'undefined') this.loadFromXML(templates[template_name]); // Update flag this.loading.resolve(); diff --git a/etemplate/js/et2_widget_textbox.js b/etemplate/js/et2_widget_textbox.js index 03b1306f7a..2704c4e883 100644 --- a/etemplate/js/et2_widget_textbox.js +++ b/etemplate/js/et2_widget_textbox.js @@ -154,7 +154,7 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable], { var ok = true; // Check input is valid - if(this.options && this.options.validator && !this.options.readonly) + if(this.options && this.options.validator && !this.options.readonly && !this.disabled) { if (typeof this.options.validator == 'string') {