From 93031773868b62ef9b8593b5a4d15f3ae6f06d17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2022 19:12:42 +0200 Subject: [PATCH 01/34] Fix regression --- htdocs/compta/bank/releve.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 2dbaaa07373..c08336841e2 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -387,6 +387,10 @@ if (empty($numref)) { * Show list of record into a bank statement */ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements"); + $helpurl = ""; + llxHeader('', $title, $helpurl); + // Onglets $head = account_statement_prepare_head($object, $numref); print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); From 1fbd4b1c2dad208b38002d6ea02c955d69f63fba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2022 20:12:22 +0200 Subject: [PATCH 02/34] Clean code --- htdocs/modulebuilder/template/myobject_list.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 32bf5ae3200..380eab1ab6b 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -53,7 +53,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; + $i--; + $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; @@ -88,9 +89,6 @@ require_once __DIR__.'/class/myobject.class.php'; // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule", "other")); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); - $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -102,6 +100,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); From 9286f84b47fc1b0b24f958fe65082ef2e7997b22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2022 21:06:08 +0200 Subject: [PATCH 03/34] Fix php8 --- htdocs/core/class/commonobject.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2d393ab9dc3..aa85c0aa5c2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -744,6 +744,7 @@ abstract class CommonObject public function setUpperOrLowerCase() { global $conf; + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) { $this->lastname = dol_ucwords(dol_strtolower($this->lastname)); $this->firstname = dol_ucwords(dol_strtolower($this->firstname)); @@ -759,8 +760,12 @@ abstract class CommonObject $this->address = dol_strtoupper($this->address); $this->town = dol_strtoupper($this->town); } - $this->email = dol_strtolower($this->email); - $this->personal_email = dol_strtolower($this->personal_email); + if (isset($this->email)) { + $this->email = dol_strtolower($this->email); + } + if (isset($this->personal_email)) { + $this->personal_email = dol_strtolower($this->personal_email); + } } /** From 628a368686c466acd5d770e5fa77a1c2c945f71e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2022 21:25:24 +0200 Subject: [PATCH 04/34] Add column position for llx_bank --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_bank.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 24b4e20a7b7..78f71563a45 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -64,3 +64,5 @@ ALTER TABLE llx_ticket ADD COLUMN ip varchar(250); ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf; +ALTER TABLE llx_bank ADD COLUMN position integer DEFAULT 0; + diff --git a/htdocs/install/mysql/tables/llx_bank.sql b/htdocs/install/mysql/tables/llx_bank.sql index d0a8e34790b..9a1b12d5754 100644 --- a/htdocs/install/mysql/tables/llx_bank.sql +++ b/htdocs/install/mysql/tables/llx_bank.sql @@ -37,6 +37,7 @@ create table llx_bank rappro tinyint default 0, note text, fk_bordereau integer DEFAULT 0, + position integer DEFAULT 0, banque varchar(255), -- banque pour les cheques emetteur varchar(255), -- emetteur du cheque author varchar(40), -- a supprimer apres migration From 7dfeae694f2d4b1a5f2b816ad3d57d9ec2fc7659 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2022 22:22:46 +0200 Subject: [PATCH 05/34] CSS amount --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index bdc6a102147..7b7d8c61c1d 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2083,7 +2083,7 @@ if ($resql) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."\n"; + print ''.price($obj->total_ht)."\n"; if (!$i) { $totalarray['nbfield']++; } From 6b5fac432fdeb53593f6b16dee4551cb5f3504b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Aug 2022 03:46:15 +0200 Subject: [PATCH 06/34] Add doc --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b286adae481..c3cd8922955 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9141,6 +9141,7 @@ function printCommonFooter($zone = 'private') print "\n"; if (!empty($conf->use_javascript_ajax)) { + print "\n\n"; print '