From 9ac05fa8f27a69de6e6263da40ff0ad9c996f267 Mon Sep 17 00:00:00 2001 From: cla Date: Sat, 4 Jun 2016 18:17:13 +0200 Subject: [PATCH 1/2] FIX #5134 --- htdocs/product/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ef126a85b52..b0bab3ab3c1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1730,7 +1730,8 @@ if (empty($reshook)) { if ($action == '' || $action == 'view') { - if ($user->rights->produit->creer || $user->rights->service->creer) + if (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer ) || + ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)) { if (! isset($object->no_button_edit) || $object->no_button_edit <> 1) print '
id.'">'.$langs->trans("Modify").'
'; From b440ad4e7ba871879ac34c569d907d053bb9c5e2 Mon Sep 17 00:00:00 2001 From: cla Date: Sat, 4 Jun 2016 18:44:10 +0200 Subject: [PATCH 2/2] FIX #5134: fixed action 'edit' top page --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b0bab3ab3c1..deff36ebfdf 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1122,7 +1122,7 @@ else else if ($object->id > 0) { // Fiche en mode edition - if ($action == 'edit' && ($user->rights->produit->creer || $user->rights->service->creer)) + if ($action == 'edit' && ((($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)))) { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';