From 76e0d1d4e6f6627104352f2c5007afaaffd240b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Feb 2023 21:53:38 +0100 Subject: [PATCH 1/3] Fix reload of page --- htdocs/fourn/facture/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2c1f8156d92..099843308d4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2247,10 +2247,9 @@ if ($action == 'create') { $(document).ready(function() { $("#fac_rec").change(function() { console.log("We have changed the template invoice - Reload page"); - var fac_rec = $(this).val(); - var socid = $(\'#socid\').val(); - // For template invoice change, we must reuse data of template, not input already done, so we call a GET with action=create, not a POST submit. - window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec; + // reload page + $("input[name=action]").val("create"); + $("form[name=add]").submit(); }); }); '; From 33a74b65b3702c44a55891d3001d54667e89a15a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Feb 2023 01:53:24 +0100 Subject: [PATCH 2/3] Fix ul must contains li only --- htdocs/website/class/website.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 9cc470a5954..92a2b8f6b45 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1562,9 +1562,9 @@ class Website extends CommonObject if ($countrycode == 'us') { $label = preg_replace('/\s*\(.*\)/', '', $label); } - $out .= '
  • '.$label.''; + $out .= '
  • '.$label.''; $out .= ''; - $out .= '
  • '; + $out .= ''; } $i = 0; if (is_array($languagecodes)) { @@ -1583,11 +1583,11 @@ class Website extends CommonObject if ($countrycode == 'us') { $label = preg_replace('/\s*\(.*\)/', '', $label); } - $out .= '
  • '.$label.''; + $out .= '
  • '.$label.''; if (empty($i) && empty($languagecodeselected)) { $out .= ''; } - $out .= '
  • '; + $out .= ''; $i++; } } From 5c0ace0c89db71ad2cf2ccbfaa440a223bf2dcb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Feb 2023 02:44:33 +0100 Subject: [PATCH 3/3] Fix use absolute links for hreflang links --- htdocs/core/lib/website2.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6d93d4391b2..744ca519f90 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -219,7 +219,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en } if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; } } } @@ -236,7 +236,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en } if ($tmpshortlangcode != $shortlangcode) { - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; } } } @@ -246,7 +246,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, // Add myself $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; }