Fix Check right for service for arrayofmassaction

if product module disable, threre is no action for service
This commit is contained in:
Dev2a 2020-01-07 18:59:58 +01:00
parent 36e6036e9e
commit 2d67c2365f

View File

@ -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';