forked from extern/egroupware
* CustomFields: keep order of select-options (was not working for nummeric values)
fixed #9613: Order of customs field in a selectbox has changed
This commit is contained in:
parent
e80bd63b06
commit
9b34bf6899
@ -149,7 +149,7 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
|
|||||||
$field_filters []= $f;
|
$field_filters []= $f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = $customfields;
|
$fields = $customfields;
|
||||||
|
|
||||||
$use_private = self::expand_name($this->attrs['use-private'],0,0,'','',self::$cont);
|
$use_private = self::expand_name($this->attrs['use-private'],0,0,'','',self::$cont);
|
||||||
@ -309,6 +309,13 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
|
|||||||
self::$request->sel_options[self::$prefix.$fname] = $field['values'];
|
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]));
|
//error_log(__METHOD__."('$fname', ".array2string($field).") request->sel_options['".self::$prefix.$fname."']=".array2string(self::$request->sel_options[$this->id]));
|
||||||
|
// to keep order of numeric values, we have to explicit run fix_encoded_options, as sel_options are already encoded
|
||||||
|
$options = self::$request->sel_options[self::$prefix.$fname];
|
||||||
|
if (is_array($options))
|
||||||
|
{
|
||||||
|
etemplate_widget_menupopup::fix_encoded_options($options);
|
||||||
|
self::$request->sel_options[self::$prefix.$fname] = $options;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $widget;
|
return $widget;
|
||||||
|
Loading…
Reference in New Issue
Block a user