commit
80b2b7d8f2
@ -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 '<br><br>';
|
||||
print_titre($langs->trans('AddNewProductStockWarehouse'));
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="action" value="addlimitstockwarehouse">';
|
||||
print '<input type="hidden" name="id" value="'.GETPOST('id').'">';
|
||||
if (!empty($user->rights->produit->creer)){
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="action" value="addlimitstockwarehouse">';
|
||||
print '<input type="hidden" name="id" value="'.GETPOST('id').'">';
|
||||
}
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><td width="40%" colspan="4">'.$formproduct->selectWarehouses('', 'fk_entrepot').'</td>';
|
||||
print '<td align="right"><input name="seuil_stock_alerte" type="text" placeholder="'.$langs->trans("StockLimit").'" /></td>';
|
||||
print '<td align="right"><input name="desiredstock" type="text" placeholder="'.$langs->trans("DesiredStock").'" /></td>';
|
||||
print '<td align="right"><input type="submit" value="'.$langs->trans('Save').'" class="button" /></td>';
|
||||
print '</tr>';
|
||||
if (!empty($user->rights->produit->creer)){
|
||||
print '<tr class="liste_titre"><td width="40%">'.$formproduct->selectWarehouses('', 'fk_entrepot').'</td>';
|
||||
print '<td align="right"><input name="seuil_stock_alerte" type="text" placeholder="'.$langs->trans("StockLimit").'" /></td>';
|
||||
print '<td align="right"><input name="desiredstock" type="text" placeholder="'.$langs->trans("DesiredStock").'" /></td>';
|
||||
print '<td align="right"><input type="submit" value="'.$langs->trans('Save').'" class="button" /></td>';
|
||||
print '</tr>';
|
||||
}else{
|
||||
print '<tr class="liste_titre"><td width="40%">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td align="right">'.$langs->trans("StockLimit").'</td>';
|
||||
print '<td align="right">'.$langs->trans("DesiredStock").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$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 '<tr class="oddeven"><td width="40%" colspan="4">'.$ent->getNomUrl(3).'</td>';
|
||||
print '<tr class="oddeven"><td width="40%">'.$ent->getNomUrl(3).'</td>';
|
||||
print '<td align="right">'.$line['seuil_stock_alerte'].'</td>';
|
||||
print '<td align="right">'.$line['desiredstock'].'</td>';
|
||||
print '<td align="right"><a href="?id='.GETPOST('id').'&fk_productstockwarehouse='.$line['id'].'&action=delete_productstockwarehouse">'.img_delete().'</a></td>';
|
||||
if (!empty($user->rights->produit->creer)){
|
||||
print '<td align="right"><a href="?id='.GETPOST('id').'&fk_productstockwarehouse='.$line['id'].'&action=delete_productstockwarehouse">'.img_delete().'</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</form>';
|
||||
if (!empty($user->rights->produit->creer)){
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user