From d7c654665f415dc8f0444ecc454cd49c8d23f258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 20:56:11 +0200 Subject: [PATCH] fix display extrafields in tooltip --- htdocs/core/class/commonobject.class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a101181d7cb..c276f4febc3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -743,6 +743,26 @@ abstract class CommonObject $datas['more_extrafields'] = '
.../...'; break; } + $enabled = 1; + if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { + $enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + } + if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { + $enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + } + $perms = 1; + if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { + $perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + } + if (empty($enabled)) { + continue; // 0 = Never visible field + } + if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) { + continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation + } + if (empty($perms)) { + continue; // 0 = Not visible + } if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); }