Merge pull request #24645 from Easya-Solutions/17.0_fix-common-field-url-edit

FIX edit field value of url
This commit is contained in:
Laurent Destailleur 2023-04-28 18:02:24 +02:00 committed by GitHub
commit 5684a2d8fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,7 +246,7 @@ class Form
if (empty($notabletag)) {
$ret .= '<tr><td>';
}
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata)) {
if (preg_match('/^(string|safehtmlstring|email|url)/', $typeofdata)) {
$tmp = explode(':', $typeofdata);
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
} elseif (preg_match('/^(integer)/', $typeofdata)) {
@ -320,6 +320,8 @@ class Form
} else {
if (preg_match('/^(email)/', $typeofdata)) {
$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
} elseif (preg_match('/^url/', $typeofdata)) {
$ret .= dol_print_url($value, '_blank', 32, 1);
} elseif (preg_match('/^(amount|numeric)/', $typeofdata)) {
$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
} elseif (preg_match('/^(checkbox)/', $typeofdata)) {