From c66a8d6bc1131a249499db6367fb0baa55706796 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 26 May 2023 10:16:56 +0200 Subject: [PATCH 001/105] fix: php warning on sabre lib --- htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php index 4f620de1070..369ad22f14f 100644 --- a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php +++ b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php @@ -506,7 +506,7 @@ class VCard extends VObject\Document { switch ($property->name) { case 'VERSION': - continue; + continue 2; case 'XML': $value = $property->getParts(); From 27cc40fd07b2fd74a9d560ebab15761bc76bc1d0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 26 May 2023 10:27:58 +0200 Subject: [PATCH 002/105] fix: php warning on sabre lib with same as sabre 4.2.2 --- htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php index 369ad22f14f..52ee2fad5f0 100644 --- a/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php +++ b/htdocs/includes/sabre/sabre/vobject/lib/Component/VCard.php @@ -506,7 +506,7 @@ class VCard extends VObject\Document { switch ($property->name) { case 'VERSION': - continue 2; + break; case 'XML': $value = $property->getParts(); From b7419ff73f19a0282ef8fa7035c42d5a830058dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 26 May 2023 14:39:06 +0200 Subject: [PATCH 003/105] FIX: String was compared to an integer --- htdocs/core/modules/import/import_csv.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index ea1cb757223..0547bfe6894 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -809,7 +809,7 @@ class ImportCsv extends ModeleImports break; } $classinstance = new $class($this->db); - $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $listfields, ($key - 1))); + $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $listfields, $key)); $fieldArr = explode('.', $fieldname); if (count($fieldArr) > 0) { $fieldname = $fieldArr[1]; From 623a1ed109ee1ea2ba7df8860b037227132bf071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 26 May 2023 14:59:50 +0200 Subject: [PATCH 004/105] php V8 warning 2 elements not defined, generate error on create company --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d18404921a8..7c87b51b8ee 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2211,7 +2211,9 @@ class Form $outarray2[$userstatic->id] = array( 'id'=>$userstatic->id, 'label'=>$labeltoshow, - 'labelhtml'=>$labeltoshowhtml + 'labelhtml'=>$labeltoshowhtml, + 'color'=>'', + 'picto'=>'' ); $i++; From 2581513c90febaf9918afb7783f2971f7d2e8982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 26 May 2023 17:08:55 +0200 Subject: [PATCH 005/105] add planned_workload field on odt --- .../modules/project/doc/doc_generic_project_odt.modules.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 853060f3b2c..958b3a7334e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2016-2023 Charlene Benke * Copyright (C) 2018 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * @@ -201,6 +201,8 @@ class doc_generic_project_odt extends ModelePDFProjects 'task_fk_parent'=>$task->fk_parent, 'task_duration'=>$task->duration, 'task_duration_hour'=>convertSecondToTime($task->duration, 'all'), + 'task_planned_workload'=>$task->planned_workload, + 'task_planned_workload_hour'=>convertSecondToTime($task->planned_workload, 'all'), 'task_progress'=>$task->progress, 'task_public'=>$task->public, 'task_date_start'=>dol_print_date($task->date_start, 'day'), From 110dda880fa7120caaa13d343d7d926740d7b22c Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 28 May 2023 01:00:28 +0300 Subject: [PATCH 006/105] Update llx_c_invoice_subtype.sql --- htdocs/install/mysql/tables/llx_c_invoice_subtype.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql index 0bdc10fc69d..2e8911d3daa 100644 --- a/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql +++ b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql @@ -20,7 +20,7 @@ CREATE TABLE llx_c_invoice_subtype ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1, fk_country integer NOT NULL, - code varchar(3) NOT NULL, + code varchar(4) NOT NULL, label varchar(100), active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; From fcbb73801cf3cfbebb07d3f0a16cb670f1477c4c Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 28 May 2023 01:04:15 +0300 Subject: [PATCH 007/105] Create llx_c_invoice_subtype --- .../install/mysql/data/llx_c_invoice_subtype | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_c_invoice_subtype diff --git a/htdocs/install/mysql/data/llx_c_invoice_subtype b/htdocs/install/mysql/data/llx_c_invoice_subtype new file mode 100644 index 00000000000..70862fdd422 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_invoice_subtype @@ -0,0 +1,43 @@ +-- ======================================================================== +-- Copyright (C) 2023 Laurent Destailleur +-- Copyright (C) 2023 Nick Fragoulis +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== +-- +-- +-- +-- Greece (102) +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.1', 'Τιμολόγιο Πώλησης', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.2', 'Τιμολόγιο Πώλησης / Ενδοκοινοτικές Παραδόσεις', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.3', 'Τιμολόγιο Πώλησης / Παραδόσεις Τρίτων Χωρών', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.4', 'Τιμολόγιο Πώλησης / Πώληση για Λογαριασμό Τρίτων', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.5', 'Τιμολόγιο Πώλησης / Εκκαθάριση Πωλήσεων Τρίτων - Αμοιβή από Πωλήσεις Τρίτων', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.6', 'Τιμολόγιο Πώλησης / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.1', 'Τιμολόγιο Παροχής', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.2', 'Τιμολόγιο Παροχής / Ενδοκοινοτική Παροχή Υπηρεσιών', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.3', 'Τιμολόγιο Παροχής / Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.4', 'Τιμολόγιο Παροχής / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.1', 'Τίτλος Κτήσης (μη υπόχρεος Εκδότης)', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.2', 'Τίτλος Κτήσης (άρνηση έκδοσης από υπόχρεο Εκδότη)', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.1', 'Στοιχείο Αυτοπαράδοσης', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.2', 'Στοιχείο Ιδιοχρησιμοποίησης', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '7.1', 'Συμβόλαιο - Έσοδο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.1', 'Ενοίκια - Έσοδο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.2', 'Ειδικό Στοιχείο – Απόδειξης Είσπραξης Φόρου Διαμονής', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.1', 'ΑΛΠ', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.2', 'ΑΠΥ', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.3', 'Απλοποιημένο Τιμολόγιο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.5', 'Απόδειξη Λιανικής Πώλησης για Λογ/σμό Τρίτων', 0); From b6132ef095462e60370b32bc357b1985601fa5bf Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 28 May 2023 01:07:53 +0300 Subject: [PATCH 008/105] Update 17.0.0-18.0.0.sql --- .../install/mysql/migration/17.0.0-18.0.0.sql | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 39316b9ec66..1012e4ac61f 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -404,7 +404,7 @@ CREATE TABLE llx_c_invoice_subtype ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1, fk_country integer NOT NULL, - code varchar(3) NOT NULL, + code varchar(4) NOT NULL, label varchar(100), active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; @@ -433,3 +433,25 @@ ALTER TABLE llx_c_ziptown ADD COLUMN town_up varchar(180); -- Email Collector ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN imap_encryption varchar(16) DEFAULT 'ssl' AFTER hostcharset; ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN norsh integer DEFAULT 0 AFTER imap_encryption; + +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.1', 'Τιμολόγιο Πώλησης', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.2', 'Τιμολόγιο Πώλησης / Ενδοκοινοτικές Παραδόσεις', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.3', 'Τιμολόγιο Πώλησης / Παραδόσεις Τρίτων Χωρών', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.4', 'Τιμολόγιο Πώλησης / Πώληση για Λογαριασμό Τρίτων', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.5', 'Τιμολόγιο Πώλησης / Εκκαθάριση Πωλήσεων Τρίτων - Αμοιβή από Πωλήσεις Τρίτων', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.6', 'Τιμολόγιο Πώλησης / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.1', 'Τιμολόγιο Παροχής', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.2', 'Τιμολόγιο Παροχής / Ενδοκοινοτική Παροχή Υπηρεσιών', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.3', 'Τιμολόγιο Παροχής / Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.4', 'Τιμολόγιο Παροχής / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.1', 'Τίτλος Κτήσης (μη υπόχρεος Εκδότης)', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.2', 'Τίτλος Κτήσης (άρνηση έκδοσης από υπόχρεο Εκδότη)', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.1', 'Στοιχείο Αυτοπαράδοσης', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.2', 'Στοιχείο Ιδιοχρησιμοποίησης', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '7.1', 'Συμβόλαιο - Έσοδο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.1', 'Ενοίκια - Έσοδο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.2', 'Ειδικό Στοιχείο – Απόδειξης Είσπραξης Φόρου Διαμονής', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.1', 'ΑΛΠ', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.2', 'ΑΠΥ', 1); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.3', 'Απλοποιημένο Τιμολόγιο', 0); +insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.5', 'Απόδειξη Λιανικής Πώλησης για Λογ/σμό Τρίτων', 0); From f653f5c96c3d83d8d7775f791575a0e0d57352c0 Mon Sep 17 00:00:00 2001 From: Didier 'OdyX' Raboud Date: Mon, 29 May 2023 09:02:49 +0200 Subject: [PATCH 009/105] Fix multicurrency payments' currency quoting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL imposes single-quoting around strings; double-quotes cast to column names Fixes a0d9419be5cb766db6b8d3f9f47ba1322d1196e1 --- htdocs/fourn/class/paiementfourn.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 88f0ce47d4e..1a90e971df3 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -270,7 +270,7 @@ class PaiementFourn extends Paiement if (is_numeric($amount) && $amount <> 0) { $amount = price2num($amount); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn_facturefourn (fk_facturefourn, fk_paiementfourn, amount, multicurrency_amount, multicurrency_code, multicurrency_tx)'; - $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).', '.((float) $this->multicurrency_amounts[$key]).', '.($currencyofpayment ? '"'.$this->db->escape($currencyofpayment).'"' : 'NULL').', '.(!empty($currencytxofpayment) ? (double) $currencytxofpayment : 1).')'; + $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).', '.((float) $this->multicurrency_amounts[$key]).', '.($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').', '.(!empty($currencytxofpayment) ? (double) $currencytxofpayment : 1).')'; $resql = $this->db->query($sql); if ($resql) { $invoice = new FactureFournisseur($this->db); From 5d165fb7262bb4bb6b4f8347754fdabec8932d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Mon, 29 May 2023 11:33:10 +0200 Subject: [PATCH 010/105] FIX: Change $key into $tmpkey --- .../modules/import/import_csv.modules.php | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 0547bfe6894..e76d7a06c03 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -778,26 +778,26 @@ class ImportCsv extends ModeleImports // Previously we processed the ->import_fields_array. if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { // Loop on each hidden fields to add them into listfields/listvalues - foreach ($objimport->array_import_fieldshidden[0] as $key => $val) { - if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) { + foreach ($objimport->array_import_fieldshidden[0] as $tmpkey => $tmpval) { + if (!preg_match('/^'.preg_quote($alias, '/').'\./', $tmpkey)) { continue; // Not a field of current table } - if ($val == 'user->id') { - $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); + if ($tmpval == 'user->id') { + $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $tmpkey); $listvalues[] = ((int) $user->id); - } elseif (preg_match('/^lastrowid-/', $val)) { - $tmp = explode('-', $val); + } elseif (preg_match('/^lastrowid-/', $tmpval)) { + $tmp = explode('-', $tmpval); $lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0; - $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); + $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $tmpkey); $listfields[] = $keyfield; $listvalues[] = $lastinsertid; - //print $key."-".$val."-".$listfields."-".$listvalues."
";exit; - } elseif (preg_match('/^const-/', $val)) { - $tmp = explode('-', $val, 2); - $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); + //print $tmpkey."-".$tmpval."-".$listfields."-".$listvalues."
";exit; + } elseif (preg_match('/^const-/', $tmpval)) { + $tmp = explode('-', $tmpval, 2); + $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $tmpkey); $listvalues[] = "'".$this->db->escape($tmp[1])."'"; - } elseif (preg_match('/^rule-/', $val)) { - $fieldname = $key; + } elseif (preg_match('/^rule-/', $tmpval)) { + $fieldname = $tmpkey; if (!empty($objimport->array_import_convertvalue[0][$fieldname])) { if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') { $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']); @@ -809,7 +809,7 @@ class ImportCsv extends ModeleImports break; } $classinstance = new $class($this->db); - $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $listfields, $key)); + $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $listfields, ($key - 1))); $fieldArr = explode('.', $fieldname); if (count($fieldArr) > 0) { $fieldname = $fieldArr[1]; @@ -819,7 +819,7 @@ class ImportCsv extends ModeleImports } } } else { - $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; + $this->errors[$error]['lib'] = 'Bad value of profile setup '.$tmpval.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; $error++; } From 44cc4948cec0019a20b4d71ec427c8de0c3ed806 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 29 May 2023 16:27:48 +0200 Subject: [PATCH 011/105] FIX set action after error on product lot card --- htdocs/product/stock/productlot_card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 0e00476455e..372af1496cc 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -153,7 +153,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('eatby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { setEventMessages($object->error, null, 'errors'); - $action == 'editeatby'; + $action = 'editeatby'; } else { $action = 'view'; } @@ -164,7 +164,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('sellby', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { setEventMessages($object->error, null, 'errors'); - $action == 'editsellby'; + $action = 'editsellby'; } else { $action = 'view'; } @@ -175,7 +175,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('eol_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { setEventMessages($object->error, null, 'errors'); - $action == 'editeol_date'; + $action = 'editeol_date'; } else { $action = 'view'; } @@ -186,7 +186,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('manufacturing_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { setEventMessages($object->error, null, 'errors'); - $action == 'editmanufacturing_date'; + $action = 'editmanufacturing_date'; } else { $action = 'view'; } @@ -197,7 +197,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('scrapping_date', $newvalue, '', null, 'date', '', $user, 'PRODUCTLOT_MODIFY'); if ($result < 0) { setEventMessages($object->error, null, 'errors'); - $action == 'editscrapping_date'; + $action = 'editscrapping_date'; } else { $action = 'view'; } @@ -218,7 +218,7 @@ if (empty($reshook)) { $result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY'); if ($result < 0) { // Prévoir un test de format de durée setEventMessages($object->error, null, 'errors'); - $action == 'editqc_frequency'; + $action = 'editqc_frequency'; } else { $action = 'view'; } From 31b548291a720ae50d84cf474fd56938d6b60ff5 Mon Sep 17 00:00:00 2001 From: Roger Dueck Date: Mon, 29 May 2023 10:17:22 -0600 Subject: [PATCH 012/105] Fix undefined and invalid access issues --- htdocs/projet/element.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 9dc6090c3d7..a4d847c5023 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1164,7 +1164,7 @@ foreach ($listofreferent as $key => $value) { for ($i = 0; $i < $num; $i++) { $tmp = explode('_', $elementarray[$i]); $idofelement = $tmp[0]; - $idofelementuser = $tmp[1]; + $idofelementuser = $tmp[1] ?? null; $element->fetch($idofelement); if ($idofelementuser) { @@ -1192,7 +1192,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_third = 0; $total_ttc_by_third = 0; } - $saved_third_id = $element->thirdparty->id; + $saved_third_id = $element->thirdparty->id ?? null; $qualifiedfortotal = true; if ($key == 'invoice') { @@ -1239,7 +1239,8 @@ foreach ($listofreferent as $key => $value) { $element_doc = $element->element; $filename = dol_sanitizeFileName($element->ref); - $filedir = $conf->{$element_doc}->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref); + $path = $conf?->{$element_doc}?->multidir_output[$element->entity] ?? null; + $filedir = $path.'/'.dol_sanitizeFileName($element->ref); if ($element_doc === 'order_supplier') { $element_doc = 'commande_fournisseur'; @@ -1489,7 +1490,8 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_third += $total_ht_by_line; $total_ttc_by_third += $total_ttc_by_line; - $total_time = $total_time + $total_time_by_line; + if (!isset($total_time)) $total_time = $total_time_by_line; + else $total_time += $total_time_by_line; } if (canApplySubtotalOn($tablename)) { From 9f54a981be57dc634e9e7ab66ada1cd04d9d523a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 30 May 2023 03:45:33 +0200 Subject: [PATCH 013/105] FIX Accountancy - Balance - Date param --- htdocs/accountancy/bookkeeping/balance.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 1670776ab6e..a8ab24f65f5 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -161,11 +161,11 @@ if (empty($reshook)) { if (!empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); } if (!empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); } if (!empty($search_doc_date)) { $filter['t.doc_date'] = $search_doc_date; @@ -177,7 +177,7 @@ if (empty($reshook)) { } else { $filter['t.numero_compte>='] = $search_accountancy_code_start; } - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); + $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); } if (!empty($search_accountancy_code_end)) { if ($type == 'sub') { @@ -185,7 +185,7 @@ if (empty($reshook)) { } else { $filter['t.numero_compte<='] = $search_accountancy_code_end; } - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); + $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); } if (!empty($search_ledger_code)) { $filter['t.code_journal'] = $search_ledger_code; From 5d2be9b475d9f9374bd2a00d673297af13d200a0 Mon Sep 17 00:00:00 2001 From: Jyhere Date: Tue, 30 May 2023 11:33:55 +0200 Subject: [PATCH 014/105] FIX: ref and label filters are not working on stocktodate page --- htdocs/product/stock/stockatdate.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 8a97d2f8478..ec8e3024a8f 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -289,6 +289,12 @@ if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (!empty($canvas)) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } +if ($search_ref) { + $sql .= " AND p.ref LIKE '%{$db->escape($search_ref)}%'"; +} +if ($search_nom) { + $sql .= " AND p.label LIKE '%{$db->escape($search_nom)}%'"; +} $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.pmp, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; $sql .= ' p.tms, p.duration, p.tobuy, p.stock'; // Add where from hooks From 121b707f45cd56252e7c9d7e8add2747c3fc176f Mon Sep 17 00:00:00 2001 From: Jyhere Date: Tue, 30 May 2023 11:40:00 +0200 Subject: [PATCH 015/105] FIX: name and ref should use naturalsearch function --- htdocs/product/stock/stockatdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index ec8e3024a8f..7d9fce8aa48 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -290,10 +290,10 @@ if (!empty($canvas)) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } if ($search_ref) { - $sql .= " AND p.ref LIKE '%{$db->escape($search_ref)}%'"; + $sql .= natural_search('p.ref', $search_ref); } if ($search_nom) { - $sql .= " AND p.label LIKE '%{$db->escape($search_nom)}%'"; + $sql .= natural_search('p.label', $search_nom); } $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.pmp, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; $sql .= ' p.tms, p.duration, p.tobuy, p.stock'; From f8a4dde4f19ced6410bd19beb3318bf026a39e5a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 30 May 2023 15:59:40 +0200 Subject: [PATCH 016/105] fix: Contract API class must return lines date --- htdocs/contrat/class/api_contracts.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 68ace23a26a..2becf6fcfb7 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -660,11 +660,6 @@ class Contracts extends DolibarrApi $object = parent::_cleanObjectDatas($object); unset($object->address); - - unset($object->date_start); - unset($object->date_start_real); - unset($object->date_end); - unset($object->date_end_real); unset($object->civility_id); return $object; From 20d89770d11bac107c8c843badba12f9707d75bf Mon Sep 17 00:00:00 2001 From: Roger Dueck Date: Tue, 30 May 2023 09:20:41 -0600 Subject: [PATCH 017/105] Fix undefined variable & array key warnings in forgotten password code" --- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- htdocs/user/passwordforgotten.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 6a54ee53e79..f2e72ef4fd2 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -27,7 +27,7 @@ if (empty($conf) || !is_object($conf)) { } // DDOS protection -$size = (int) $_SERVER['CONTENT_LENGTH']; +$size = (int) ($_SERVER['CONTENT_LENGTH'] ?? 0); if ($size > 10000) { $langs->loadLangs(array("errors", "install")); httponly_accessforbidden('
'.$langs->trans("ErrorRequestTooLarge").'
'.$langs->trans("ClickHereToGoToApp").'
', 413, 1); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 0298c6614fd..ad66bc5987a 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -84,7 +84,7 @@ $parameters = array('username' => $username); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { $message = $hookmanager->error; -} +} else $message = ''; if (empty($reshook)) { // Validate new password From ce923ee9e01d96aea67097883547d0b4eeb1928c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 09:19:02 +0200 Subject: [PATCH 018/105] Doc --- htdocs/install/check.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0e255969ee8..27cd0da3dd3 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -171,7 +171,7 @@ if (!function_exists("easter_date")) { print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; } -// Check if Curl is supported +// Check if Xml is supported if (!function_exists("simplexml_load_string")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Xml")."
\n"; @@ -200,7 +200,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc } } -// Check if Curl is supported +// Check if Imap is supported if (!function_exists("imap_open")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "IMAP")."
\n"; @@ -209,6 +209,7 @@ if (!function_exists("imap_open")) { print 'Ok '.$langs->trans("PHPSupport", "IMAP")."
\n"; } +// Check if Zip is supported if (!class_exists('ZipArchive')) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; From c61d96c98f576fd38b324c06b56238495f0a841c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 09:31:22 +0200 Subject: [PATCH 019/105] put phpmin info in one place --- htdocs/core/class/commondocgenerator.class.php | 6 ++++++ .../modules/asset/doc/doc_generic_asset_odt.modules.php | 7 ------- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 6 ------ .../core/modules/bom/doc/doc_generic_bom_odt.modules.php | 6 ------ .../modules/commande/doc/doc_generic_order_odt.modules.php | 6 ------ .../core/modules/commande/doc/pdf_eratosthene.modules.php | 6 ------ .../contract/doc/doc_generic_contract_odt.modules.php | 6 ------ htdocs/core/modules/contract/doc/pdf_strato.modules.php | 6 ------ htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 6 ------ htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 6 ------ .../expedition/doc/doc_generic_shipment_odt.modules.php | 6 ------ htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 6 ------ htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 ------ htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 6 ------ .../modules/expensereport/doc/pdf_standard.modules.php | 6 ------ .../facture/doc/doc_generic_invoice_odt.modules.php | 6 ------ htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 ------ htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 ------ htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 6 ------ .../modules/member/doc/doc_generic_member_odt.class.php | 6 ------ htdocs/core/modules/movement/doc/pdf_standard.modules.php | 6 ------ htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php | 6 ------ htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 6 ------ .../product/doc/doc_generic_product_odt.modules.php | 6 ------ htdocs/core/modules/product/doc/pdf_standard.modules.php | 6 ------ .../project/doc/doc_generic_project_odt.modules.php | 6 ------ htdocs/core/modules/project/doc/pdf_baleine.modules.php | 6 ------ htdocs/core/modules/project/doc/pdf_beluga.modules.php | 6 ------ htdocs/core/modules/project/doc/pdf_timespent.modules.php | 6 ------ .../project/task/doc/doc_generic_task_odt.modules.php | 6 ------ .../propale/doc/doc_generic_proposal_odt.modules.php | 6 ------ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 6 ------ htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 6 ------ .../reception/doc/doc_generic_reception_odt.modules.php | 6 ------ .../core/modules/societe/doc/doc_generic_odt.modules.php | 7 ------- .../modules/stock/doc/doc_generic_stock_odt.modules.php | 7 ------- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 6 ------ .../core/modules/stocktransfer/doc/pdf_eagle.modules.php | 6 ------ .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 6 ------ .../doc/doc_generic_supplier_invoice_odt.modules.php | 6 ------ .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 6 ------ .../doc/doc_generic_supplier_order_odt.modules.php | 6 ------ .../core/modules/supplier_order/doc/pdf_cornas.modules.php | 6 ------ .../modules/supplier_order/doc/pdf_muscadet.modules.php | 6 ------ .../modules/supplier_payment/doc/pdf_standard.modules.php | 6 ------ .../doc/doc_generic_supplier_proposal_odt.modules.php | 6 ------ .../modules/supplier_proposal/doc/pdf_aurore.modules.php | 6 ------ .../modules/ticket/doc/doc_generic_ticket_odt.modules.php | 6 ------ .../core/modules/user/doc/doc_generic_user_odt.modules.php | 6 ------ .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 6 ------ 50 files changed, 6 insertions(+), 297 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 11f2fca8226..4c0fda9cae0 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -106,6 +106,12 @@ abstract class CommonDocGenerator public $emetteur; + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 7.1 = array(7, 1) + */ + public $phpmin = array(7, 1); + /** * @var array Array of columns */ diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index a68b8fd2354..e281be6ff44 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -46,18 +46,11 @@ class doc_generic_asset_odt extends ModelePDFAsset */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ public $version = 'dolibarr'; - /** * Constructor * diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index d62a1eb6ada..75fb8025e42 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -68,12 +68,6 @@ class pdf_standard_asset extends ModelePDFAsset */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index d34844f14f2..ede4554e98a 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -46,12 +46,6 @@ class doc_generic_bom_odt extends ModelePDFBom */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 9172115903b..c4ecbee453c 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -46,12 +46,6 @@ class doc_generic_order_odt extends ModelePDFCommandes */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index ccb68a003bb..458cc39dd27 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -72,12 +72,6 @@ class pdf_eratosthene extends ModelePDFCommandes */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index aec1a96109a..a7cb5ada26c 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -44,12 +44,6 @@ class doc_generic_contract_odt extends ModelePDFContract */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 2f434af93a6..fe6f77b9b9a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -70,12 +70,6 @@ class pdf_strato extends ModelePDFContract */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index c84c9b7e6a0..fc55f6fe0f3 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -64,12 +64,6 @@ class pdf_storm extends ModelePDFDeliveryOrder */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index af2fda0f7a8..31c46438992 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -63,12 +63,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index bf264b45c94..6b7998a121c 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -46,12 +46,6 @@ class doc_generic_shipment_odt extends ModelePdfExpedition */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 9592330da2e..297013ed8ac 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -61,12 +61,6 @@ class pdf_espadon extends ModelePdfExpedition */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 130608be433..1d8e0c3f19e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -62,12 +62,6 @@ class pdf_merou extends ModelePdfExpedition */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index f7c6599647b..11635c6511b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -62,12 +62,6 @@ class pdf_rouget extends ModelePdfExpedition */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 5568cd28840..b8a58d3b517 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -69,12 +69,6 @@ class pdf_standard extends ModeleExpenseReport */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index cc9bc723635..f1e30925d3f 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -45,12 +45,6 @@ class doc_generic_invoice_odt extends ModelePDFFactures */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index c55b6ce36bc..7941815ee24 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -69,12 +69,6 @@ class pdf_crabe extends ModelePDFFactures */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 6a9877fbe3d..fbf1907ec7d 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -70,12 +70,6 @@ class pdf_sponge extends ModelePDFFactures */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index cd1cdf48f5e..d42f85cb3cf 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -64,12 +64,6 @@ class pdf_soleil extends ModelePDFFicheinter */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index f38f61e6d8a..b8cdb48a02f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -41,12 +41,6 @@ class doc_generic_member_odt extends ModelePDFMember */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 2d7a7e8f9fc..abdb0cc24af 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -62,12 +62,6 @@ class pdf_standard extends ModelePDFMovement */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 2f0c11d0649..ee0532fd949 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -46,12 +46,6 @@ class doc_generic_mo_odt extends ModelePDFMo */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index a36234b1026..e4d46662197 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -67,12 +67,6 @@ class pdf_vinci extends ModelePDFMo */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index ba98d74fb3f..1d5116addba 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -43,12 +43,6 @@ class doc_generic_product_odt extends ModelePDFProduct */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index b244f01e0fa..afcb9503997 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -57,12 +57,6 @@ class pdf_standard extends ModelePDFProduct */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 853060f3b2c..e3f2a54c6bc 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -83,12 +83,6 @@ class doc_generic_project_odt extends ModelePDFProjects */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 06f6e400b75..0a048837d7a 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -63,12 +63,6 @@ class pdf_baleine extends ModelePDFProjects */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 525c3bd2ece..b4ee7ec83b0 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -79,12 +79,6 @@ class pdf_beluga extends ModelePDFProjects */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 31a8127f733..c00ae37ab22 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -62,12 +62,6 @@ class pdf_timespent extends ModelePDFProjects */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 96a5b75c626..fe87287cf54 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -82,12 +82,6 @@ class doc_generic_task_odt extends ModelePDFTask */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 8a35edc7968..853329481fe 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -44,12 +44,6 @@ class doc_generic_proposal_odt extends ModelePDFPropales */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 093a8c5b6be..de872e9e43c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -73,12 +73,6 @@ class pdf_azur extends ModelePDFPropales */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 24ccb210f12..0870e860d16 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -66,12 +66,6 @@ class pdf_cyan extends ModelePDFPropales */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 463a794faee..76335afc7b5 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -41,12 +41,6 @@ class doc_generic_reception_odt extends ModelePdfReception */ public $emetteur; // Objet societe qui emet - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index e8d6c8317dc..c052401203c 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -42,13 +42,6 @@ class doc_generic_odt extends ModeleThirdPartyDoc */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - - /** * Constructor * diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 4ce652dd55b..612aa787dce 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -43,18 +43,11 @@ class doc_generic_stock_odt extends ModelePDFStock */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ public $version = 'dolibarr'; - /** * Constructor * diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index a5c1d87691d..338d81edc44 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -58,12 +58,6 @@ class pdf_standard extends ModelePDFStock */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 449bd69f17d..e9bcdad28b3 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -59,12 +59,6 @@ class pdf_eagle extends ModelePdfStockTransfer */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 123048bbb2d..69c1ed27a51 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -68,12 +68,6 @@ class pdf_eagle_proforma extends ModelePDFCommandes */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index 41ce5795ae6..94bb2d9fc0c 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -47,12 +47,6 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices */ public $issuer; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index e0a4e0694dd..39d2074d8e6 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -63,12 +63,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 8e40a21a1e4..a305403d6a6 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -47,12 +47,6 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders */ public $issuer; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * @var string Dolibarr version of the loaded document */ diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index c6e8434c955..cf94376b285 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -66,12 +66,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 31cee8d94ed..1206d91a794 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -66,12 +66,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index bede0cc948e..ec3ec568a30 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -64,12 +64,6 @@ class pdf_standard extends ModelePDFSuppliersPayments */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 6a8ecbc28c6..fd71e68e003 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -44,12 +44,6 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 95b661364ad..046c72cd06b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -63,12 +63,6 @@ class pdf_aurore extends ModelePDFSupplierProposal */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index de316dbc4b1..2d9f9a9e9ae 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -41,12 +41,6 @@ class doc_generic_ticket_odt extends ModelePDFTicket */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 81328821261..f1a7ca0f2a3 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -41,12 +41,6 @@ class doc_generic_user_odt extends ModelePDFUser */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 5ff9d4c8526..7c86061b057 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -44,12 +44,6 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup */ public $emetteur; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string From 3d6c899de2937f11bda9d1fe9c9e029ebb3a928e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 09:32:51 +0200 Subject: [PATCH 020/105] put phpmin info in one place --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 20e738f14c8..9f8008dda11 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -72,12 +72,6 @@ class pdf_einstein extends ModelePDFCommandes */ public $type; - /** - * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 7.0 = array(7, 0) - */ - public $phpmin = array(7, 0); - /** * Dolibarr version of the loaded document * @var string From cb9eac9047186ba062679341869e59e8aa9b3519 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Wed, 31 May 2023 12:13:50 +0200 Subject: [PATCH 021/105] FIX: dol_trunc may not have the desired behaviour for truncating a cryptographic initialiszation vector, for instance when MAIN_DISABLE_TRUNC is used --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 97abd91d8b2..52e7a975338 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -152,7 +152,7 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = if (empty($forceseed)) { $ivseed = dolGetRandomBytes($ivlen); } else { - $ivseed = dol_trunc(md5($forceseed), $ivlen, 'right', 'UTF-8', 1); + $ivseed = dol_substr(md5($forceseed), 0, $ivlen, 'ascii', 1); } $newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed); From 3f066ff6fb45abeb67446419b74f47503ec0d782 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 May 2023 13:14:03 +0200 Subject: [PATCH 022/105] Clean code --- htdocs/core/class/CMailFile.class.php | 1 + htdocs/core/class/smtps.class.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 65494e09e11..92acf87898a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1007,6 +1007,7 @@ class CMailFile $this->dump_mail(); } + $smtperrorcode = 0; if (! $result) { $smtperrorcode = $this->smtps->lastretval; // SMTP error code dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 7133167b4dd..ee886b5bb83 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1140,10 +1140,8 @@ class SMTPs /** * Inserts given addresses into structured format. - * This method takes a list of given addresses, via an array - * or a COMMA delimted string, and inserts them into a highly - * structured array. This array is designed to remove duplicate - * addresses and to sort them by Domain. + * This method takes a list of given addresses, via an array or a COMMA delimted string, and inserts them into a highly + * structured array. This array is designed to remove duplicate addresses and to sort them by Domain. * * @param string $_type TO, CC, or BCC lists to add addrresses into * @param mixed $_addrList Array or COMMA delimited string of addresses @@ -1245,7 +1243,9 @@ class SMTPs } // Pull User Name and Host.tld apart - list($_aryEmail['user'], $_aryEmail['host']) = explode('@', $_aryEmail['addr']); + $_tmpHost = explode('@', $_aryEmail['addr']); + $_aryEmail['user'] = $_tmpHost[0]; + $_aryEmail['host'] = $_tmpHost[1]; // Put the brackets back around the address $_aryEmail['addr'] = '<'.$_aryEmail['addr'].'>'; From 544e82b60c1d2600cbdaaa44b8b731b8bf6cc470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 13:35:47 +0200 Subject: [PATCH 023/105] fix picto tooltip --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2f58c5576c7..1c0e1dd3a34 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3753,7 +3753,7 @@ class Commande extends CommonOrder if ($user->hasRight('commande', 'lire')) { $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Order").''; if (isset($this->statut)) { - $datas[] = ' '.$this->getLibStatut(5); + $datas['picto'] .= ' '.$this->getLibStatut(5); } $datas['Ref'] = '
'.$langs->trans('Ref').': '.$this->ref; if (!$nofetch) { From 8c0f7f4b65e8c65b7d673d41fc32e394ba7e261b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 13:53:41 +0200 Subject: [PATCH 024/105] Update commande.class.php --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1c0e1dd3a34..bb162e3c835 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3753,7 +3753,7 @@ class Commande extends CommonOrder if ($user->hasRight('commande', 'lire')) { $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Order").''; if (isset($this->statut)) { - $datas['picto'] .= ' '.$this->getLibStatut(5); + $datas['status'] = ' '.$this->getLibStatut(5); } $datas['Ref'] = '
'.$langs->trans('Ref').': '.$this->ref; if (!$nofetch) { From 2752154f9bfdf0a7b6658b294926eed7513af588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 13:56:41 +0200 Subject: [PATCH 025/105] Update propal.class.php --- htdocs/comm/propal/class/propal.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b3f3d387df3..d7fb02e14f3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3721,6 +3721,7 @@ class Propal extends CommonObject { global $conf, $langs, $user; + $langs->load('propal'); $datas = []; $nofetch = !empty($params['nofetch']); From f4eecdc8e3c739e30d5fcb4665888866a343df7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 May 2023 14:02:05 +0200 Subject: [PATCH 026/105] Debug v18 --- htdocs/core/class/html.form.class.php | 70 +++++++++++----------- htdocs/core/lib/company.lib.php | 83 ++++++++++++++++++++------- 2 files changed, 97 insertions(+), 56 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d18404921a8..d8fddfd28bd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1706,22 +1706,22 @@ class Form /** * Return list of all contacts (for a third party or all) * - * @param int $socid Id ot third party or 0 for all - * @param string $selected Id contact pre-selectionne - * @param string $htmlname Name of HTML field ('none' for a not editable field) - * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list - * @param string $exclude List of contacts id to exclude - * @param string $limitto Disable answers that are not id in this array list - * @param integer $showfunction Add function into label - * @param string $morecss Add more class to class style - * @param integer $showsoc Add company into label - * @param int $forcecombo Force to use combo box - * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) - * @param bool $options_only Return options only (for ajax treatment) - * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container - * @param string $htmlid Html id to use instead of htmlname - * @return int <0 if KO, Nb of contact in list if OK - * @deprecated You can use selectcontacts directly (warning order of param was changed) + * @param int $socid Id ot third party or 0 for all + * @param string $selected Id contact pre-selectionne + * @param string $htmlname Name of HTML field ('none' for a not editable field) + * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list + * @param string $exclude List of contacts id to exclude + * @param string $limitto Disable answers that are not id in this array list + * @param integer $showfunction Add function into label + * @param string $morecss Add more class to class style + * @param integer $showsoc Add company into label + * @param int $forcecombo Force to use combo box + * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param bool $options_only Return options only (for ajax treatment) + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $htmlid Html id to use instead of htmlname + * @return int <0 if KO, Nb of contact in list if OK + * @deprecated You can use selectcontacts directly (warning order of param was changed) */ public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '') { @@ -1731,28 +1731,28 @@ class Form } /** - * Return HTML code of the SELECT of list of all contacts (for a third party or all). - * This also set the number of contacts found into $this->num + * Return HTML code of the SELECT of list of all contacts (for a third party or all). + * This also set the number of contacts found into $this->num * * @since 9.0 Add afterSelectContactOptions hook * - * @param int $socid Id ot third party or 0 for all or -1 for empty list - * @param array|int $selected Array of ID of pre-selected contact id - * @param string $htmlname Name of HTML field ('none' for a not editable field) - * @param int|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list - * @param string $exclude List of contacts id to exclude - * @param string $limitto Disable answers that are not id in this array list - * @param integer $showfunction Add function into label - * @param string $morecss Add more class to class style - * @param bool $options_only Return options only (for ajax treatment) - * @param integer $showsoc Add company into label - * @param int $forcecombo Force to use combo box (so no ajax beautify effect) - * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) - * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container - * @param string $htmlid Html id to use instead of htmlname - * @param bool $multiple add [] in the name of element and add 'multiple' attribut - * @param integer $disableifempty Set tag 'disabled' on select if there is no choice - * @return int|string <0 if KO, HTML with select string if OK. + * @param int $socid Id ot third party or 0 for all or -1 for empty list + * @param array|int $selected Array of ID of pre-selected contact id + * @param string $htmlname Name of HTML field ('none' for a not editable field) + * @param int|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list + * @param string $exclude List of contacts id to exclude + * @param string $limitto Disable answers that are not id in this array list + * @param integer $showfunction Add function into label + * @param string $morecss Add more class to class style + * @param bool $options_only Return options only (for ajax treatment) + * @param integer $showsoc Add company into label + * @param int $forcecombo Force to use combo box (so no ajax beautify effect) + * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $htmlid Html id to use instead of htmlname + * @param bool $multiple add [] in the name of element and add 'multiple' attribut + * @param integer $disableifempty Set tag 'disabled' on select if there is no choice + * @return int|string <0 if KO, HTML with select string if OK. */ public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 83fdc6bc043..46f4bdf4b2f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1097,9 +1097,12 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print ''; print ''; + $arrayofmassactions = array(); + $mode = 'view'; + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - //if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print "\n".''."\n"; @@ -1199,6 +1202,12 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Fields title search // -------------------------------------------------------------------- print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } foreach ($contactstatic->fields as $key => $val) { $align = ''; if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -1241,15 +1250,21 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } print ''."\n"; // Fields title label // -------------------------------------------------------------------- print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; + } foreach ($contactstatic->fields as $key => $val) { $align = ''; if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -1281,7 +1296,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; + } print ''."\n"; $i = -1; @@ -1331,6 +1349,27 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print ''; + // Actions + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + // ID if (!empty($arrayfields['t.rowid']['checked'])) { print ''; } - // Edit - if ($user->hasRight('societe', 'contact', 'creer')) { - print ''; - print img_edit(); - print ''; - } - - print ''; - print "\n"; $i++; } From 8d3f1ca9c22691349063fff7f5eaa3a17a4bb2fd Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 31 May 2023 15:15:26 +0200 Subject: [PATCH 027/105] Remove unexisting massaction --- htdocs/commande/list_det.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 166afaeb5b3..7af49aae108 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -813,7 +813,7 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - 'GenerateOrdersSuppliers'=>img_picto('', 'doc', 'class="pictofixedwidth"').$langs->trans("GenerateOrdersSupplie"), + // TODO add mass action here ); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From 44996553a0684ca1426055033237cb3df71393de Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 31 May 2023 15:36:29 +0200 Subject: [PATCH 028/105] get shippable status for line, so you know which line is shippable (no need to loop order lines) --- htdocs/commande/list_det.php | 130 +++++++++++++++++------------------ 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 7af49aae108..8c1b78ae863 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1995,83 +1995,79 @@ if ($resql) { print ''; + print ''; } } From 6c8b5d489f61f6816f3a7d72362eee23dd9e3aa5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2023 11:20:24 +0200 Subject: [PATCH 043/105] NEW Add option MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS --- htdocs/admin/system/security.php | 2 +- htdocs/core/actions_linkedfiles.inc.php | 22 ++++++++++++++++++- .../connectors/php/config.inc.php | 2 +- htdocs/langs/en_US/errors.lang | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 03aa1b19d76..8c50799ef64 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -507,7 +507,7 @@ print '
'; print load_fiche_titre($langs->trans("OtherSetup"), '', 'folder'); -print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).'   ('.$langs->trans("Recommended").': 0)
'; +print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_IMAGES', '0').'   ('.$langs->trans("Recommended").': 0)
'; print '
'; print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).'   ('.$langs->trans("Recommended").': 1)
'; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 4e2cd2873b6..8858456a5f6 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -92,7 +92,27 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !emp if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { $link = 'http://'.$link; } - dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0); + + // Parse $newUrl + $newUrlArray = parse_url($link); + + // Check URL is external + if (!getDolGlobalString('MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS')) { + if (!empty($newUrlArray['path']) && preg_match('/\.svg/i', $newUrlArray['path'])) { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans('ErrorSVGFilesNotAllowedAsLinksWithout', 'MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS'), null, 'errors'); + } + } + // Alow external links to svg ? + if (!getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS')) { + // Test $newUrlAray['host'] to check link is external + // TODO + } + + if (!$error) { + dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0); + } } } diff --git a/htdocs/core/filemanagerdol/connectors/php/config.inc.php b/htdocs/core/filemanagerdol/connectors/php/config.inc.php index 368b82c42e7..7407ab706a7 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.inc.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.inc.php @@ -160,7 +160,7 @@ $Config['QuickUploadPath']['File'] = $Config['UserFilesPath']; $Config['QuickUploadAbsolutePath']['File'] = $Config['UserFilesAbsolutePath']; $Config['AllowedExtensions']['Image'] = array('bmp', 'gif', 'jpeg', 'jpg', 'png', 'ai'); -if (!empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) { +if (getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_IMAGES')) { $Config['AllowedExtensions']['Image'][] = 'svg'; } $Config['DeniedExtensions']['Image'] = array(); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b3eeae4606b..5d3f6a43392 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -303,6 +303,7 @@ ErrorValueForTooLow=Value for %s is too low ErrorValueCantBeNull=Value for %s can't be null ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission ErrorTooMuchFileInForm=Too much files in form, the maximum number is %s file(s) +ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without option %s # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. From 557a5ea35f4c29eeb8491fa557aebfb69f9cb189 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2023 11:28:43 +0200 Subject: [PATCH 044/105] Fix bad var --- htdocs/core/actions_linkedfiles.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 8858456a5f6..fe8b8bf3543 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -97,15 +97,15 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !emp $newUrlArray = parse_url($link); // Check URL is external - if (!getDolGlobalString('MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS')) { + if (!getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS')) { if (!empty($newUrlArray['path']) && preg_match('/\.svg/i', $newUrlArray['path'])) { $error++; $langs->load("errors"); - setEventMessages($langs->trans('ErrorSVGFilesNotAllowedAsLinksWithout', 'MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS'), null, 'errors'); + setEventMessages($langs->trans('ErrorSVGFilesNotAllowedAsLinksWithout', 'MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS'), null, 'errors'); } } // Alow external links to svg ? - if (!getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS')) { + if (!getDolGlobalString('MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS')) { // Test $newUrlAray['host'] to check link is external // TODO } From 51708f4d707fa3667f586d72d458c4b03106bd62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2023 11:31:24 +0200 Subject: [PATCH 045/105] Ad option MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS in security page --- htdocs/admin/system/security.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 4229a6def80..cc564fdc5d4 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -631,6 +631,11 @@ print '
'; print 'MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS = '.getDolGlobalString('MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)')."
"; print '
'; +print 'MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS = '.getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)')."
"; +print '
'; + +// MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS + print 'MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL = '.getDolGlobalString('MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)')."
"; print '
'; From 4ec2a5eba9875fa4199138a4a7756976e99b7c96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2023 12:06:15 +0200 Subject: [PATCH 046/105] Clean code to prepare reuse of common code --- htdocs/core/lib/geturl.lib.php | 112 +++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 48 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 4b1b3677e46..6255bd81710 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -186,7 +186,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } elseif (in_array($hosttocheck, array('ip6-localhost', 'ip6-loopback'))) { $iptocheck = '::1'; } else { - // Resolve $hosttocheck to get the IP $iptocheck and set CURLOPT_CONNECT_TO to use this ip so curl will not try another resolution that may give a different result + // Resolve $hosttocheck to get the IP $iptocheck if (function_exists('gethostbyname')) { $iptocheck = gethostbyname($hosttocheck); } else { @@ -201,55 +201,15 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } if ($iptocheck) { - if ($localurl == 0) { // Only external url allowed (dangerous, may allow to get malware) - if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { - // Deny ips like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (private or reserved range). Must be an external URL.'; - break; - } - if (!empty($_SERVER["SERVER_ADDR"]) && $iptocheck == $_SERVER["SERVER_ADDR"]) { - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (IP is a local IP). Must be an external URL.'; - break; - } - if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (IP is a local IP defined into MAIN_SECURITY_SERVER_IP). Must be an external URL.'; - break; - } - } - if ($localurl == 1) { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) - // Deny ips NOT like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... - if (filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname '.$iptocheck.'. Must be a local URL.'; - break; - } - if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (IP is not a local IP defined into list MAIN_SECURITY_SERVER_IP). Must be a local URL in allowed list.'; - break; - } - } - - // Common check on ip (local and external) - // See list on https://tagmerge.com/gist/a7b9d57ff8ec11d63642f8778609a0b8 - // Not evasive url that ar enot IP are excluded by test on IP v4/v6 validity. - $arrayofmetadataserver = array( - '100.100.100.200' => 'Alibaba', - '192.0.0.192' => 'Oracle', - '192.80.8.124' => 'Packet', - '100.88.222.5' => 'Tencent cloud', - ); - foreach ($arrayofmetadataserver as $ipofmetadataserver => $nameofmetadataserver) { - if ($iptocheck == $ipofmetadataserver) { - $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (Used by '.$nameofmetadataserver.' metadata server). This IP is forbidden.'; - break 2; // exit the foreach and the do... - } + $tmpresult = isIPAllowed($iptocheck, $localurl); + if ($tmpresult) { + $info['http_code'] = 400; + $info['content'] = $tmpresult; + break; } + } + if ($iptocheck) { // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+ if (defined('CURLOPT_CONNECT_TO')) { $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], empty($newUrlArray['port'])?'':$newUrlArray['port'], $iptocheck, empty($newUrlArray['port'])?'':$newUrlArray['port'])); @@ -317,6 +277,62 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = return $rep; } +/** + * Is IP allowed + * + * @param string $iptocheck IP to check + * @param int $localurl 0=external url only, 1=internal url only + * @return string Error message or '' + */ +function isIPAllowed($iptocheck, $localurl) +{ + global $conf; + + if ($localurl == 0) { // Only external url allowed (dangerous, may allow to get malware) + if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { + // Deny ips like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... + $errormsg = 'Error bad hostname IP (private or reserved range). Must be an external URL.'; + return $errormsg; + } + if (!empty($_SERVER["SERVER_ADDR"]) && $iptocheck == $_SERVER["SERVER_ADDR"]) { + $errormsg = 'Error bad hostname IP (IP is a local IP). Must be an external URL.'; + return $errormsg; + } + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + $errormsg = 'Error bad hostname IP (IP is a local IP defined into MAIN_SECURITY_SERVER_IP). Must be an external URL.'; + return $errormsg; + } + } + if ($localurl == 1) { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) + // Deny ips NOT like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... + if (filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { + $errormsg = 'Error bad hostname '.$iptocheck.'. Must be a local URL.'; + return $errormsg; + } + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + $errormsg = 'Error bad hostname IP (IP is not a local IP defined into list MAIN_SECURITY_SERVER_IP). Must be a local URL in allowed list.'; + return $errormsg; + } + } + + // Common check on ip (local and external) + // See list on https://tagmerge.com/gist/a7b9d57ff8ec11d63642f8778609a0b8 + // Not evasive url that ar enot IP are excluded by test on IP v4/v6 validity. + $arrayofmetadataserver = array( + '100.100.100.200' => 'Alibaba', + '192.0.0.192' => 'Oracle', + '192.80.8.124' => 'Packet', + '100.88.222.5' => 'Tencent cloud', + ); + foreach ($arrayofmetadataserver as $ipofmetadataserver => $nameofmetadataserver) { + if ($iptocheck == $ipofmetadataserver) { + $errormsg = 'Error bad hostname IP (Used by '.$nameofmetadataserver.' metadata server). This IP is forbidden.'; + return $errormsg; + } + } + + return ''; +} /** * Function get second level domain name. From 8d7e53a98c4246d4941d5599d551a592d87073f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jun 2023 13:56:06 +0200 Subject: [PATCH 047/105] Clean code --- .../actions_adherentcard_common.class.php | 9 +++--- htdocs/adherents/card.php | 2 +- htdocs/adherents/subscription/card.php | 4 +-- htdocs/adherents/type.php | 6 ++-- htdocs/comm/action/card.php | 2 +- htdocs/compta/payment_sc/card.php | 20 +++++-------- htdocs/compta/payment_vat/card.php | 19 ++++-------- htdocs/compta/tva/class/paymentvat.class.php | 6 ++-- .../actions_contactcard_common.class.php | 2 +- htdocs/core/lib/functions.lib.php | 30 ++++++++++++++----- htdocs/core/lib/security.lib.php | 7 +++-- .../class/actions_datapolicy.class.php | 2 +- htdocs/delivery/card.php | 6 ++-- htdocs/don/payment/card.php | 4 +-- htdocs/expedition/card.php | 3 +- htdocs/expedition/shipment.php | 4 --- htdocs/expensereport/payment/card.php | 10 +++---- htdocs/externalsite/admin/index.php | 4 +-- htdocs/fourn/paiement/card.php | 4 +-- .../product/actions_card_product.class.php | 4 +-- .../canvas/product/tpl/card_view.tpl.php | 18 +++++------ .../service/actions_card_service.class.php | 2 +- .../canvas/service/tpl/card_view.tpl.php | 2 +- htdocs/public/members/public_card.php | 2 +- htdocs/salaries/payment_salary/card.php | 2 +- htdocs/zapier/class/api_zapier.class.php | 7 ----- test/phpunit/SecurityTest.php | 8 +++++ 27 files changed, 96 insertions(+), 93 deletions(-) diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 74330c65ccd..84ae98ac3c5 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -216,7 +216,7 @@ abstract class ActionsAdherentCardCommon $this->tpl['visibility'] = $this->object->getmorphylib($this->object->morphy); - $this->tpl['note'] = nl2br($this->object->note); + $this->tpl['note'] = $this->object->note_private; } if ($action == 'create_user') { @@ -251,7 +251,8 @@ abstract class ActionsAdherentCardCommon $this->object->old_name = GETPOST("old_name"); $this->object->old_firstname = GETPOST("old_firstname"); - $this->object->fk_soc = GETPOST("fk_soc"); + $this->object->fk_soc = GETPOST("fk_soc", 'int'); + $this->object->socid = GETPOST("fk_soc", 'int'); $this->object->lastname = GETPOST("lastname"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); @@ -262,8 +263,8 @@ abstract class ActionsAdherentCardCommon $this->object->state_id = GETPOST("state_id", 'int'); $this->object->phone_perso = GETPOST("phone_perso"); $this->object->phone_mobile = GETPOST("phone_mobile"); - $this->object->email = GETPOST("email", 'alphawithlgt'); - $this->object->note = GETPOST("note", 'restricthtml'); + $this->object->email = GETPOST("email", 'alphawithlgt'); + $this->object->note_private = GETPOST("note", 'restricthtml'); $this->object->canvas = GETPOST("canvas"); // We set country_id, and country_code label of the chosen country diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5816c5c4ea1..598e24ee220 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -316,7 +316,7 @@ if (empty($reshook)) { $object->birth = $birthdate; $object->default_lang = GETPOST('default_lang', 'alpha'); $object->typeid = GETPOST("typeid", 'int'); - //$object->note = trim(GETPOST("comment","alpha")); + //$object->note = trim(GETPOST("comment", "restricthtml")); $object->morphy = GETPOST("morphy", 'alpha'); if (GETPOST('deletephoto', 'alpha')) { diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index d6ce54a20e9..1278c6b2dfc 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -228,7 +228,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'edit') { // Label print '
'; + print ''; // Bank line if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) { @@ -324,7 +324,7 @@ if ($rowid && $action != 'edit') { print ''; // Label - print ''; + print ''; // Bank line if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) { diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 52c16a8ce4b..988693a8d26 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -537,10 +537,12 @@ if ($rowid > 0) { print ''; print '"; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); + print ""; print '"; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->mail_valid)); + print ""; // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 17f77a6f644..e6c4ac3060d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2415,7 +2415,7 @@ if ($id > 0) { } // Description - print ''; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 11f7f1e454f..8d89326d2c2 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -55,7 +55,7 @@ if ($id > 0) { } } -$result = restrictedArea($user, 'payment_sc', $id, ''); +$result = restrictedArea($user, 'payment_sc', $object, ''); /* @@ -130,26 +130,20 @@ print '
'; print '
'; + print $form->showFilterButtons(); + print ''; - print $form->showFilterButtons(); - print ''; + print $form->showFilterButtons(); + print '
'; + + // Add to agenda + if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) { + print ''; + print img_object($langs->trans("Event"), "action"); + print '   '; + } + + // Edit + if ($user->hasRight('societe', 'contact', 'creer')) { + print ''; + print img_edit(); + print ''; + } + + print ''; @@ -1406,24 +1445,26 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Actions - print ''; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; - // Add to agenda - if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) { - print ''; - print img_object($langs->trans("Event"), "action"); - print '   '; + // Add to agenda + if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) { + print ''; + print img_object($langs->trans("Event"), "action"); + print '   '; + } + + // Edit + if ($user->hasRight('societe', 'contact', 'creer')) { + print ''; + print img_edit(); + print ''; + } + + print '
'; if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) { if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) { - $generic_commande->getLinesArray(); // Load array ->lines $generic_commande->loadExpeditions(); // Load array ->expeditions - $numlines = count($generic_commande->lines); // Loop on each line of order - for ($lig = 0; $lig < $numlines; $lig++) { - if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) { - $reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id]; + if (isset($generic_commande->expeditions[$obj->rowid])) { + $reliquat = $obj->qty - $generic_commande->expeditions[$obj->rowid]; + } else { + $reliquat = $obj->qty; + } + if ($obj->product_type == 0 && $obj->fk_product > 0) { // If line is a product and not a service + $nbprod++; // order contains real products + $generic_product->id = $obj->fk_product; + + // Get local and virtual stock and store it into cache + if (empty($productstat_cache[$obj->fk_product])) { + $generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock() + $productstat_cache[$obj->fk_product]['stock_reel'] = $generic_product->stock_reel; + $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique; } else { - $reliquat = $generic_commande->lines[$lig]->qty; + $generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel']; + $generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique; } - if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) { // If line is a product and not a service - $nbprod++; // order contains real products - $generic_product->id = $generic_commande->lines[$lig]->fk_product; - // Get local and virtual stock and store it into cache - if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) { - $generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock() - $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel; - $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; - } else { - $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel']; - $generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; - } - - if ($reliquat > $generic_product->stock_reel) { - $notshippable++; - } - if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { // Default code. Default should be this case. - $text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->product_ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 20); - $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel.''; - $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique.''; - $text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' ('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')' : ''); - $text_info .= '
'; - } else { // BUGGED CODE. - // DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE. - // COUNT STOCK WHEN WE SHOULD ALREADY HAVE VALUE - // Detailed virtual stock, looks bugged, uncomplete and need heavy load. - // stock order and stock order_supplier - $stock_order = 0; - $stock_order_supplier = 0; - if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? - if (!empty($conf->commande->enabled)) { - if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { - $generic_product->load_stats_commande(0, '1,2'); - $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; - } else { - $generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer']; - } - $stock_order = $generic_product->stats_commande['qty']; + if ($reliquat > $generic_product->stock_reel) { + $notshippable++; + } + if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { // Default code. Default should be this case. + $text_info .= $reliquat.' x '.$obj->product_ref.' '.dol_trunc($obj->product_label, 20); + $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel.''; + $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique.''; + $text_info .= ($reliquat != $obj->qty ? ' ('.$langs->trans("QtyInOtherShipments").' '.($obj->qty - $reliquat).')' : ''); + $text_info .= '
'; + } else { // BUGGED CODE. + // DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE. + // COUNT STOCK WHEN WE SHOULD ALREADY HAVE VALUE + // Detailed virtual stock, looks bugged, uncomplete and need heavy load. + // stock order and stock order_supplier + $stock_order = 0; + $stock_order_supplier = 0; + if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? + if (!empty($conf->commande->enabled)) { + if (empty($productstat_cache[$obj->fk_product]['stats_order_customer'])) { + $generic_product->load_stats_commande(0, '1,2'); + $productstat_cache[$obj->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; + } else { + $generic_product->stats_commande['qty'] = $productstat_cache[$obj->fk_product]['stats_order_customer']; } - if (isModEnabled('supplier_order')) { - if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { - $generic_product->load_stats_commande_fournisseur(0, '3'); - $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; - } else { - $generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier']; - } - $stock_order_supplier = $generic_product->stats_commande_fournisseur['qty']; - } - } - $text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 20); - $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order; - if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) { - $warning++; - $text_warning .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; - } - if ($reliquat > $generic_product->stock_reel) { - $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; - } else { - $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; + $stock_order = $generic_product->stats_commande['qty']; } if (isModEnabled('supplier_order')) { - $text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier; + if (empty($productstat_cache[$obj->fk_product]['stats_order_supplier'])) { + $generic_product->load_stats_commande_fournisseur(0, '3'); + $productstat_cache[$obj->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; + } else { + $generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$obj->fk_product]['stats_order_supplier']; + } + $stock_order_supplier = $generic_product->stats_commande_fournisseur['qty']; } - $text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' ('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')' : ''); - $text_info .= '
'; } + $text_info .= $reliquat.' x '.$obj->product_ref.' '.dol_trunc($obj->product_label, 20); + $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order; + if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $obj->qty)) { + $warning++; + $text_warning .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; + } + if ($reliquat > $generic_product->stock_reel) { + $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; + } else { + $text_info .= ''.$langs->trans('Available').' : '.$text_stock_reel.''; + } + if (isModEnabled('supplier_order')) { + $text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier; + } + $text_info .= ($reliquat != $obj->qty ? ' ('.$langs->trans("QtyInOtherShipments").' '.($obj->qty - $reliquat).')' : ''); + $text_info .= '
'; } } if ($notshippable == 0) { From 1484ac243f1af7a319a44bf9a7fcb9c848682616 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 31 May 2023 15:36:42 +0200 Subject: [PATCH 029/105] Fix translation --- htdocs/langs/en_US/orders.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 4be2b34fd73..9165e8b5b66 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -99,7 +99,7 @@ ListOfOrders=List of orders ListOrderLigne=Lines of orders productobuy=Products to buy only productonly=Products only -disablelinefree=No lines free +disablelinefree=No free lines CloseOrder=Close order ConfirmCloseOrder=Are you sure you want to set this order to delivered? Once an order is delivered, it can be set to billed. ConfirmDeleteOrder=Are you sure you want to delete this order? From a322ba85fe5684755000668bbc5c13bd3319252b Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 31 May 2023 15:43:24 +0200 Subject: [PATCH 030/105] Only show subtotal when sorted by product. --- htdocs/commande/list_det.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 8c1b78ae863..c4610916e94 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1436,7 +1436,8 @@ if ($resql) { if (empty($i)) { $oldref = $obj->product_ref; } - if ($oldref != $obj->product_ref) { + if ($oldref != $obj->product_ref && $sortfield == 'pr.ref') { + // TODO make new /core/tpl/list_print_sub_total.php include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $oldref = $obj->product_ref; } From ba646d19233acbab43da62e1c171e22f3928c028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 May 2023 18:11:12 +0200 Subject: [PATCH 031/105] 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 f7a993fd38f..8561b7e252f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -793,7 +793,8 @@ abstract class CommonObject $hookmanager->initHooks(array($this->element . 'dao')); $parameters = array( - 'tooltipcontentarray' => &$datas + 'tooltipcontentarray' => &$datas, + 'params' => $params, ); // Note that $action and $object may have been modified by some hooks $hookmanager->executeHooks('getTooltipContent', $parameters, $this, $action); From 735ad3d53341886b8489aa68d078a8526dadd8fc Mon Sep 17 00:00:00 2001 From: Je2fb <46494485+Je2fb@users.noreply.github.com> Date: Wed, 31 May 2023 21:36:11 +0200 Subject: [PATCH 032/105] Update commande.class.php Change function hasdelay and showdelay to use the variable 'delivery_date' --- htdocs/commande/class/commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a37fa4575c6..6acab5152f1 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4120,7 +4120,7 @@ class Commande extends CommonOrder $now = dol_now(); - return max($this->date, $this->date_livraison) < ($now - $conf->commande->client->warning_delay); + return max($this->date, $this->delivery_date) < ($now - $conf->commande->client->warning_delay); } /** @@ -4132,7 +4132,7 @@ class Commande extends CommonOrder { global $conf, $langs; - if (empty($this->date_livraison)) { + if (empty($this->delivery_date)) { $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); } else { $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_livraison, 'day'); From 42519bd4fc0bed83c9425c051841c95313ad41a1 Mon Sep 17 00:00:00 2001 From: kev-73 <69631660+kev-73@users.noreply.github.com> Date: Thu, 1 Jun 2023 08:48:50 +0200 Subject: [PATCH 033/105] NEW : add field 'ref' (of supplier) for import supplier PO lines When import supplier PO lines, the field 'ref' for supplier product ref is not available. If we not use database products, and we want use "free line" for type "product", this field is important. --- htdocs/core/modules/modFournisseur.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index c1d50648b24..9283f85660e 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -814,6 +814,7 @@ class modFournisseur extends DolibarrModules 'cd.fk_commande' => 'PurchaseOrder*', 'cd.fk_parent_line' => 'ParentLine', 'cd.fk_product' => 'IdProduct', + 'cd.ref' => 'Ref', 'cd.description' => 'LineDescription', 'cd.tva_tx' => 'LineVATRate', 'cd.qty' => 'LineQty', From 93682620424daf184bc14e585fc12c3c96295c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Jun 2023 09:23:59 +0200 Subject: [PATCH 034/105] min php is 7.1 for check --- htdocs/install/check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0e255969ee8..ba63a665a25 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -83,7 +83,7 @@ if (!empty($useragent)) { // Check PHP version min $arrayphpminversionerror = array(5, 6, 0); -$arrayphpminversionwarning = array(7, 0, 0); +$arrayphpminversionwarning = array(7, 1, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { // Minimum to use (error if lower) print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); $checksok = 0; // 0=error, 1=warning From 9861b50ede694b0dd89121925403274bf624acc9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 Jun 2023 11:49:56 +0200 Subject: [PATCH 035/105] fix: use CONST of TYPE of CommonInvoice rather than hard coded value --- htdocs/core/class/discount.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 9f5ea960c9a..c66bd73b96e 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -366,13 +366,14 @@ class DiscountAbsolute $sql .= " AND fk_invoice_supplier IS NULL)"; // Not used as credit note and not used as deposit dol_syslog(get_class($this)."::delete Delete discount", LOG_DEBUG); + require_once DOL_DOCUMENT_ROOT. '/core/class/commoninvoice.class.php'; $result = $this->db->query($sql); if ($result) { // If source of discount was a credit note or deposit, we change source statut. if ($this->fk_facture_source) { $sql = "UPDATE ".$this->db->prefix()."facture"; $sql .= " set paye=0, fk_statut=1"; - $sql .= " WHERE (type = 2 or type = 3) AND rowid = ".((int) $this->fk_facture_source); + $sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_facture_source); dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG); $result = $this->db->query($sql); @@ -387,7 +388,7 @@ class DiscountAbsolute } elseif ($this->fk_invoice_supplier_source) { $sql = "UPDATE ".$this->db->prefix()."facture_fourn"; $sql .= " set paye=0, fk_statut=1"; - $sql .= " WHERE (type = 2 or type = 3) AND rowid = ".((int) $this->fk_invoice_supplier_source); + $sql .= " WHERE (type IN (".$this->db->sanitize(CommonInvoice::TYPE_CREDIT_NOTE.", ".CommonInvoice::TYPE_DEPOSIT).") AND rowid = ".((int) $this->fk_invoice_supplier_source); dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG); $result = $this->db->query($sql); @@ -573,12 +574,12 @@ class DiscountAbsolute $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture as f"; $sql .= " WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = ".((int) $invoice->id); - $sql .= " AND f.type = 3"; + $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; } elseif ($invoice->element == 'invoice_supplier') { $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture_fourn as f"; $sql .= " WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = ".((int) $invoice->id); - $sql .= " AND f.type = 3"; + $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; } else { $this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter"; dol_print_error($this->error); From 6920f390186a4b59b534860693fa747fc1528535 Mon Sep 17 00:00:00 2001 From: jyhere Date: Thu, 1 Jun 2023 12:03:51 +0200 Subject: [PATCH 036/105] FIX: when updating cost price, oldcopy has the new value --- htdocs/product/fournisseurs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 5d62485f3bc..1b32aeccec1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -139,6 +139,7 @@ if (empty($reshook)) { if ($action == 'setcost_price') { if ($id) { $result = $object->fetch($id); + $object->oldcopy = dol_clone($object); $object->cost_price = price2num($cost_price); $result = $object->update($object->id, $user); if ($result > 0) { From 30d9f9ca03708091482cb0208c3342568b924d05 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Jun 2023 10:05:12 +0000 Subject: [PATCH 037/105] Fixing style errors. --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 1b32aeccec1..f3a96d8a43f 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -139,7 +139,7 @@ if (empty($reshook)) { if ($action == 'setcost_price') { if ($id) { $result = $object->fetch($id); - $object->oldcopy = dol_clone($object); + $object->oldcopy = dol_clone($object); $object->cost_price = price2num($cost_price); $result = $object->update($object->id, $user); if ($result > 0) { From 370c7170a59fff6d85cdf2c491fa1bf1aab33f72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Jun 2023 19:45:42 +0200 Subject: [PATCH 038/105] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/compta/paiement/class/paiement.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 7df61ebefcb..d8d538c8d7a 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -306,6 +306,7 @@ class Paiement extends CommonObject if (!empty($currencyofpayment)) { // We must check that the currency of invoices is the same than the currency of the bank + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $bankaccount = new Account($this->db); $bankaccount->fetch($this->fk_account); $bankcurrencycode = empty($bankaccount->currency_code) ? $conf->currency : $bankaccount->currency_code; From d435443403d3bd2e4f220c019a7be441add977b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Jun 2023 19:59:37 +0200 Subject: [PATCH 039/105] Fix must no make a database read when value already known --- htdocs/multicurrency/class/multicurrency.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 9eea1d709c4..3f28d9cf1b8 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -561,15 +561,20 @@ class MultiCurrency extends CommonObject /** * Get the conversion of amount with invoice rate * - * @param int $fk_facture id of facture + * @param int $fk_facture Id of invoice * @param double $amount amount to convert * @param string $way 'dolibarr' mean the amount is in dolibarr currency - * @param string $table facture or facture_fourn + * @param string $table 'facture' or 'facture_fourn' + * @param float|null $invoice_rate Invoice rate if known (to avoid to make the getInvoiceRate call) * @return double|boolean amount converted or false if conversion fails */ - public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture') + public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture', $invoice_rate = null) { - $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); + if (!is_null($invoice_rate)) { + $multicurrency_tx = $invoice_rate; + } else { + $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); + } if ($multicurrency_tx) { if ($way == 'dolibarr') { From c9b528b587052b9ecea9db9520a63549ff57ac9f Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Thu, 27 Apr 2023 18:59:51 +0100 Subject: [PATCH 040/105] New:Hook takepos_login_block_other for Takepos div login_block_other --- htdocs/takepos/index.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index a2846f63ddf..c3f4b63d85f 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -54,6 +54,7 @@ $action = GETPOST('action', 'aZ09'); $setterminal = GETPOST('setterminal', 'int'); $setcurrency = GETPOST('setcurrency', 'aZ09'); +$hookmanager->initHooks(array('takeposfrontend')); if (empty($_SESSION["takeposterminal"])) { if (getDolGlobalInt('TAKEPOS_NUM_TERMINALS') == 1) { $_SESSION["takeposterminal"] = 1; // Use terminal 1 if there is only 1 terminal @@ -1060,15 +1061,20 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { ?>
- +
'.$langs->trans($value['label']).'
'.$langs->trans($value['label']).'
'.$langs->trans("Label").''; - print '
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans("Label").''.$object->note.'
'.$langs->trans("Label").''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)).'
'.$langs->trans("Description").''; - print nl2br($object->note)."
'.$langs->trans("WelcomeEMail").''; - print nl2br($object->mail_valid)."
'.$langs->trans("Description").''; + print '
'.$langs->trans("Description").''; print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); print '
'; -// Ref -/*print ''; -print '';*/ - // Date -print ''; +print ''; // Mode -print ''; +print ''; // Numero -print ''; +print ''; // Amount -print ''; +print ''; // Note -print ''; +print ''; // Bank account if (isModEnabled("banque")) { @@ -159,7 +153,7 @@ if (isModEnabled("banque")) { print ''; print ''; - print ''; print ''; diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 88650256ecc..eec0cff4d6f 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -125,7 +125,6 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char llxHeader(); $tva = new TVA($db); - $form = new Form($db); $h = 0; @@ -173,26 +172,20 @@ print '
'; print '
'.$langs->trans('Ref').''; -print $form->showrefnav($object,'id','',1,'rowid','id'); -print '
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Numero').''.$object->num_payment.'
'.$langs->trans('Numero').''.dol_escape_htmltag($object->num_payment).'
'.$langs->trans('Amount').''.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Amount').''.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note).'
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('BankTransactionLine').''; + print ''; print $bankline->getNomUrl(1, 0, 'showall'); print '
'; -// Ref -/*print ''; -print '';*/ - // Date -print ''; +print ''; // Mode -print ''; +print ''; // Numero -print ''; +print ''; // Montant -print ''; +print ''; // Note -print ''; +print ''; // Bank account if (isModEnabled("banque")) { @@ -202,7 +195,7 @@ if (isModEnabled("banque")) { print ''; print ''; - print ''; print ''; diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index 3a088ca30b5..db18debb26b 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -265,7 +265,6 @@ class PaymentVAT extends CommonObject */ public function fetch($id) { - global $langs; $sql = "SELECT"; $sql .= " t.rowid,"; $sql .= " t.fk_tva,"; @@ -275,7 +274,7 @@ class PaymentVAT extends CommonObject $sql .= " t.amount,"; $sql .= " t.fk_typepaiement,"; $sql .= " t.num_paiement as num_payment,"; - $sql .= " t.note,"; + $sql .= " t.note as note_private,"; $sql .= " t.fk_bank,"; $sql .= " t.fk_user_creat,"; $sql .= " t.fk_user_modif,"; @@ -303,7 +302,8 @@ class PaymentVAT extends CommonObject $this->fk_typepaiement = $obj->fk_typepaiement; $this->num_paiement = $obj->num_payment; $this->num_payment = $obj->num_payment; - $this->note = $obj->note; + $this->note = $obj->note_private; + $this->note_private = $obj->note_private; $this->fk_bank = $obj->fk_bank; $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_modif = $obj->fk_user_modif; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 4998b111504..306185cbc8a 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -253,7 +253,7 @@ abstract class ActionsContactCardCommon $this->tpl['visibility'] = $this->object->LibPubPriv($this->object->priv); - $this->tpl['note'] = nl2br($this->object->note); + $this->tpl['note'] = $this->object->note_private; } if ($action == 'create_user') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 787b09899a2..799b8f1b86b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1582,6 +1582,7 @@ function dol_escape_json($stringtoescape) /** * Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input fields. + * When we output string on pages, we use dol_string_onlythesehtmltags(dol_htmlentitiesbr()) for notes, and use dol_escape_htmltag() for simple labels. * * @param string $stringtoescape String to escape * @param int $keepb 1=Keep b tags, 0=remove them completely @@ -7099,21 +7100,29 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = * @param int $cleanalsojavascript Remove also occurence of 'javascript:'. * @param int $allowiframe Allow iframe tags. * @param array $allowed_tags List of allowed tags to replace the default list + * @param int $allowlink Allow link tags. * @return string String cleaned * * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags() */ -function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $removeclassattribute = 1, $cleanalsojavascript = 0, $allowiframe = 0, $allowed_tags = array()) +function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $removeclassattribute = 1, $cleanalsojavascript = 0, $allowiframe = 0, $allowed_tags = array(), $allowlink = 0) { if (empty($allowed_tags)) { $allowed_tags = array( - "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", + "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6" ); } $allowed_tags[] = "comment"; // this tags is added to manage comment that are replaced into ... if ($allowiframe) { - $allowed_tags[] = "iframe"; + if (!in_array('iframe', $allowed_tags)) { + $allowed_tags[] = "iframe"; + } + } + if ($allowlink) { + if (!in_array('link', $allowed_tags)) { + $allowed_tags[] = "link"; + } } $allowed_tags_string = join("><", $allowed_tags); @@ -7304,7 +7313,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') /** * Replace CRLF in string with a HTML BR tag. - * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before. + * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have + * encoded the special chars of stringtoencode into HTML before with dol_htmlentitiesbr(). * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br @@ -7331,7 +7341,7 @@ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false) * * @param string $stringtoencode String to encode * @param int $nouseofiframesandbox Allow use of option MAIN_SECURITY_USE_SANDBOX_FOR_HTMLWITHNOJS for html sanitizing - * @param string $check 'restricthtmlnolink' or 'restricthtml' or 'restricthtmlallowunvalid' + * @param string $check 'restricthtmlnolink' or 'restricthtml' or 'restricthtmlallowunvalid' * @return string HTML sanitized */ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = 'restricthtml') @@ -7402,9 +7412,12 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' $out = preg_replace('/'/i', "'", $out); } while ($oldstringtoclean != $out); - // Check the limit of external links in a Rich text content. We count ' + // 'url(' to avoid inline style like background: url(http... + // ' $reg = array(); - preg_match_all('/( getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 1000)) { $out = 'TooManyLinksIntoHTMLString'; @@ -7430,13 +7443,14 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' * - MultiCell -> param must not be encoded into HTML. * Because writeHTMLCell convert also \n into
, if function * is used to build PDF, nl2brmode must be 1. + * When we output string on pages, we use dol_string_onlythesehtmltags(dol_htmlentitiesbr()) for notes, and use dol_escape_htmltag() for simple labels. * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br (for use with FPDF writeHTMLCell function for example) * @param string $pagecodefrom Pagecode stringtoencode is encoded * @param int $removelasteolbr 1=Remove last br or lasts \n (default), 0=Do nothing * @return string String encoded - * @see dolGetFirstLineOfText() + * @see dol_escape_htmltag(), dolGetFirstLineOfText() */ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UTF-8', $removelasteolbr = 1) { diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index b95253bf040..7965274d72c 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -847,14 +847,15 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $feature = 'agenda'; $dbtablename = 'actioncomm'; } - if ($feature == 'payment_sc') { $feature = "chargesociales"; + $objectid = $object->fk_charge; } + $checkonentitydone = 0; // Array to define rules of checks to do - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment','chargesociales'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for object Societe $checkother = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object @@ -1002,7 +1003,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } - //var_dump($checkonentitydone); + //var_dump($sql); if (!$checkonentitydone && !in_array($feature, $nocheck) && $objectid > 0) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 768ddd216d7..126e711f5c5 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -116,7 +116,7 @@ class ActionsDatapolicy $object->state_id = ''; $object->socialnetworks = ''; $object->country_id = ''; - $object->note_private = $object->note_private.'
'.$langs->trans('ANONYMISER_AT', dol_print_date(time())); + $object->note_private = dol_concatdesc($object->note_private, $langs->trans('ANONYMISER_AT', dol_print_date(dol_now()))); if ($object->update($object->id, $user, 0)) { // On supprime les contacts associé diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index abed76cff93..478b58cd1af 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -442,7 +442,7 @@ if ($action == 'create') { // Incoterms if (isModEnabled('incoterm')) { print '
'.$langs->trans('Ref').''; -print $form->showrefnav($object,'id','',1,'rowid','id'); -print '
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Numero').''.$object->num_paiement.'
'.$langs->trans('Numero').''.dol_escape_htmltag($object->num_payment).'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note).'
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('BankTransactionLine').''; + print ''; print $bankline->getNomUrl(1, 0, 'showall'); print '
'; - print '
'; + print ''; print '"; // Note Private print ''; print '"; */ diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 416e848d271..8a63efbc69d 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -116,13 +116,13 @@ print ''; // Number -print ''; +print ''; // Amount print ''; // Note public -print ''; +print ''; // Bank account if (isModEnabled("banque")) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 0a047ccc9db..90a04aedf58 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -224,7 +224,8 @@ if (empty($reshook)) { $db->begin(); - $object->note = GETPOST('note', 'alpha'); + $object->note = GETPOST('note', 'restricthtml'); + $object->note_private = GETPOST('note', 'restricthtml'); $object->origin = $origin; $object->origin_id = $origin_id; $object->fk_project = GETPOST('projectid', 'int'); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 0470da549e5..740cd7c380f 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -378,10 +378,6 @@ if ($id > 0 || !empty($ref)) { } } print ''; - // Note on several rows - //print ''; print ''; // Delivery delay diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index bdc7b51312a..8c5f603d03f 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -105,19 +105,19 @@ print '
'; print '
'; print $langs->trans('IncotermLabel'); print ''; if ($user->rights->expedition->delivery->creer) { @@ -465,13 +465,13 @@ if ($action == 'create') { // Note Public print '
'.$langs->trans("NotePublic").''; - print nl2br($object->note_public); + print dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_public)); print "
'.$langs->trans("NotePrivate").''; - print nl2br($object->note_private); + print dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)); print "
'.$langs->trans('Date').''.dol_print_ print '
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Numero').''.$object->num_payment.'
'.$langs->trans('Numero').''.dol_escape_htmltag($object->num_payment).'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note_public).'
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_public)).'
'.$langs->trans('NotePublic').' :
'; - //print nl2br($object->note_public); - //print '
'."\n"; // Date payment -print ''; +print ''; // Mode -print ''; +print ''; // Number -print ''; +print ''; // Amount -print ''; +print ''; // Note public -print ''; +print ''; $disable_delete = 0; // Bank account diff --git a/htdocs/externalsite/admin/index.php b/htdocs/externalsite/admin/index.php index deb05ade024..3f90c53721a 100644 --- a/htdocs/externalsite/admin/index.php +++ b/htdocs/externalsite/admin/index.php @@ -59,7 +59,7 @@ if ($action == 'update') { // exturl can be an url or a HTML string $exturl = GETPOST('EXTERNALSITE_URL', 'restricthtml'); - $exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1); + $exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1, array(), 1); $exturl = dol_string_onlythesehtmlattributes($exturl); $i += dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity); @@ -112,7 +112,7 @@ print '"; print '
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('Date').''.dol_print_date($object->datep, 'day').'
'.$langs->trans('PaymentMode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('PaymentMode').''.$langs->trans("PaymentType".$object->type_code).'
'.$langs->trans('Numero').''.$object->num_payment.'
'.$langs->trans('Numero').''.dol_escape_htmltag($object->num_payment).'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($object->note_public).'
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_public)).'
'.$langs->trans("ExternalSiteURL")."