From 6bbfa311525c717752cd82e153bfed8b047a6f76 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 22 Nov 2004 08:08:59 +0000 Subject: [PATCH] Ajout bouton de commande directe --- htdocs/product/fiche.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index a5fc53f4729..a0277f71879 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -86,7 +86,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) // Action mise a jour d'un produit ou service if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel") && - ( $user->rights->produit->modifier || $user->rights->produit->creer)) + $user->rights->produit->creer) { $product = new Product($db); if ($product->fetch($_POST["id"])) @@ -140,8 +140,7 @@ if ($_POST["action"] == 'addinpropal') } -if ($_POST["action"] == 'addinfacture' && - ( $user->rights->facture->modifier || $user->rights->facture->creer)) +if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer) { $product = new Product($db); $result = $product->fetch($_GET["id"]); @@ -195,8 +194,7 @@ if ($_GET["action"] == 'remove_fourn') if ($_POST["action"] == 'update_price' && - $_POST["cancel"] <> $langs->trans("Cancel") && - ( $user->rights->produit->modifier || $user->rights->produit->creer)) + $_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->produit->creer) { $product = new Product($db); @@ -401,11 +399,11 @@ else if ( $db->query($sql) ) { - $num = $db->num_rows(); + $num_fournisseur = $db->num_rows(); $i = 0; print ''; $var=True; - while ($i < $num) + while ($i < $num_fournisseur) { $objp = $db->fetch_object($i); $var=!$var; @@ -613,19 +611,25 @@ print "\n
\n"; if ($_GET["action"] == '') { - if ($user->rights->produit->modifier || $user->rights->produit->creer) + if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1) + { + print ''.$langs->trans("Commander").''; + } + + + + + if ( $user->rights->produit->creer) { print ''.$langs->trans("UpdatePrice").''; } -} -if ($_GET["action"] == '') -{ - if ($user->rights->produit->modifier || $user->rights->produit->creer) + if ( $user->rights->produit->creer) { print ''.$langs->trans("Edit").''; } } + if ($product->type == 0 && defined("MAIN_MODULE_STOCK")) { print 'Correction stock';