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 "
\n"; + print "\n"; print "\n"; print ''."\n"; print '
Nouveau '.$types[$type].'

'."\n"; @@ -249,7 +249,7 @@ else { if ($_GET["id"]) { - if ($action <> 're-edit') + if ($_GET["action"] <> 're-edit') { $product = new Product($db); $result = $product->fetch($_GET["id"]); @@ -257,7 +257,7 @@ else if ( $result ) { - if ($action <> 'edit' && $action <> 're-edit') + if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') { /* * Fiche en visu @@ -391,10 +391,10 @@ else print "
\n"; - if ($action == 'edit_price' && $user->rights->produit->creer) + if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) { print '
Nouveau prix
'; - print "\n"; + print "id\" method=\"post\">\n"; print ''; print ''; print ''; @@ -443,11 +443,11 @@ else * Fiche en mode edition */ - if (($action == 'edit' || $action == 're-edit') && $user->rights->produit->creer) + if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && $user->rights->produit->creer) { print_fiche_titre('Edition de la fiche '.$types[$product->type].' : '.$product->ref, $mesg); - print "\n"; + print "id\" method=\"post\">\n"; print ''; print '
Prix de vente
'; @@ -545,31 +545,31 @@ else print "
\n"; -if ($action == '') +if ($_GET["action"] == '') { if ($user->rights->produit->modifier || $user->rights->produit->creer) { - print 'Changer le prix'; + print 'Changer le prix'; } } -if ($action == '') +if ($_GET["action"] == '') { if ($user->rights->produit->modifier || $user->rights->produit->creer) { - print 'Editer'; + print 'Editer'; } } if ($product->type == 0 && defined("MAIN_MODULE_STOCK")) { - print 'Correction stock'; + print 'Correction stock'; } print "
"; -if ($id && $action == '' && $product->envente) +if ($id && $_GET["action"] == '' && $product->envente) { $htmls = new Form($db);