mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:18 +01:00
fixed advanced search was always filtering by first option of custom-fields of type select or select-*
This commit is contained in:
parent
fd9519ccfe
commit
b1f0448b6d
@ -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');
|
||||
|
@ -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']['@']);
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
@ -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]});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user