From d8dd1ebd19721f38e9d129cfdb14d3685e511542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 9 May 2023 17:43:31 +0200 Subject: [PATCH 1/6] FIX: Authorize '0' subprice --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 3155ab3ae0a..88ba4a07022 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -3048,7 +3048,7 @@ class SupplierProposalLine extends CommonObjectLine $sql .= " ".price2num($this->localtax2_tx).","; $sql .= " '".$this->db->escape($this->localtax1_type)."',"; $sql .= " '".$this->db->escape($this->localtax2_type)."',"; - $sql .= " ".(!empty($this->subprice) ? price2num($this->subprice, 'MU') : "null").","; + $sql .= " ".price2num($this->subprice, 'MU') .","; $sql .= " ".((float) $this->remise_percent).","; $sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits) : "null").","; $sql .= " ".price2num($this->total_ht, 'MT').","; From 6cacc4405177a202d33cace5d27ebb4c0161a42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Mon, 22 May 2023 18:01:32 +0200 Subject: [PATCH 2/6] FIX: Langs was not loaded for extrafields error --- htdocs/core/class/extrafields.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 98e3b77fa3b..f2b0ff391a2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1991,6 +1991,8 @@ class ExtraFields continue; } + $langs->load($this->attributes[$object->table_element]['langfile'][$key]); + if ($this->attributes[$object->table_element]['required'][$key]) { // Value is required // Check if functionally empty without using GETPOST (depending on the type of extrafield, a // technically non-empty value may be treated as empty functionally). From 6469d85c4da8ec8c8b702c00f5b28da7fd765d6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 May 2023 18:42:14 +0200 Subject: [PATCH 3/6] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f2b0ff391a2..d2b1be1da42 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1991,8 +1991,6 @@ class ExtraFields continue; } - $langs->load($this->attributes[$object->table_element]['langfile'][$key]); - if ($this->attributes[$object->table_element]['required'][$key]) { // Value is required // Check if functionally empty without using GETPOST (depending on the type of extrafield, a // technically non-empty value may be treated as empty functionally). @@ -2002,6 +2000,9 @@ class ExtraFields || (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0') || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) { //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; + if (!empty($this->attributes[$object->table_element]['langfile'][$key])) { + $langs->load($this->attributes[$object->table_element]['langfile'][$key]); + } $nofillrequired++; $error_field_required[] = $langs->transnoentitiesnoconv($value); } From 6e20386809ecd930a101859d29f512885ff217e8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 24 May 2023 08:24:06 +0200 Subject: [PATCH 4/6] fix: text-agling instead of text-align in style.css.php --- htdocs/theme/eldy/dropdown.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 5c62a703f67..c031f0060fa 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -290,7 +290,7 @@ a.top-menu-dropdown-link { #topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn { display: block; - text-aling: right; + text-align: right; color:#666; cursor: pointer; } From d200dea90535876342871bdf9ecb92db4ae81aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Wed, 24 May 2023 11:26:55 +0200 Subject: [PATCH 5/6] FIX: default values were not set for specimen objects --- htdocs/core/class/commonobject.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ed74194d492..a2bf74d82e0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9452,6 +9452,18 @@ abstract class CommonObject $this->{$key} = $value; } } + + foreach ($this->fields as $key => $value) { + // If fields are already set, do nothing + if (array_key_exists($key, $fields)) { + continue; + } + + if (!empty($value['default'])) { + $this->{$key} = $value['default']; + } + } + return 1; } From 9b8e56418780baae1d5ce5953ffda16e091c2a09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 May 2023 14:07:24 +0200 Subject: [PATCH 6/6] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a2bf74d82e0..46563688d72 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9453,6 +9453,7 @@ abstract class CommonObject } } + // Force values to default values when known foreach ($this->fields as $key => $value) { // If fields are already set, do nothing if (array_key_exists($key, $fields)) { @@ -9460,7 +9461,7 @@ abstract class CommonObject } if (!empty($value['default'])) { - $this->{$key} = $value['default']; + $this->$key = $value['default']; } }