diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 0b36f43f200..98cd83d1ee3 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -36,7 +36,7 @@ if (!$user->rights->produit->lire) llxHeader("","","Fiche produit"); -if ($action == 'add') +if ($_POST["action"] == 'add') { $product = new Product($db); @@ -116,12 +116,12 @@ if ($_GET["action"] == 'remove_fourn') { if ($product->remove_fournisseur($user, $_GET["id_fourn"]) > 0) { - $action = ''; + $_GET["action"] = ''; $mesg = 'Founisseur supprimé'; } else { - $action = ''; + $_GET["action"] = ''; } } } @@ -166,14 +166,14 @@ if ($_POST["action"] == 'update' && } if ($_POST["action"] == 'update_price' && - $cancel <> 'Annuler' && + $_POST["cancel"] <> 'Annuler' && ( $user->rights->produit->modifier || $user->rights->produit->creer)) { $product = new Product($db); - $result = $product->fetch($id); + $result = $product->fetch($_GET["id"]); $product->price = $_POST["price"]; - if ( $product->update_price($id, $user) > 0 ) + if ( $product->update_price($_GET["id"], $user) > 0 ) { $action = ''; $mesg = 'Fiche mise à jour'; @@ -194,11 +194,11 @@ if ($cancel == 'Annuler') * * */ -if ($action == 'create') +if ($_GET["action"] == 'create') { $nbligne=0; - print "