From 40329db2b2eb2cd48b53eaccf450d37bc5317e4e Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 21 Dec 2023 18:20:05 +0100 Subject: [PATCH 01/19] next fix for #17665 : autoloader collision --- .../framework/Luracast/Restler/AutoLoader.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php index 5ed160a070a..765927bbf88 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php @@ -290,10 +290,14 @@ class AutoLoader if (is_array($loader) && is_callable($loader)) { $b = new $loader[0]; - if (false !== $file = $b::$loader[1]($className) - && $this->exists($className, $b::$loader[1])) { - return $file; - } + //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader + //in case of multiple autoloader systems + if(property_exists($b, $loader[1])) { + if (false !== $file = $b::$loader[1]($className) + && $this->exists($className, $b::$loader[1])) { + return $file; + } + } } elseif (is_callable($loader) && false !== $file = $loader($className) && $this->exists($className, $loader)) { From 23e39cb8b3a5f5b1f7b1b5d9633f9ddbd9cdf9fe Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Fri, 22 Dec 2023 11:05:17 +0100 Subject: [PATCH 02/19] update changes --- dev/dolibarr_changes.txt | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index e4bc7104303..7c31d61cc46 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -102,7 +102,7 @@ with * Replace in tcpdf.php if (!@TCPDF_STATIC::file_exists($file)) { - return false; + return false; } with @@ -110,9 +110,9 @@ with if (!@TCPDF_STATIC::file_exists($file)) { // DOL CHANGE If we keep this, the image is not visible on pages after the first one. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); - //return false; + //return false; } - + * Replace in tcpdf.php if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { @@ -133,7 +133,7 @@ with } } elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { - + * In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace @@ -158,10 +158,10 @@ define('QR_FIND_FROM_RANDOM', false); * Removed useless directories ("examples", "tools") -* Optionnaly, removed all fonts except - dejavusans* (used by greek, arab, persan, romanian, turkish), - freemono* (russian), - cid*+msungstdlight+stsongstdlight+uni2cid* (chinese), +* Optionnaly, removed all fonts except + dejavusans* (used by greek, arab, persan, romanian, turkish), + freemono* (russian), + cid*+msungstdlight+stsongstdlight+uni2cid* (chinese), helvetica* (all other languages), zapfdingbats.php (for special chars like form checkboxes) @@ -215,11 +215,11 @@ window.location.href=pRef * Replace vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource()); -with +with var vTmpNode=this.newNode(vTmpCell, 'div', null, ''); vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']); vTmpNode.setAttribute('href',vTaskList[i].getLink()); - + * Replace '% Comp.' to have a smaller text column header 'comp':'% Comp.' with @@ -262,6 +262,17 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor // @CHANGE LDR if (!is_string($haystack)) return false; +* Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it + + //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader + //in case of multiple autoloader systems + if(property_exists($b, $loader[1])) { + if (false !== $file = $b::$loader[1]($className) + && $this->exists($className, $b::$loader[1])) { + return $file; + } + } + PARSEDOWN --------- @@ -269,10 +280,10 @@ PARSEDOWN * Add support of css by adding in Parsedown.php: // @CHANGE LDR - 'class' => $Link['element']['attributes']['class'] + 'class' => $Link['element']['attributes']['class'] ... - + // @CHANGE LDR if (preg_match('/{([^}]+)}/', $remainder, $matches2)) { @@ -311,7 +322,7 @@ Add into Class Google of file OAuth2/Service/Google: } $this->approvalPrompt = $prompt; } - + JEDITABLE.JS From 46dc2646541f8eb009c092dae833537272cbdc72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Dec 2023 14:40:16 +0100 Subject: [PATCH 03/19] Update dolibarr_changes.txt --- dev/dolibarr_changes.txt | 61 ++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 7c31d61cc46..ebfc2890e39 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -152,9 +152,9 @@ with elseif (strpos($filename, '://') === false) * To avoid to have QRcode changed because generated with a random mask, replace -define('QR_FIND_FROM_RANDOM', 2); -with -define('QR_FIND_FROM_RANDOM', false); + define('QR_FIND_FROM_RANDOM', 2); + with: + define('QR_FIND_FROM_RANDOM', false); * Removed useless directories ("examples", "tools") @@ -173,15 +173,15 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php * In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning of the function, replace: - $roman = ''; + $roman = ''; -with: + with: - $roman = ''; - if ($number >= 4000) { - // do not represent numbers above 4000 in Roman numerals - return strval($number); - } + $roman = ''; + if ($number >= 4000) { + // do not represent numbers above 4000 in Roman numerals + return strval($number); + } @@ -192,14 +192,14 @@ Add fpdf_tpl.php 1.2 Add tcpdi.php Add tcpdi_parser.php and replace: -require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); -with: -require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); + require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); + with: + require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); * Fix by replacing } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) { -with + with } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) { @@ -262,16 +262,22 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor // @CHANGE LDR if (!is_string($haystack)) return false; -* Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it +* Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it. For this replace code - //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader - //in case of multiple autoloader systems - if(property_exists($b, $loader[1])) { - if (false !== $file = $b::$loader[1]($className) - && $this->exists($className, $b::$loader[1])) { - return $file; - } - } + if (false !== $file = $b::$loader[1]($className) && $this->exists($className, $b::$loader[1])) { + return $file; + } + + with: + + //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader + //in case of multiple autoloader systems + if(property_exists($b, $loader[1])) { + if (false !== $file = $b::$loader[1]($className) + && $this->exists($className, $b::$loader[1])) { + return $file; + } + } PARSEDOWN @@ -285,11 +291,10 @@ PARSEDOWN ... // @CHANGE LDR - if (preg_match('/{([^}]+)}/', $remainder, $matches2)) - { - $Element['attributes']['class'] = $matches2[1]; - $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder); - } + if (preg_match('/{([^}]+)}/', $remainder, $matches2)) { + $Element['attributes']['class'] = $matches2[1]; + $remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder); + } // @CHANGE LDR From 48f4e52a22671bc1035f839ba3fbceb5014745c2 Mon Sep 17 00:00:00 2001 From: routmoute Date: Fri, 29 Dec 2023 02:30:32 +0100 Subject: [PATCH 04/19] fix: Display of the list of merged pdf --- htdocs/adherents/list.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/booking_list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position.php | 4 ++-- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/opensurvey/list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 52ef9109f9c..71c908f4533 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1431,7 +1431,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 39e7d4f67c8..131b41dcb1d 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -728,7 +728,7 @@ print '
'; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 734b64d3331..6ee898a2745 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -685,7 +685,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index adbb6afd400..0c14cbd2d3a 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -654,7 +654,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 6a7928e0a1e..9e95f29989e 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -660,7 +660,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 07f0879589a..3d0f001eb1b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -814,7 +814,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index c53ff3bd17d..d7f4c1f2423 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -769,7 +769,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index d8c333a8f61..0eb1fa7b9cd 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -769,7 +769,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4b66c407f04..9c26feab750 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2773,7 +2773,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 80d8b3d58e1..1e3a905d1b9 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -712,7 +712,7 @@ print ''."\n"; print ''."\n"; /* -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 1f575c28a12..83780568b34 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -1031,7 +1031,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 0b525072831..216f78a4ce7 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -1080,7 +1080,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9979cf8923b..557b8545803 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -982,7 +982,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index f0cb2265e9b..d37031fd5f3 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -741,7 +741,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 369796130e8..8ac949d8af5 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -736,7 +736,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index e10e34b6198..ff4cd9727de 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -749,7 +749,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create' print '' . "\n"; - if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; @@ -1311,7 +1311,7 @@ function DisplayPositionList() print '' . "\n"; - if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index dad14763a7d..8d5a96620ae 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -768,7 +768,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index c081ef3a664..9acaf041e47 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -812,7 +812,7 @@ if ($action != "create" && $action != "edit") { print '' . "\n"; - // if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + // if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { // $hidegeneratedfilelistifempty = 1; // if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { // $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index b4dee2ee3aa..4970ff4f895 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -757,7 +757,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 25f41a0c719..1f946a56cda 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -832,7 +832,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index cc9fa67c193..bc2a23382d0 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -858,7 +858,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 01262f21100..b4348ca6606 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -762,7 +762,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 78c20146414..71c7af538df 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -551,7 +551,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index bcfabe92e71..a25b7839170 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -1043,7 +1043,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 089387cd9a2..2f02e545ff9 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -783,7 +783,7 @@ print ''."\n"; print ''."\n"; // no inventory docs yet /* -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 41ee4189a3d..69211355b0d 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -910,7 +910,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index c0e37902b6c..d34aa5379c3 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1611,7 +1611,7 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) { //print ''; } -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 6a38300b19a..121d2a238de 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -731,7 +731,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 0a3dc0b8767..4f649401a76 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -514,7 +514,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index ecb15194ab8..18a43f1a8ed 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -884,7 +884,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 4b468fbb317..5c16b263e5f 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -727,7 +727,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 2c38ad02770..e514fed5cde 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -596,7 +596,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 763df3df2fe..8e0caca606f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -1243,7 +1243,7 @@ print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index c49e87cebd2..54b40461b9a 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -876,7 +876,7 @@ $tagidfortablednd = (empty($tagidfortablednd) ? 'tableattributes' : $tagidfortab '."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index e67d231bb18..14b20dc5ad8 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -795,7 +795,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; From 0c75288c6583af1c21ed3c400ec3b3c4b84f6c09 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 29 Dec 2023 15:51:52 +0100 Subject: [PATCH 05/19] #27249 [TPL] add: JS element target for contact line in contact tpl --- htdocs/core/tpl/contacts.tpl.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 957da647102..d55be8afe21 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -197,12 +197,14 @@ foreach (array('internal', 'external') as $source) { foreach ($contactlist as $contact) { $entry = new stdClass(); $entry->id = $contact['rowid']; + $entry->type_id = $contact['fk_c_type_contact']; $entry->type = $contact['libelle']; $entry->nature = ""; $entry->thirdparty_html = ""; $entry->thirdparty_name = ""; $entry->contact_html = ""; $entry->contact_name = ""; + $entry->status_id = $contact['statuscontact']; $entry->status = ""; if ($contact['source'] == 'internal') { @@ -213,6 +215,7 @@ foreach (array('internal', 'external') as $source) { if ($contact['socid'] > 0) { $companystatic->fetch($contact['socid']); + $entry->thirdparty_id = $companystatic->id; $entry->thirdparty_html = $companystatic->getNomUrl(1); $entry->thirdparty_name = strtolower($companystatic->getFullName($langs)); } elseif ($contact['socid'] < 0) { @@ -222,10 +225,12 @@ foreach (array('internal', 'external') as $source) { if ($contact['source'] == 'internal') { $userstatic->fetch($contact['id']); + $entry->contact_id = $userstatic->id; $entry->contact_html = $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); $entry->contact_name = strtolower($userstatic->getFullName($langs)); } elseif ($contact['source'] == 'external') { $contactstatic->fetch($contact['id']); + $entry->contact_id = $contactstatic->id; $entry->contact_html = $contactstatic->getNomUrl(1, '', 0, '', 0, 0); $entry->contact_name = strtolower($contactstatic->getFullName($langs)); } @@ -291,13 +296,13 @@ if ($permission) { print ""; foreach ($list as $entry) { - print ''; + print ''; - print ''.$entry->thirdparty_html.''; - print ''.$entry->contact_html.''; - print ''.$entry->nature.''; - print ''.$entry->type.''; - print ''.$entry->status.''; + print ''.$entry->thirdparty_html.''; + print ''.$entry->contact_html.''; + print ''.$entry->nature.''; + print ''.$entry->type.''; + print ''.$entry->status.''; if ($permission) { $href = $_SERVER["PHP_SELF"]; From 1d38a3b7b80c430b3c88e456814b1b68f3a0078a Mon Sep 17 00:00:00 2001 From: routmoute Date: Fri, 29 Dec 2023 20:19:17 +0100 Subject: [PATCH 06/19] fix conflict with develop branch --- htdocs/adherents/list.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/booking_list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position.php | 4 ++-- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/opensurvey/list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 71c908f4533..490453d7298 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1431,7 +1431,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 131b41dcb1d..cdd0000292d 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -728,7 +728,7 @@ print '
'; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 6ee898a2745..ef5649d344b 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -685,7 +685,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 0c14cbd2d3a..bc000717b55 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -654,7 +654,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 9e95f29989e..12dec5c2cc6 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -660,7 +660,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 3d0f001eb1b..61b246f4447 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -814,7 +814,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index d7f4c1f2423..038dd20b4f1 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -769,7 +769,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index 0eb1fa7b9cd..3ef558257d9 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -769,7 +769,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9c26feab750..a71212a517c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2773,7 +2773,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 1e3a905d1b9..5d5ee2ea298 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -712,7 +712,7 @@ print ''."\n"; print ''."\n"; /* -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 83780568b34..fb0c72b591b 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -1031,7 +1031,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 216f78a4ce7..148cd91bd11 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -1080,7 +1080,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 557b8545803..ebe4239dbde 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -982,7 +982,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index d37031fd5f3..0549f44cab1 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -741,7 +741,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 8ac949d8af5..818e8a4a1d5 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -736,7 +736,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index ff4cd9727de..fbc65a685a4 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -749,7 +749,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create' print '' . "\n"; - if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; @@ -1311,7 +1311,7 @@ function DisplayPositionList() print '' . "\n"; - if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 8d5a96620ae..5486ea67f59 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -768,7 +768,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 9acaf041e47..deaef1889a1 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -812,7 +812,7 @@ if ($action != "create" && $action != "edit") { print '' . "\n"; - // if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + // if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { // $hidegeneratedfilelistifempty = 1; // if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { // $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 4970ff4f895..08fd84eca59 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -757,7 +757,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 1f946a56cda..c76d4b29d03 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -832,7 +832,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index bc2a23382d0..aee8a2b5197 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -858,7 +858,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index b4348ca6606..4ab210390c2 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -762,7 +762,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 71c7af538df..26bf4473a3d 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -551,7 +551,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index a25b7839170..3d455376f58 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -1043,7 +1043,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 2f02e545ff9..4cdb56b25e0 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -783,7 +783,7 @@ print ''."\n"; print ''."\n"; // no inventory docs yet /* -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 69211355b0d..8c32ae17694 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -910,7 +910,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index d34aa5379c3..e7b2e3dec79 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1611,7 +1611,7 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) { //print ''; } -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 121d2a238de..ff9ba693300 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -731,7 +731,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 4f649401a76..a6bca735c44 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -514,7 +514,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 18a43f1a8ed..c8165a88a2a 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -884,7 +884,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 5c16b263e5f..44b8aa15f1a 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -727,7 +727,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index e514fed5cde..bca6bbaa375 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -596,7 +596,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 8e0caca606f..d0b25421b37 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -1243,7 +1243,7 @@ print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 54b40461b9a..961e396826d 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -876,7 +876,7 @@ $tagidfortablednd = (empty($tagidfortablednd) ? 'tableattributes' : $tagidfortab '."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 14b20dc5ad8..e665d14807c 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -795,7 +795,7 @@ print ''."\n"; print ''."\n"; -if (array_key_exists('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { $hidegeneratedfilelistifempty = 0; From 8da8db215a83385b757b2790b88f636e40ad87f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Dec 2023 15:25:15 +0100 Subject: [PATCH 07/19] Fix phpunit --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 290ff4691c9..5a68987162c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5058,7 +5058,7 @@ div.ui-tooltip.mytooltip { color: var(--tooltipfontcolor); line-height: 1.6em; min-width: 550px; - pointer-events: none; + pointer-events: none; } Date: Sat, 30 Dec 2023 15:48:13 +0100 Subject: [PATCH 08/19] Fix phpcs --- htdocs/mrp/mo_list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 01262f21100..6eb71b7cd76 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -570,7 +570,6 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { if ($key == "fk_product") { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; - } else { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; } From b221ff35b2b11de7cb7edb663ad537a375c5eef9 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 31 Dec 2023 17:16:53 +0100 Subject: [PATCH 09/19] FIX #27262 Recurrent invoice - user to string conversion --- htdocs/fourn/class/fournisseur.facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index bad8edf3a66..a44bb305455 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1323,7 +1323,7 @@ class FactureFournisseurRec extends CommonInvoice } if (!$error && ($facturerec->auto_validate || $forcevalidation)) { $result = $new_fac_fourn->validate($user); - $laststep="Validate by user $user"; + $laststep="Validate by user {$user->login}"; if ($result <= 0) { $this->errors = $new_fac_fourn->errors; $this->error = $new_fac_fourn->error; From bb44bb32f84dba323009faa9212a6524c0613cf8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 00:47:56 +0100 Subject: [PATCH 10/19] Fix message --- htdocs/opensurvey/results.php | 4 ++-- htdocs/public/opensurvey/studs.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index da364497a80..3e48b2b07c6 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1157,9 +1157,9 @@ if ($nbofcheckbox >= 2) { print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print " ".$langs->trans('TheBestChoice').": ".$meilleursujet." ".$langs->trans("with")." ".$meilleurecolonne." ".$vote_str.".\n"; + print ' '.$langs->trans('TheBestChoice').": ".$meilleursujet." - ".$meilleurecolonne." ".$vote_str.".\n"; } elseif (isset($meilleurecolonne)) { - print " ".$langs->trans('TheBestChoices').": ".$meilleursujet." ".$langs->trans("with")." ".$meilleurecolonne." ".$vote_str.".\n"; + print ' '.$langs->trans('TheBestChoices').": ".$meilleursujet." - ".$meilleurecolonne." ".$vote_str.".\n"; } print '


'."\n"; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index c6171867557..c05a1653d2d 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -813,9 +813,9 @@ if ($object->allow_spy) { print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print ' '.$langs->trans('TheBestChoice').": ".$meilleursujet." ".$langs->trans('with')." ".$meilleurecolonne."".$vote_str.".\n"; + print ' '.$langs->trans('TheBestChoice').": ".$meilleursujet." - ".$meilleurecolonne." ".$vote_str.".\n"; } elseif (isset($meilleurecolonne)) { - print ' '.$langs->trans('TheBestChoices').": ".$meilleursujet." ".$langs->trans('with')." ".$meilleurecolonne."".$vote_str.".\n"; + print ' '.$langs->trans('TheBestChoices').": ".$meilleursujet." - ".$meilleurecolonne." ".$vote_str.".\n"; } print '


'."\n"; From 5ae29f405299fde7c3016e86b35cb6dc80bf119f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 12:58:40 +0100 Subject: [PATCH 11/19] Fix check php native imap only if php <= 8.3 --- htdocs/install/check.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index a5f571fec0b..d434a5bdad2 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -200,12 +200,14 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc } // Check if Imap is supported -if (!function_exists("imap_open")) { - $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "IMAP")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) -} else { - print 'Ok '.$langs->trans("PHPSupport", "IMAP")."
\n"; +if (PHP_VERSION_ID <= 80300) { + if (!function_exists("imap_open")) { + $langs->load("errors"); + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "IMAP")."
\n"; + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) + } else { + print 'Ok '.$langs->trans("PHPSupport", "IMAP")."
\n"; + } } // Check if Zip is supported From 54d81a4e746584d313880530027a268603136dac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:16:41 +0100 Subject: [PATCH 12/19] Fix value for date of survey was truncated --- htdocs/opensurvey/results.php | 2 +- htdocs/public/opensurvey/studs.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 3e48b2b07c6..c3a6bc4d4ec 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1148,7 +1148,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { $compteursujet++; } } -$meilleursujet = substr($meilleursujet, 1); +//$meilleursujet = substr($meilleursujet, 1); $meilleursujet = str_replace("°", "'", $meilleursujet); // Show best choice diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index c05a1653d2d..a0b5b39732e 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -804,7 +804,7 @@ if ($object->allow_spy) { } } - $meilleursujet = substr("$meilleursujet", 1); + //$meilleursujet = substr($meilleursujet, 1); $meilleursujet = str_replace("°", "'", $meilleursujet); // Show best choice From 9357278bac5a8f668d65da8e44dee0f2486793a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:17:38 +0100 Subject: [PATCH 13/19] Fix var not used --- htdocs/opensurvey/results.php | 1 - htdocs/public/opensurvey/studs.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index c3a6bc4d4ec..2656500fbc3 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1132,7 +1132,6 @@ for ($i = 0; $i < $nbcolonnes; $i++) { $meilleursujet .= ($meilleursujet ? ", " : ""); if ($object->format == "D") { - $meilleursujetexport = $toutsujet[$i]; //var_dump($toutsujet); if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index a0b5b39732e..73245eb75e4 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -788,7 +788,6 @@ if ($object->allow_spy) { if (isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) { $meilleursujet .= ($meilleursujet ? ", " : ""); if ($object->format == "D") { - $meilleursujetexport = $toutsujet[$i]; if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); $meilleursujet .= dol_print_date($toutsujetdate[0], 'daytext').' ('.dol_print_date($toutsujetdate[0], '%A').') - '.$toutsujetdate[1]; From 1eb5cd137c58a0ddd957d1a80ea81571ca841515 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:36:37 +0100 Subject: [PATCH 14/19] Clean code --- htdocs/core/tpl/contacts.tpl.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index d55be8afe21..e1dff2a711d 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -204,8 +204,8 @@ foreach (array('internal', 'external') as $source) { $entry->thirdparty_name = ""; $entry->contact_html = ""; $entry->contact_name = ""; - $entry->status_id = $contact['statuscontact']; - $entry->status = ""; + $entry->status = 0; + $entry->status_html = ""; if ($contact['source'] == 'internal') { $entry->nature = $langs->trans("User"); @@ -236,9 +236,11 @@ foreach (array('internal', 'external') as $source) { } if ($contact['source'] == 'internal') { - $entry->status = $userstatic->LibStatut($contact['statuscontact'], 3); + $entry->status = $contact['statuscontact']; + $entry->status_html = $userstatic->LibStatut($contact['statuscontact'], 3); } elseif ($contact['source'] == 'external') { - $entry->status = $contactstatic->LibStatut($contact['statuscontact'], 3); + $entry->status = $contact['statuscontact']; + $entry->status_html = $contactstatic->LibStatut($contact['statuscontact'], 3); } $list[] = $entry; @@ -298,11 +300,11 @@ print ""; foreach ($list as $entry) { print ''; - print ''.$entry->thirdparty_html.''; - print ''.$entry->contact_html.''; - print ''.$entry->nature.''; - print ''.$entry->type.''; - print ''.$entry->status.''; + print ''.$entry->thirdparty_html.''; + print ''.$entry->contact_html.''; + print ''.dol_escape_htmltag($entry->nature).''; + print ''.dol_escape_htmltag($entry->type).''; + print ''.$entry->status_html.''; if ($permission) { $href = $_SERVER["PHP_SELF"]; From 47994f8cd913ac06940df5820eaca519d272cded Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:45:08 +0100 Subject: [PATCH 15/19] Clean code --- htdocs/core/tpl/contacts.tpl.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e1dff2a711d..31514673a21 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -200,6 +200,7 @@ foreach (array('internal', 'external') as $source) { $entry->type_id = $contact['fk_c_type_contact']; $entry->type = $contact['libelle']; $entry->nature = ""; + $entry->nature_html = ""; $entry->thirdparty_html = ""; $entry->thirdparty_name = ""; $entry->contact_html = ""; @@ -208,9 +209,11 @@ foreach (array('internal', 'external') as $source) { $entry->status_html = ""; if ($contact['source'] == 'internal') { - $entry->nature = $langs->trans("User"); + $entry->nature = 'user'; + $entry->nature_html = $langs->trans("User"); } elseif ($contact['source'] == 'external') { - $entry->nature = $langs->trans("ThirdPartyContact"); + $entry->nature = 'thirdparty'; + $entry->nature_html = $langs->trans("ThirdPartyContact"); } if ($contact['socid'] > 0) { @@ -302,7 +305,7 @@ foreach ($list as $entry) { print ''.$entry->thirdparty_html.''; print ''.$entry->contact_html.''; - print ''.dol_escape_htmltag($entry->nature).''; + print ''.dol_escape_htmltag($entry->nature_html).''; print ''.dol_escape_htmltag($entry->type).''; print ''.$entry->status_html.''; From e2180cba42ad403a46c2a1b49fac97a789487bd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:57:41 +0100 Subject: [PATCH 16/19] Fix warning --- htdocs/main.inc.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6bf70b996fe..1dda738d1a7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1664,7 +1664,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) * @param int $disablenoindex Disable noindex tag for meta robots * @return void */ -function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0) +function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = array(), $arrayofcss = array(), $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0) { global $db, $conf, $langs, $user, $mysoc, $hookmanager; @@ -2062,20 +2062,20 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr /** * Show an HTML header + a BODY + The top menu bar * - * @param string $head Lines in the HEAD - * @param string $title Title of web page - * @param string $target Target to use in menu links (Example: '' or '_top') - * @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax) - * @param int $disablehead Do not output head section - * @param array $arrayofjs Array of js files to add in header - * @param array $arrayofcss Array of css files to add in header - * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) - * @param string $helppagename Name of wiki page for help ('' by default). - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage - * For other external page: http://server/url + * @param string $head Lines in the HEAD + * @param string $title Title of web page + * @param string $target Target to use in menu links (Example: '' or '_top') + * @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax) + * @param int $disablehead Do not output head section + * @param array $arrayofjs Array of js files to add in header + * @param array $arrayofcss Array of css files to add in header + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $helppagename Name of wiki page for help ('' by default). + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url * @return void */ -function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $helppagename = '') +function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = array(), $arrayofcss = array(), $morequerystring = '', $helppagename = '') { global $user, $conf, $langs, $db, $form; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -3082,7 +3082,7 @@ function top_menu_search() * @param string $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) * @return void */ -function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_array_after = '', $leftmenuwithoutmainarea = 0, $title = '', $acceptdelayedhtml = 0) +function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_array_after = array(), $leftmenuwithoutmainarea = 0, $title = '', $acceptdelayedhtml = 0) { global $user, $conf, $langs, $db, $form; global $hookmanager, $menumanager; From 7d6ef6b809b3f135170fdb9c675414445627b897 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 13:59:05 +0100 Subject: [PATCH 17/19] Fix warning --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1dda738d1a7..1fd788b490b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3450,8 +3450,8 @@ function getHelpParamFor($helppagename, $langs) * @param string $accesskey Accesskey * @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page * @param string $img Image to use - * @param string $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers. - * @param string $autofocus Set autofocus on field + * @param int $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers. + * @param int $autofocus Set autofocus on field * @return string */ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey = '', $prefhtmlinputname = '', $img = '', $showtitlebefore = 0, $autofocus = 0) From 0dffaa53dd7b14abc897df3fcbff22066182e6f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 14:45:49 +0100 Subject: [PATCH 18/19] Fix doc --- dev/dolibarr_changes.txt | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index be467e8eadf..3cca5c44724 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -188,17 +188,10 @@ Add file fpdf_tpl.php 1.2 Add file tcpdi.php -<<<<<<< HEAD Add file tcpdi_parser.php and replace: require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); with: require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); -======= -Add tcpdi_parser.php and replace: - require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); - with: - require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git * Fix syntax error by replacing @@ -218,21 +211,12 @@ with window.location.href=pRef * Replace -<<<<<<< HEAD vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource()); with var vTmpNode=this.newNode(vTmpCell, 'div', null, ''); vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']); vTmpNode.setAttribute('href',vTaskList[i].getLink()); -======= -vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource()); -with -var vTmpNode=this.newNode(vTmpCell, 'div', null, ''); -vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']); -vTmpNode.setAttribute('href',vTaskList[i].getLink()); - ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git * Replace '% Comp.' to have a smaller text column header 'comp':'% Comp.' with @@ -272,7 +256,6 @@ RESTLER: // @CHANGE LDR if (!is_string($haystack)) return false; -<<<<<<< HEAD * Replace $loaders = array_unique(static::$rogueLoaders); @@ -282,12 +265,6 @@ RESTLER: $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); -+With swagger 2 provided into /explorer: ----------------------------------------- - -Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html - -======= * Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it. For this replace code if (false !== $file = $b::$loader[1]($className) && $this->exists($className, $b::$loader[1])) { @@ -304,7 +281,13 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor return $file; } } ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git + + ++With swagger 2 provided into /explorer: +---------------------------------------- + +Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html + PARSEDOWN From 3fae1cc0992596df493217e4846eac904a6c7fc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jan 2024 14:47:18 +0100 Subject: [PATCH 19/19] Fix doc --- dev/dolibarr_changes.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index cd64efe58e7..bd826f56938 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -110,15 +110,11 @@ with if (!@TCPDF_STATIC::file_exists($file)) { // DOL CHANGE If we keep this, the image is not visible on pages after the first one. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); -<<<<<<< HEAD //return false; $tfile = str_replace(' ', '%20', $file); if (@TCPDF_STATIC::file_exists($tfile)) { $file = $tfile; } -======= - //return false; ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git } * Replace in tcpdf.php