From 2d67c2365fdf383a518de99d3dd916efd2fac4dc Mon Sep 17 00:00:00 2001 From: Dev2a Date: Tue, 7 Jan 2020 18:59:58 +0100 Subject: [PATCH] Fix Check right for service for arrayofmassaction if product module disable, threre is no action for service --- htdocs/product/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dcf43945ccb..55681eef583 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -424,13 +424,13 @@ if ($resql) //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); - if ($user->rights->produit->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); + $rightskey='produit'; + if($type == Product::TYPE_SERVICE) $rightskey='service'; + if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; - $rightskey='produit'; - if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { $label='NewProduct';