diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 4d24110f7e6..34a23b377b9 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -34,8 +34,8 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil'); -$id = GETPOST('id'); +$codeventil = GETPOST('codeventil', 'int'); +$id = GETPOST('id', 'int'); // Security check if ($user->socid > 0) diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 8b04ca74c81..b21882b9461 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil'); -$id = GETPOST('id'); +$codeventil = GETPOST('codeventil', 'int'); +$id = GETPOST('id', 'int'); // Security check if ($user->socid > 0) diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 40bd99c5582..07f3117c266 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil'); -$id = GETPOST('id'); +$codeventil = GETPOST('codeventil', 'int'); +$id = GETPOST('id', 'int'); // Security check if ($user->socid > 0) diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 3dfe0c4264c..070d46f6104 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); // Load translation files required by the page $langs->load("mails"); diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 3da6a95a1e8..00c3440b868 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'companies')); -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8ebdcdd9def..a8e8722007a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8059,7 +8059,11 @@ abstract class CommonObject $error++; $this->errors[] = $this->error; } else { - $result = $this->delete($user); + if (get_class($this) == 'Contact') { // TODO special code because delete() for contact has not been standardized like other delete. + $result = $this->delete(); + } else { + $result = $this->delete($user); + } if ($result < 0) { $error++; $this->errors[] = $this->error; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index d7ad3785338..061ace6c4f0 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1045,7 +1045,7 @@ if ($id > 0 || !empty($ref)) { '; // List of lines already dispatched - $sql = "SELECT p.ref, p.label,"; + $sql = "SELECT p.rowid as pid, p.ref, p.label,"; $sql .= " e.rowid as warehouse_id, e.ref as entrepot,"; $sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec"; $sql.=" ,cd.rowid, cd.subprice"; @@ -1131,9 +1131,18 @@ if ($id > 0 || !empty($ref)) { print ''.dol_print_date($db->jdate($objp->date_delivery), 'day').''; if (!empty($conf->productbatch->enabled)) { - print ''.$objp->batch.''; - print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; - print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; + if ($objp->batch) { + include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; + $lot=new Productlot($db); + $lot->fetch(0, $objp->pid, $objp->batch); + print ''.$lot->getNomUrl(1).''; + print ''.dol_print_date($lot->eatby, 'day').''; + print ''.dol_print_date($lot->sellby, 'day').''; + } else { + print ''; + print ''; + print ''; + } } // Qty diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index f124ef59872..defc85c1e91 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php' header('Content-Type: application/json'); -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); if (!$id) { print json_encode(array(