Ajout bouton de commande directe

This commit is contained in:
Rodolphe Quiedeville 2004-11-22 08:08:59 +00:00
parent 6e676f4aee
commit 6bbfa31152

View File

@ -86,7 +86,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
// Action mise a jour d'un produit ou service // Action mise a jour d'un produit ou service
if ($_POST["action"] == 'update' && if ($_POST["action"] == 'update' &&
$_POST["cancel"] <> $langs->trans("Cancel") && $_POST["cancel"] <> $langs->trans("Cancel") &&
( $user->rights->produit->modifier || $user->rights->produit->creer)) $user->rights->produit->creer)
{ {
$product = new Product($db); $product = new Product($db);
if ($product->fetch($_POST["id"])) if ($product->fetch($_POST["id"]))
@ -140,8 +140,7 @@ if ($_POST["action"] == 'addinpropal')
} }
if ($_POST["action"] == 'addinfacture' && if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer)
( $user->rights->facture->modifier || $user->rights->facture->creer))
{ {
$product = new Product($db); $product = new Product($db);
$result = $product->fetch($_GET["id"]); $result = $product->fetch($_GET["id"]);
@ -195,8 +194,7 @@ if ($_GET["action"] == 'remove_fourn')
if ($_POST["action"] == 'update_price' && if ($_POST["action"] == 'update_price' &&
$_POST["cancel"] <> $langs->trans("Cancel") && $_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->produit->creer)
( $user->rights->produit->modifier || $user->rights->produit->creer))
{ {
$product = new Product($db); $product = new Product($db);
@ -401,11 +399,11 @@ else
if ( $db->query($sql) ) if ( $db->query($sql) )
{ {
$num = $db->num_rows(); $num_fournisseur = $db->num_rows();
$i = 0; $i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$var=True; $var=True;
while ($i < $num) while ($i < $num_fournisseur)
{ {
$objp = $db->fetch_object($i); $objp = $db->fetch_object($i);
$var=!$var; $var=!$var;
@ -613,19 +611,25 @@ print "\n<div class=\"tabsAction\">\n";
if ($_GET["action"] == '') if ($_GET["action"] == '')
{ {
if ($user->rights->produit->modifier || $user->rights->produit->creer) if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1)
{
print '<a class="tabAction" href="fiche.php?action=edit_price&amp;id='.$product->id.'">'.$langs->trans("Commander").'</a>';
}
if ( $user->rights->produit->creer)
{ {
print '<a class="tabAction" href="fiche.php?action=edit_price&amp;id='.$product->id.'">'.$langs->trans("UpdatePrice").'</a>'; print '<a class="tabAction" href="fiche.php?action=edit_price&amp;id='.$product->id.'">'.$langs->trans("UpdatePrice").'</a>';
} }
}
if ($_GET["action"] == '') if ( $user->rights->produit->creer)
{
if ($user->rights->produit->modifier || $user->rights->produit->creer)
{ {
print '<a class="tabAction" href="fiche.php?action=edit&amp;id='.$product->id.'">'.$langs->trans("Edit").'</a>'; print '<a class="tabAction" href="fiche.php?action=edit&amp;id='.$product->id.'">'.$langs->trans("Edit").'</a>';
} }
} }
if ($product->type == 0 && defined("MAIN_MODULE_STOCK")) if ($product->type == 0 && defined("MAIN_MODULE_STOCK"))
{ {
print '<a class="tabAction" href="stock/product.php?id='.$product->id.'&amp;action=correction">Correction stock</a>'; print '<a class="tabAction" href="stock/product.php?id='.$product->id.'&amp;action=correction">Correction stock</a>';