From c2cc34f6303e583d015d59439a8f47fab5724284 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Mon, 15 Dec 2025 16:44:51 +0100 Subject: [PATCH 01/10] Fix: Need to check strict on default value on create action In php7.4 we need to check strict because with default value 0 we have true on bool check instead of false in php8.0 > --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1b086b033ea..f07e0ae0a68 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -177,7 +177,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { //var_dump($key.' '.$value.' '.$object->fields[$key]['type'].' '.$object->fields[$key]['notnull']); $object->$key = $value; - if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] == '(PROV)') { + if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] === '(PROV)') { $object->$key = '(PROV)'; } if ($key == 'pass_crypted') { From 442e1ea3e069825e5a1b87a25898c2c7c207b76e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Dec 2025 00:48:04 +0100 Subject: [PATCH 02/10] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index df7b1e76ce5..59e2a4b8d4f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,7 +12,7 @@ Security report are valid only on any current stable version for the last 5 majo To report a vulnerability, for a private report, you can: -- Send your report on Vulnerability Disclosure Program (VDP): https://github.com/Dolibarr/dolibarr/issues or https://github.com/Dolibarr/dolibarr/security/advisories (recommended for everybody) +- Send your report as an issue on https://github.com/Dolibarr/dolibarr/issues or on GitHub Vulnerability Disclosure Program tool (VDP): https://github.com/Dolibarr/dolibarr/security/advisories (recommended for everybody) -- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary. +- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary (in such a case, the issue may be created by the developer that will fix the vulnerability or the Release Manager). ## Hunting vulnerabilities on Dolibarr From 4b824a82ef5309cd69afe17a930b132c416b1961 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Dec 2025 01:06:01 +0100 Subject: [PATCH 04/10] Update SECURITY.md --- SECURITY.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index 1af3af5b81f..8df37c8a7db 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -114,3 +114,8 @@ Scope is the web application (backoffice) and the APIs. * Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC) * Physical or social engineering attempts or issues that require physical access to a victim’s computer/device * Vulnerabilities of type XSS exploited by using javascript into a website page of the website module or by using php code into a website page (being able to set javascript or php code is the expected behaviour in the website module), except if the user does not have the permission to edit page or php code. + + +## Be informed of a new vulnerability + +You can get more information on how to be informed on a new vulnerability on the page [https://wiki.dolibarr.org/index.php/Informations_s%C3%A9curit%C3%A9](https://wiki.dolibarr.org/index.php/Security_information) From 2b7346bf97017a23f72536ef53fdb460bf423991 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Dec 2025 01:06:54 +0100 Subject: [PATCH 05/10] Fix link formatting in SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 8df37c8a7db..8115a818687 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -118,4 +118,4 @@ Scope is the web application (backoffice) and the APIs. ## Be informed of a new vulnerability -You can get more information on how to be informed on a new vulnerability on the page [https://wiki.dolibarr.org/index.php/Informations_s%C3%A9curit%C3%A9](https://wiki.dolibarr.org/index.php/Security_information) +You can get more information on how to be informed on a new vulnerability on the page https://wiki.dolibarr.org/index.php/Security_information From 03728dec472fe72e0edf040e791e1ce5e95629ad Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:06:06 +0100 Subject: [PATCH 06/10] Fix missing css rules for special inputs --- .../webportal/css/form-input-special.css | 80 +++++++++++++++++++ htdocs/public/webportal/css/style.css.php | 1 + 2 files changed, 81 insertions(+) create mode 100644 htdocs/public/webportal/css/form-input-special.css diff --git a/htdocs/public/webportal/css/form-input-special.css b/htdocs/public/webportal/css/form-input-special.css new file mode 100644 index 00000000000..8e28e8301b7 --- /dev/null +++ b/htdocs/public/webportal/css/form-input-special.css @@ -0,0 +1,80 @@ + +/** + * STARS INPUT + */ +.star-selection { + font-size: 1rem; + cursor: pointer; + display: flex; + white-space: nowrap; +} +.star { + color: #ccc; + transition: color 0.4s; +} +.star:hover, .star.active { + color: var(--butactionbg); +} + +/** + * SELECT 2 + */ + +.select2-container, .select2-container .selection, .select2-selection.select2-selection--single{ + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; +} +.select2.select2-container{ + margin-bottom: calc(var(--form-element-spacing-vertical)*3); +} +.select2-selection__rendered, .select2-selection__arrow{ + line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; +} + +.select2-search__field[type="search"] { + margin-bottom: 3px; +} +.select2-search.select2-search--dropdown{ + border-bottom : 1px solid rgba(0,0,0,0.1); +} + +/** + * DATE + */ + +[class*="fieldname_options_"] input { + width: auto; + max-width: none; + box-sizing: border-box; /* pour que padding/border ne débordent pas */ +} + +[class*="fieldname_options_"] .nowraponall { + display: inline-flex; + align-items: center; + gap: 0.25rem; +} + +[class*="fieldname_options_"] span { + display: flex; + align-items: center; + justify-content: center; + line-height: 1; +} + +[class*="fieldname_options_"] .dpInvisibleButtons{ + display: inline-block; + width: auto; + vertical-align: baseline; +} + +/** +* Inlines forms + */ + +.nowraponall :is(input:not([type=checkbox], [type=radio]), select, textarea){ + margin-bottom: 0; +} + +.nowraponall:has(input:not([type=checkbox], [type=radio]), select, textarea){ + margin-bottom: calc(var(--form-element-spacing-vertical)*3); +} diff --git a/htdocs/public/webportal/css/style.css.php b/htdocs/public/webportal/css/style.css.php index edeb7e85c01..bb7d5da5f2f 100644 --- a/htdocs/public/webportal/css/style.css.php +++ b/htdocs/public/webportal/css/style.css.php @@ -102,6 +102,7 @@ if (empty($dolibarr_nocache)) { @import "card.css"; @import "dialog.css"; @import "btn.css"; +@import "form-input-special.css"; /** This file can overwrite default pico css */ From ac3c8df5e60adf5d921b48795719837ba59e132b Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 16 Dec 2025 10:50:36 +0100 Subject: [PATCH 07/10] fix select 2 multi select --- .../webportal/css/form-input-special.css | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/public/webportal/css/form-input-special.css b/htdocs/public/webportal/css/form-input-special.css index 8e28e8301b7..645924fb5c4 100644 --- a/htdocs/public/webportal/css/form-input-special.css +++ b/htdocs/public/webportal/css/form-input-special.css @@ -26,11 +26,16 @@ .select2.select2-container{ margin-bottom: calc(var(--form-element-spacing-vertical)*3); } -.select2-selection__rendered, .select2-selection__arrow{ +.select2-selection--single .select2-selection__rendered, .select2-selection__arrow{ line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; } +.select2-selection--multiple .select2-selection__rendered{ + line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) + var(--border-width) * 2) !important; + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 3 + var(--border-width) * 2 ) !important; +} + .select2-search__field[type="search"] { margin-bottom: 3px; } @@ -38,6 +43,23 @@ border-bottom : 1px solid rgba(0,0,0,0.1); } +.select2-container--default.select2-container--focus .select2-selection--multiple { + border :var(--border-width) solid var(--border-color) !important; /* fix select 2 to be compatible pico css */ +} + +.select2-container--default.select2-container--focus .select2-selection--multiple{ + --border-color: var(--primary); +} + +.select2-container .select2-selection--multiple .select2-selection__rendered { + display: block !important; /* fix select 2 to be compatible pico css */ + overflow: auto; +} + +.select2-container--default .select2-selection--multiple .select2-selection__choice{ + border: 0px solid #aaa !important; /* fix select 2 to be compatible pico css */ +} + /** * DATE */ From 3edf615d08919a1abd289e69c53dde76b87a8361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 16 Dec 2025 11:21:03 +0100 Subject: [PATCH 08/10] fix missing import_key fetch in categories class --- htdocs/categories/class/categorie.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 96d846ffb62..08d8d4b7a68 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -431,7 +431,7 @@ class Categorie extends CommonObject 'cat_fk' => (empty($this->MAP_CAT_FK[$mapCode]) ? $mapCode : $this->MAP_CAT_FK[$mapCode]), 'cat_table' => (empty($this->MAP_CAT_TABLE[$mapCode]) ? $mapCode : $this->MAP_CAT_TABLE[$mapCode]), 'obj_class' => (empty($this->MAP_OBJ_CLASS[$mapCode]) ? $mapCode : $this->MAP_OBJ_CLASS[$mapCode]), - 'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]) + 'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]), ); } @@ -469,7 +469,7 @@ class Categorie extends CommonObject } $sql = "SELECT rowid, fk_parent, entity, label, description, color, position, fk_soc, visible, type, ref_ext"; - $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif"; + $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif, import_key"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie"; if ($id) { $sql .= " WHERE rowid = ".((int) $id); @@ -502,8 +502,9 @@ class Categorie extends CommonObject $this->date_modification = $this->db->jdate($res['tms']); $this->user_creation_id = (int) $res['fk_user_creat']; $this->user_modification_id = (int) $res['fk_user_modif']; + $this->import_key = $res['import_key']; - // Retrieve all extrafield + // Retrieve all extrafields // fetch optionals attributes and labels $this->fetch_optionals(); From 4140591621a0089769d8a2e55568553896db1132 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:31:33 +0100 Subject: [PATCH 09/10] Fix form price currency --- .../core/class/fields/pricecyfield.class.php | 2 +- .../webportal/css/form-input-special.css | 33 ++++++++++++++----- .../class/html.formwebportal.class.php | 15 +++++++++ 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/fields/pricecyfield.class.php b/htdocs/core/class/fields/pricecyfield.class.php index 1e64f20ffff..a473b2b361d 100644 --- a/htdocs/core/class/fields/pricecyfield.class.php +++ b/htdocs/core/class/fields/pricecyfield.class.php @@ -94,7 +94,7 @@ class PricecyField extends CommonField $out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib . $autoFocus); $out .= self::$form->selectCurrency($currency, $htmlName . 'currency_id'); - return $out; + return ''.$out.''; } /** diff --git a/htdocs/public/webportal/css/form-input-special.css b/htdocs/public/webportal/css/form-input-special.css index 645924fb5c4..0092130f7f7 100644 --- a/htdocs/public/webportal/css/form-input-special.css +++ b/htdocs/public/webportal/css/form-input-special.css @@ -1,4 +1,8 @@ +:root{ + --form-input-margin-bottom : calc(var(--form-element-spacing-vertical)*3); +} + /** * STARS INPUT */ @@ -24,7 +28,7 @@ height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; } .select2.select2-container{ - margin-bottom: calc(var(--form-element-spacing-vertical)*3); + margin-bottom: var(--form-input-margin-bottom); } .select2-selection--single .select2-selection__rendered, .select2-selection__arrow{ line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; @@ -64,7 +68,7 @@ * DATE */ -[class*="fieldname_options_"] input { +[class*="fieldname_options_"] > input { width: auto; max-width: none; box-sizing: border-box; /* pour que padding/border ne débordent pas */ @@ -76,12 +80,7 @@ gap: 0.25rem; } -[class*="fieldname_options_"] span { - display: flex; - align-items: center; - justify-content: center; - line-height: 1; -} + [class*="fieldname_options_"] .dpInvisibleButtons{ display: inline-block; @@ -98,5 +97,21 @@ } .nowraponall:has(input:not([type=checkbox], [type=radio]), select, textarea){ - margin-bottom: calc(var(--form-element-spacing-vertical)*3); + margin-bottom: var(--form-input-margin-bottom); +} + + +/** + * Form currency + */ +.form-select-price-currency-container { + display: flex; + align-items: center; + justify-content: center; + line-height: 1; + gap: 0.25rem; + margin-bottom: var(--form-input-margin-bottom);; +} +.form-select-price-currency-container > input { + text-align: right; } diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 35e3a8f9508..a46885296be 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -1670,4 +1670,19 @@ class FormWebPortal extends Form return $html; } + + /** + * Retourne la liste des devises, dans la langue de l'utilisateur + * + * @param string $selected Preselected currency code + * @param string $htmlname Name of HTML select list + * @param int $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code, 2 = Add both symbol and code + * @param string $useempty '1'=Allow empty value + * @return string HTML component + */ + public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0, $useempty = '') + { + + return ''.parent::selectCurrency($selected, $htmlname, $mode, $useempty).''; + } } From 86a817257197334c002507e9326c89b016d62df2 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:32:03 +0100 Subject: [PATCH 10/10] Fix form price currency --- htdocs/public/webportal/css/form-input-special.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/webportal/css/form-input-special.css b/htdocs/public/webportal/css/form-input-special.css index 0092130f7f7..8e2b3b2ada7 100644 --- a/htdocs/public/webportal/css/form-input-special.css +++ b/htdocs/public/webportal/css/form-input-special.css @@ -110,7 +110,7 @@ justify-content: center; line-height: 1; gap: 0.25rem; - margin-bottom: var(--form-input-margin-bottom);; + margin-bottom: var(--form-input-margin-bottom); } .form-select-price-currency-container > input { text-align: right;