Fix preselected country
This commit is contained in:
parent
e03d2311c3
commit
c5d5a963cb
@ -885,9 +885,11 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
|
|||||||
$fieldname = 'country';
|
$fieldname = 'country';
|
||||||
if ($context == 'add') {
|
if ($context == 'add') {
|
||||||
$fieldname = 'country_id';
|
$fieldname = 'country_id';
|
||||||
print $form->select_country(GETPOST('country_id', 'int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
$preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code;
|
||||||
|
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
} else {
|
} else {
|
||||||
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : $mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
$preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code);
|
||||||
|
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($fieldlist[$field] == 'country_id') {
|
} elseif ($fieldlist[$field] == 'country_id') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user