From 345668b2ca6746ce96f6f1ad940fb6e1f0a074e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 17:31:50 +0200 Subject: [PATCH] Default html for an url is no more a 'float' div --- htdocs/core/class/commonobject.class.php | 14 +++++++------- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0f349bd3bd..c5b3011e3bb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7525,13 +7525,13 @@ abstract class CommonObject * Return HTML string to show a field into a page * Code very similar with showOutputField of extra fields * - * @param array $val Array of properties of field to show - * @param string $key Key of attribute - * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) - * @param string $moreparam To add more parametes on html input tag - * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @param mixed $morecss Value for css to define size. May also be a numeric. + * @param array $val Array of properties of field to show + * @param string $key Key of attribute + * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string $moreparam To add more parameters on html tag + * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param mixed $morecss Value for CSS to use (Old usage: May also be a numeric to define a size). * @return string */ public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 67fcd857293..710ad9f3dce 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3150,6 +3150,7 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor if ($target) { $linkstart .= ' target="'.$target.'"'; } + $linkstart .= ' title="'.$langs->trans("URL").': '.$url.'"'; $linkstart .= '>'; $link = ''; @@ -3163,7 +3164,7 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor if ($morecss == 'float') { // deprecated return '
'.($withpicto ?img_picto($langs->trans("Url"), 'globe').' ' : '').$link.'
'; } else { - return $linkstart.''.($withpicto ?img_picto($langs->trans("Url"), 'globe').' ' : '').$link.''.$linkend; + return $linkstart.''.($withpicto ?img_picto('', 'globe').' ' : '').$link.''.$linkend; } } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 972a2322a23..a174dc9ffad 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -756,7 +756,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { + if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 98d78e0a2b2..27821a2b799 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -914,7 +914,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { + if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>';