From 6d3059d2a8156f2779040fd47ef3371aac6afe19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Jul 2022 22:20:41 +0200 Subject: [PATCH] Add type ip --- htdocs/core/class/commonobject.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ba6007235f3..ad31e42a625 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6868,7 +6868,7 @@ abstract class CommonObject $out = ''; } elseif (preg_match('/varchar/', $type)) { $out = ' 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>'; - } elseif (in_array($type, array('mail', 'phone', 'url'))) { + } elseif (in_array($type, array('mail', 'phone', 'url', 'ip'))) { $out = ''; } elseif (preg_match('/^text/', $type)) { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field @@ -7498,6 +7498,8 @@ abstract class CommonObject $value = dol_print_url($value, '_blank', 32, 1); } elseif ($type == 'phone') { $value = dol_print_phone($value, '', 0, 0, '', ' ', 'phone'); + } elseif ($type == 'ip') { + $value = dol_print_ip($value, 0); } elseif ($type == 'price') { if (!is_null($value) && $value !== '') { $value = price($value, 0, $langs, 0, 0, -1, $conf->currency);