From a6227aeb6a0b5f5265c11b01d982dc08b3df67c5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 19 Mar 2020 11:53:42 +0100 Subject: [PATCH 1/2] FIX: Load the translation file for extrafields --- htdocs/core/class/extrafields.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a9b908203fe..b5ac448be5d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -848,7 +848,7 @@ class ExtraFields public function fetch_name_optionals_label($elementtype, $forceload = false) { // phpcs:enable - global $conf; + global $langs, $conf; if (empty($elementtype)) return array(); @@ -912,6 +912,11 @@ class ExtraFields $array_name_label[$tab->name] = $tab->label; } + if (! empty($tab->langs)) + { + $langs->load($tab->langs); + } + // Old usage $this->attribute_type[$tab->name] = $tab->type; $this->attribute_label[$tab->name] = $tab->label; @@ -1944,6 +1949,10 @@ class ExtraFields { $align = "right"; } + elseif ($type == 'price') + { + $align="right"; + } elseif ($type == 'double') { $align = "right"; From 5ffc57f3f077a1f008d6d4dfcf97e94cd99e1bbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 10:05:08 +0100 Subject: [PATCH 2/2] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b5ac448be5d..94504686718 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -848,7 +848,7 @@ class ExtraFields public function fetch_name_optionals_label($elementtype, $forceload = false) { // phpcs:enable - global $langs, $conf; + global $conf; if (empty($elementtype)) return array(); @@ -912,11 +912,6 @@ class ExtraFields $array_name_label[$tab->name] = $tab->label; } - if (! empty($tab->langs)) - { - $langs->load($tab->langs); - } - // Old usage $this->attribute_type[$tab->name] = $tab->type; $this->attribute_label[$tab->name] = $tab->label;