From 404940a14ec43b3085e3f5ec49bf48c84cdfb6b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Apr 2023 20:04:51 +0200 Subject: [PATCH] Remove separator from extrafields in popup --- htdocs/core/class/commonobject.class.php | 10 +++++++--- htdocs/core/class/html.form.class.php | 12 ++++++------ htdocs/reception/dispatch.php | 7 +++++++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index eff3f4b7319..49dbf340b96 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -742,15 +742,19 @@ abstract class CommonObject global $action, $extrafields, $langs, $hookmanager; // If there is too much extrafields, we do not include them into tooltip - $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 5); + $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 3); $datas = $this->getTooltipContentArray($params); $count = 0; + // Add extrafields if (!empty($extrafields->attributes[$this->table_element]['label'])) { foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { - if ($count >= $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) { - $datas['more_extrafields'] = '
.../...'; + if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { + continue; + } + if ($count >= abs($MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP)) { + $datas['more_extrafields'] = '
...'; break; } $enabled = 1; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 58e8836852b..470c7d7313c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8785,13 +8785,13 @@ class Form } /** - * Render list of categories linked to object with id $id and type $type + * Render list of categories linked to object with id $id and type $type * - * @param int $id Id of object - * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated. - * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) - * @param int $nolink 1=Do not add html links - * @return string String with categories + * @param int $id Id of object + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated. + * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) + * @param int $nolink 1=Do not add html links + * @return string String with categories */ public function showCategories($id, $type, $rendermode = 0, $nolink = 0) { diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index a9c6c91d675..4457a5b1303 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -520,6 +520,7 @@ if ($id > 0 || !empty($ref)) { if ($resql) { $num = $db->num_rows($resql); $i = 0; + $numline = 1; if ($num) { print ''; @@ -714,6 +715,7 @@ if ($id > 0 || !empty($ref)) { print ''; + print ''; print ''; print ''; print ''; @@ -772,6 +774,7 @@ if ($id > 0 || !empty($ref)) { print ''; + print ''; print ''; print ''; print ''; @@ -854,6 +857,8 @@ if ($id > 0 || !empty($ref)) { print "\n"; $j++; + + $numline++; } $suffix = "_".$j."_".$i; } @@ -882,6 +887,7 @@ if ($id > 0 || !empty($ref)) { print ''; + print ''; print ''; print ''; print ''; @@ -940,6 +946,7 @@ if ($id > 0 || !empty($ref)) { print ''; + print ''; print ''; print ''; print '';