From f973dc9b79bb6b64adc28be45cbc4c514853a8f0 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 6 Nov 2013 20:26:38 +0000 Subject: [PATCH] Fix missing category labels in nm list (set with full object was not implemented) --- etemplate/js/et2_widget_selectbox.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index 5a5ee256a1..39d1270616 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -749,13 +749,23 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], { if(_options[key]["label"]) _options[key]["label"] = this.egw().lang(_options[key]["label"]); if(_options[key]["title"]) _options[key]["title"] = this.egw().lang(_options[key]["title"]); + } else { _options[key] = this.egw().lang(_options[key]); } } - this.optionValues[key] = _options[key]; + // Allow some special extras for objects by passing the whole thing - value might not be key + if(typeof _options[key] == 'object' && typeof _options[key].value != 'undefined' && _options[key].value != key) + { + // Use value, not key, so it goes into the right place + this.optionValues[_options[key].value] = _options[key]; + } + else + { + this.optionValues[key] = _options[key]; + } } },