From 32aaab75b57e3d976e93452b1c532e4e29d0a1ff Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 10 Jul 2024 18:53:57 +0200 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20hidden=20option=20MAIN=5FKEEP=5FREF?= =?UTF-8?q?=5FCUSTOMER=5FON=5FCLONING=20always=20win=20on=20pr=E2=80=A6=20?= =?UTF-8?q?(#30340)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: hidden option MAIN_KEEP_REF_CUSTOMER_ON_CLONING always win on propal clone even if it's for enother customer * Update propal.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6daca0f1c99..699ade8172a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1415,7 +1415,9 @@ class Propal extends CommonObject } // reset ref_client - $object->ref_client = ''; + if (!getDolGlobalString('MAIN_KEEP_REF_CUSTOMER_ON_CLONING')) { + $object->ref_client = ''; + } // TODO Change product price if multi-prices } else { From 2335ea3067ba3ea8996731639369b26d9e000fb9 Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:26:46 +0200 Subject: [PATCH 2/4] FIX public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942) * FIX Bug - public project form return an error if SOCIETE_EMAIL_UNIQUE if SOCIETE_EMAIL_UNIQUE is 1, this form returns an error because the third party already exists. * after comment from eldy --- htdocs/public/project/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index bd8ccd07901..76b4333010b 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -211,7 +211,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Search thirdparty and set it if found to the new created project - $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email); + $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email')); if ($result > 0) { $proj->socid = $thirdparty->id; } else { From f05c1b4aec4c9acd871a1b993684aadbc4418dad Mon Sep 17 00:00:00 2001 From: atm-lucas <121817516+atm-lucasmantegari@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:36:50 +0200 Subject: [PATCH 3/4] FIX - Unknown Character on HTML (#30257) * Unknown Character * Add replace on dol_htmlwithnojs --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 37fcc3c1f14..fa69487be7e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7717,6 +7717,9 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' } } + //Clear ZERO WIDTH NO-BREAK SPACE, ZERO WIDTH SPACE, ZERO WIDTH JOINER + $out = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $out); + // Clean some html entities that are useless so text is cleaner $out = preg_replace('/&(tab|newline);/i', ' ', $out); @@ -7821,6 +7824,7 @@ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UT if ($removelasteolbr) { $newstring = preg_replace('/
$/i', '', $newstring); // Remove last
(remove only last one) } + $newstring = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $newstring); $newstring = strtr($newstring, array('&'=>'__and__', '<'=>'__lt__', '>'=>'__gt__', '"'=>'__dquot__')); $newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom); // Make entity encoding $newstring = strtr($newstring, array('__and__'=>'&', '__lt__'=>'<', '__gt__'=>'>', '__dquot__'=>'"')); From 09fdb887bbdc3759b52682ccfa8158c4ab493679 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 13 Jul 2024 17:18:05 +0200 Subject: [PATCH 4/4] FIX expedition PDF models using units labels (#30358) --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 297013ed8ac..a7481c0be4b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -847,11 +847,11 @@ class pdf_espadon extends ModelePdfExpedition $object->volume_units = $object->size_units * 3; } - if ($totalWeight != '') { - $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); + if (!empty($totalWeight)) { + $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } - if ($totalVolume != '') { - $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); + if (!empty($totalVolume)) { + $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if ($object->trueWeight) { $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 11635c6511b..2b10608ab93 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -734,11 +734,11 @@ class pdf_rouget extends ModelePdfExpedition $object->volume_units = $object->size_units * 3; } - if ($totalWeight != '') { - $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); + if (!empty($totalWeight)) { + $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } - if ($totalVolume != '') { - $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); + if (!empty($totalVolume)) { + $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if (!empty($object->trueWeight)) { $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);