mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-27 19:23:22 +01:00
Work on public form for partnership
This commit is contained in:
@@ -7778,7 +7778,7 @@ class Form
|
||||
*
|
||||
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
|
||||
* @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
|
||||
* @param string|string[] $id Preselected key or preselected keys for multiselect
|
||||
* @param string|string[] $id Preselected key or preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record.
|
||||
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value.
|
||||
* @param int $key_in_label 1 to show key into label with format "[key] value"
|
||||
* @param int $value_as_key 1 to use value as key
|
||||
@@ -7895,7 +7895,7 @@ class Form
|
||||
}
|
||||
} else {
|
||||
$id = (string) $id; // if $id = 0, then $id = '0'
|
||||
if ($id != '' && $id == $key && !$disabled) {
|
||||
if ($id != '' && ($id == $key || ($id == 'ifone' && count($array) == 1)) && !$disabled) {
|
||||
$out .= ' selected'; // To preselect a value
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user