Merge pull request #20796 from altairis-melina/transradio

FIX: size and translations of radio buttons
This commit is contained in:
Laurent Destailleur 2022-05-08 19:07:11 +02:00 committed by GitHub
commit b416c49348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -956,6 +956,8 @@ class ExtraFields
$morecss = 'minwidth400';
} elseif ($type == 'boolean') {
$morecss = '';
} elseif ($type == 'radio') {
$morecss = 'width25';
} else {
if (empty($size) || round($size) < 12) {
$morecss = 'minwidth100';
@ -1262,7 +1264,7 @@ class ExtraFields
$out .= ' value="'.$keyopt.'"';
$out .= ' id="'.$keyprefix.$key.$keysuffix.'_'.$keyopt.'"';
$out .= ($value == $keyopt ? 'checked' : '');
$out .= '/><label for="'.$keyprefix.$key.$keysuffix.'_'.$keyopt.'">'.$val.'</label><br>';
$out .= '/><label for="'.$keyprefix.$key.$keysuffix.'_'.$keyopt.'">'.$langs->trans($val).'</label><br>';
}
} elseif ($type == 'chkbxlst') {
if (is_array($value)) {
@ -1666,7 +1668,7 @@ class ExtraFields
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
}
} elseif ($type == 'radio') {
$value = $param['options'][$value];
$value = $langs->trans($param['options'][$value]);
} elseif ($type == 'checkbox') {
$value_arr = explode(',', $value);
$value = '';