From 000efd5221ea8ebdf757b4e11612843ea97803ba Mon Sep 17 00:00:00 2001 From: Eric <1468823+rycks@users.noreply.github.com> Date: Sun, 9 Jun 2024 01:11:03 +0200 Subject: [PATCH] Fix #29640: (#29939) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710) * fix restrictedArea on selectobject (#29882) * Fix travis * Fix : expense report reapproval email, wrong date format + missing parameter (#29874) * delete_linked_contact is < 0 in case of error --------- Co-authored-by: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com> Co-authored-by: Rémi Champlon <85104766+Kazimir42@users.noreply.github.com> Co-authored-by: Laurent Destailleur Co-authored-by: Maxime Kohlhaas Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/ajax/selectobject.php | 6 +++++- htdocs/expensereport/card.php | 3 +-- htdocs/product/stock/replenish.php | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7ee160d684c..c9ce1d92594 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2859,7 +2859,7 @@ class Facture extends CommonInvoice // Delete invoice line $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.((int) $rowid); - if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact()) { + if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact() >= 0 ) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.((int) $rowid); $resql = $this->db->query($sql); diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index f7c4726ac80..3ca27b2c79c 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -137,7 +137,11 @@ if ($usesublevelpermission && !isset($user->rights->$module->$element)) { // The $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); // Add a security test to avoid to get content of all tables -restrictedArea($user, $objecttmp->element, $id); +if (!empty($objecttmp->module)) { + restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); +} else { + restrictedArea($user, $objecttmp->element, $id); +} /* diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index ba3d7ba25c3..eb7c4bedc13 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -548,8 +548,7 @@ if (empty($reshook)) { // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $link = ''.$link.''; - $dateRefusEx = explode(" ", $object->date_refuse); - $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link); + $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", dol_print_date($object->date_refuse, 'day'), $object->detail_refuse, $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link); // Rebuild pdf /* diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 3be9e01e3e4..efdff829333 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -275,6 +275,7 @@ if ($action == 'order' && GETPOST('valid')) { } else { $id = $result; } + $i++; } else { $order->socid = $suppliersid[$i]; $order->fetch_thirdparty();