From a6267a8ade4b30a6ace5b91d5fdbe6c6c052fa4a Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Sat, 8 May 2021 11:43:46 +0200 Subject: [PATCH 1/3] add (hooks) init hooks on all tabs for supplier order --- htdocs/fourn/commande/contact.php | 1 + htdocs/fourn/commande/document.php | 1 + htdocs/fourn/commande/info.php | 1 + htdocs/fourn/commande/note.php | 2 ++ htdocs/product/class/product.class.php | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index f52aa20d494..4e5e6849cb2 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -45,6 +45,7 @@ if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); +$hookmanager->initHooks(array('ordersuppliercardcontact')); $object = new CommandeFournisseur($db); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index f3dc1d26496..219c215143e 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -70,6 +70,7 @@ if (!$sortfield) { $sortfield = "name"; } +$hookmanager->initHooks(array('ordersuppliercarddocument')); $object = new CommandeFournisseur($db); if ($object->fetch($id, $ref) < 0) { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 9260dab0b42..f35455f11d9 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -78,6 +78,7 @@ if (!$user->rights->fournisseur->commande->lire) { accessforbidden(); } +$hookmanager->initHooks(array('ordersuppliercardinfo')); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index c4cc134fee7..b272b94eddf 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -48,6 +48,8 @@ $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'com $object = new CommandeFournisseur($db); $object->fetch($id, $ref); +$hookmanager->initHooks(array('ordersuppliercardnote')); + $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5d622c05c29..29e97aaf4f9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2208,7 +2208,7 @@ class Product extends CommonObject $sql .= " p.stock,"; } if ($separatedEntityPMP) { - $sql .= " pa.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " ppe.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; } else { $sql .= " p.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; } From 6b55b9fb28bce93b4951e59b780d620a6d962407 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Sat, 8 May 2021 11:45:07 +0200 Subject: [PATCH 2/3] add (hooks) init hooks on all tabs for supplier order --- htdocs/fourn/commande/contact.php | 1 + htdocs/fourn/commande/document.php | 1 + htdocs/fourn/commande/info.php | 1 + htdocs/fourn/commande/note.php | 2 ++ 4 files changed, 5 insertions(+) diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index f52aa20d494..4e5e6849cb2 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -45,6 +45,7 @@ if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); +$hookmanager->initHooks(array('ordersuppliercardcontact')); $object = new CommandeFournisseur($db); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index f3dc1d26496..219c215143e 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -70,6 +70,7 @@ if (!$sortfield) { $sortfield = "name"; } +$hookmanager->initHooks(array('ordersuppliercarddocument')); $object = new CommandeFournisseur($db); if ($object->fetch($id, $ref) < 0) { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 9260dab0b42..f35455f11d9 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -78,6 +78,7 @@ if (!$user->rights->fournisseur->commande->lire) { accessforbidden(); } +$hookmanager->initHooks(array('ordersuppliercardinfo')); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index c4cc134fee7..b272b94eddf 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -48,6 +48,8 @@ $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'com $object = new CommandeFournisseur($db); $object->fetch($id, $ref); +$hookmanager->initHooks(array('ordersuppliercardnote')); + $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php From 44e49e7161a3c1e5c410042f0c25bde322fa6474 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Sat, 8 May 2021 11:46:32 +0200 Subject: [PATCH 3/3] git commit duplication --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 29e97aaf4f9..5d622c05c29 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2208,7 +2208,7 @@ class Product extends CommonObject $sql .= " p.stock,"; } if ($separatedEntityPMP) { - $sql .= " ppe.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " pa.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; } else { $sql .= " p.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; }