Merge pull request #15022 from bafbes/abb120350

new:handle new type reference in add and update actions
This commit is contained in:
Laurent Destailleur 2020-10-22 16:16:52 +02:00 committed by GitHub
commit fec8e5a0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,9 @@ if ($action == 'add' && !empty($permissiontoadd))
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
$value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0);
} elseif ($object->fields[$key]['type'] == 'reference') {
$tmparraykey = array_keys($object->param_list);
$value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2');
} else {
$value = GETPOST($key, 'alphanohtml');
}
@ -162,6 +165,8 @@ if ($action == 'update' && !empty($permissiontoadd))
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
} elseif ($object->fields[$key]['type'] == 'reference') {
$value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2');
} else {
$value = GETPOST($key, 'alpha');
}