From 280ceef46b873232685f265822003fb94a82c0b7 Mon Sep 17 00:00:00 2001 From: Eric <1468823+rycks@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:55:32 +0100 Subject: [PATCH 1/3] outputlangs must not be a string as default value like others generateDocument functions (#28132) --- htdocs/delivery/class/delivery.class.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 6bfe3a33dd7..2dd1fa0329c 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -1044,7 +1044,7 @@ class Delivery extends CommonObject * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf, $user, $langs; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 92df16fa867..ad6264d18d5 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -877,7 +877,7 @@ class Entrepot extends CommonObject * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf, $user, $langs; diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 4976530eb5e..fc451ed8c1a 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1153,7 +1153,7 @@ class MouvementStock extends CommonObject * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf, $user, $langs; From 1ef91d3a2184a2f5edff5631f4e4193308d0c471 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 15 Feb 2024 16:47:07 +0100 Subject: [PATCH 2/3] FIX avoid Unknown column 'pfp.ref_fourn' (#28145) --- htdocs/product/list.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4f30e146f56..db58e7bfa0d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -432,7 +432,21 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; if ($sall) { - $sql .= natural_search(array_keys($fieldstosearchall), $sall); + // Clean $fieldstosearchall + $newfieldstosearchall = $fieldstosearchall; + unset($newfieldstosearchall['pfp.ref_fourn']); + unset($newfieldstosearchall['pfp.barcode']); + + $sql .= ' AND ('; + $sql .= natural_search(array_keys($newfieldstosearchall), $sall, 0, 1); + // Search also into a supplier reference 'pfp.ref_fourn'="RefSupplier" + $sql .= ' OR EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid'; + $sql .= ' AND ('.natural_search('pfp.ref_fourn', $sall, 0, 1); + if (isModEnabled('barcode')) { + // Search also into a supplier barcode 'pfp.barcode'='GencodBuyPrice'; + $sql .= ' OR '.natural_search('pfp.barcode', $sall, 0, 1); + } + $sql .= ')))'; } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($search_type) && $search_type != '-1') { From 05cf98fae885e0b536f0d0c1fbc09ad977ad4002 Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:38:46 +0100 Subject: [PATCH 3/3] Fix lost POST data when redirection after drag_n_drop an event inside the agenda (#28212) --- htdocs/comm/action/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a5a898ef7f2..99d330b745a 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -756,7 +756,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { $newdate = GETPOST('newdate', 'alpha'); if (empty($newdate) || strpos($newdate, 'dayevent_') != 0) { - header("Location: ".$backtopage); + header("Location: ".$backtopage, true, 307); exit; } @@ -841,7 +841,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { } } if (!empty($backtopage)) { - header("Location: ".$backtopage); + header("Location: ".$backtopage, true, 307); exit; } else { $action = '';