diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 6c19a882c1..21550737a6 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -2676,7 +2676,7 @@ window.egw_LAB.wait(function() { { foreach($this->customfields as $name => $data) { - if ($data['type'] == 'select') + if (substr($data['type'], 0, 6) == 'select' && !($data['rows'] > 1)) { if (!isset($content['#'.$name])) $content['#'.$name] = ''; if(!isset($data['values'][''])) $sel_options['#'.$name][''] = lang('Select one'); diff --git a/etemplate/inc/class.etemplate_widget_customfields.inc.php b/etemplate/inc/class.etemplate_widget_customfields.inc.php index 46d9104aef..126a45136b 100644 --- a/etemplate/inc/class.etemplate_widget_customfields.inc.php +++ b/etemplate/inc/class.etemplate_widget_customfields.inc.php @@ -262,6 +262,12 @@ class etemplate_widget_customfields extends etemplate_widget_transformer $widget->attrs['only_app'] = $field['type']; break; + case 'text': + break; + + default: + if (substr($type, 0, 7) !== 'select-') break; + // fall-through for all select-* widgets case 'select': $this->attrs['multiple'] = $field['rows'] > 1; // fall through @@ -270,7 +276,15 @@ class etemplate_widget_customfields extends etemplate_widget_transformer { $field['values'] = self::_get_options_from_file($field['values']['@']); } - self::$request->sel_options[self::$prefix.$fname] = $field['values']; + // keep extra values set by app code, eg. addressbook advanced search + if (is_array(self::$request->sel_options[self::$prefix.$fname])) + { + self::$request->sel_options[self::$prefix.$fname] += (array)$field['values']; + } + else + { + self::$request->sel_options[self::$prefix.$fname] = $field['values']; + } //error_log(__METHOD__."('$fname', ".array2string($field).") request->sel_options['".self::$prefix.$fname."']=".array2string(self::$request->sel_options[$this->id])); break; } diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index e56f9c0a16..a6d88c39c2 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -370,7 +370,7 @@ var et2_selectAccount = et2_selectbox.extend( } else { - this.options.select_options.push({value: key, label: options}); + this.options.select_options.push({value: key, label: options[key]}); } } }