From 9c8cb32de3e52d710486225367dd1f2710d41006 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Fri, 8 Apr 2022 10:25:19 +0200 Subject: [PATCH 01/71] FIX --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b6e16a22a9e..3e2158ff2ae 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2628,7 +2628,7 @@ if ($action == 'create' && $usercancreate) { } // Cancel order - if ($object->statut == Commande::STATUS_VALIDATED && (!empty($usercanclose) || !empty($usercancancel))) { + if ($object->statut == Commande::STATUS_VALIDATED && !empty($usercancancel)) { print ''.$langs->trans("Cancel").''; } From 8729b9f2dd9fb5d565be342467980f3e5e9d0a18 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Mon, 13 Jun 2022 13:34:18 +0200 Subject: [PATCH 02/71] array instead of string in @param pfx() function --- htdocs/core/class/evalmath.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index ccd495bb623..2259cfde06f 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -368,7 +368,7 @@ class EvalMath /** * evaluate postfix notation * - * @param string $tokens Expression + * @param array $tokens Expression * @param array $vars Array * @return string Output */ From 2c6e4227910f2687e0dc5eeaeb95ca752d1d92b1 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 11:06:10 +0200 Subject: [PATCH 03/71] changing function name to existing one --- htdocs/core/class/stats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ae9a8e56e58..91d3d729c2f 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -236,7 +236,7 @@ abstract class Stats $year = $startyear; while ($year <= $endyear) { - $datay[$year] = $this->getAverageByMonth($year); + $datay[$year] = $this->_getAverageByMonth($year); $year++; } From fc4f5d9af214e0e8af36ca2b48a2beb58b352d54 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 12:25:00 +0200 Subject: [PATCH 04/71] adding abstract function in Stats class --- htdocs/core/class/stats.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 91d3d729c2f..38effddb586 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -219,6 +219,13 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getAverageByMonth($year, $format = 0); + /** * Return average of entity by month for several years * @@ -236,7 +243,7 @@ abstract class Stats $year = $startyear; while ($year <= $endyear) { - $datay[$year] = $this->_getAverageByMonth($year); + $datay[$year] = $this->getAverageByMonth($year); $year++; } From bf801fc11d96ee1d868028ba270d2a166c915769 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 15 Jun 2022 16:50:34 +0200 Subject: [PATCH 05/71] temporary transformation (from string to array) so it can be traversable --- htdocs/core/class/extrafields.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4f9b0d06f16..33b36b9dd47 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1268,7 +1268,8 @@ class ExtraFields require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); $out .= ''; - foreach ($data as $data_key => $data_value) { + $dataArray = str_split($data); // as $data is not traversable as it's a string + foreach ($dataArray as $data_key => $data_value) { $out .= '