diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 665940b8083..bc4d6daaaa4 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -111,7 +111,8 @@ $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if ($action == 'addlimitstockwarehouse') { +if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)) +{ $seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); @@ -154,7 +155,7 @@ if ($action == 'addlimitstockwarehouse') { } -if($action == 'delete_productstockwarehouse') +if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->creer)) { $pse = new ProductStockEntrepot($db); @@ -166,7 +167,7 @@ if($action == 'delete_productstockwarehouse') } // Set stock limit -if ($action == 'setseuil_stock_alerte') +if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer)) { $object = new Product($db); $result=$object->fetch($id); @@ -180,7 +181,7 @@ if ($action == 'setseuil_stock_alerte') } // Set desired stock -if ($action == 'setdesiredstock') +if ($action == 'setdesiredstock' && !empty($user->rights->produit->creer)) { $object = new Product($db); $result=$object->fetch($id); @@ -947,16 +948,24 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) print '

'; print_titre($langs->trans('AddNewProductStockWarehouse')); - print '
'; - print ''; - print ''; + if (!empty($user->rights->produit->creer)){ + print ''; + print ''; + print ''; + } print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; + if (!empty($user->rights->produit->creer)){ + print ''; + print ''; + print ''; + print ''; + print ''; + }else{ + print ''; + print ''; + print ''; + print ''; + } $pse = new ProductStockEntrepot($db); $lines = $pse->fetchAll(GETPOST('id')); @@ -968,17 +977,21 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) { $ent = new Entrepot($db); $ent->fetch($line['fk_entrepot']); - print ''; + print ''; print ''; print ''; - print ''; + if (!empty($user->rights->produit->creer)){ + print ''; + } print ''; } } print "
'.$formproduct->selectWarehouses('', 'fk_entrepot').'
'.$formproduct->selectWarehouses('', 'fk_entrepot').'
'.$langs->trans("Warehouse").''.$langs->trans("StockLimit").''.$langs->trans("DesiredStock").'
'.$ent->getNomUrl(3).'
'.$ent->getNomUrl(3).''.$line['seuil_stock_alerte'].''.$line['desiredstock'].''.img_delete().''.img_delete().'
"; - print '
'; + if (!empty($user->rights->produit->creer)){ + print ''; + } } llxFooter();