diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index b1525b7be1c..d2af1b55f3c 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -40,14 +40,14 @@ if ($user->societe_id > 0) /* * */ -if ($HTTP_POST_VARS["action"] == 'add') +if ($_POST["action"] == 'add') { $expedition = new Expedition($db); $expedition->date_expedition = time(); - $expedition->note = $HTTP_POST_VARS["note"]; - $expedition->commande_id = $HTTP_POST_VARS["commande_id"]; - $expedition->entrepot_id = $HTTP_POST_VARS["entrepot_id"]; + $expedition->note = $_POST["note"]; + $expedition->commande_id = $_POST["commande_id"]; + $expedition->entrepot_id = $_POST["entrepot_id"]; $commande = new Commande($db); $commande->fetch($expedition->commande_id); @@ -57,9 +57,9 @@ if ($HTTP_POST_VARS["action"] == 'add') { $qty = "qtyl".$i; $idl = "idl".$i; - if ($HTTP_POST_VARS[$qty] > 0) + if ($_POST[$qty] > 0) { - $expedition->addline($HTTP_POST_VARS[$idl],$HTTP_POST_VARS[$qty]); + $expedition->addline($_POST[$idl],$_POST[$qty]); } } @@ -67,7 +67,7 @@ if ($HTTP_POST_VARS["action"] == 'add') $id = $expedition->id; - $action = ''; + Header("Location:fiche.php?id=$id"); } /* @@ -75,14 +75,14 @@ if ($HTTP_POST_VARS["action"] == 'add') */ -if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] == yes && $user->rights->expedition->valider) +if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == yes && $user->rights->expedition->valider) { $expedition = new Expedition($db); $expedition->fetch($_GET["id"]); $result = $expedition->valid($user); } -if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) { if ($user->rights->expedition->supprimer ) { @@ -106,7 +106,7 @@ $html = new Form($db); * * ************************************************************************/ -if ($HTTP_POST_VARS["action"] == 'create') +if ($_POST["action"] == 'create') { llxHeader('','Fiche expedition','ch-expedition.html',$form_search); @@ -115,7 +115,7 @@ if ($HTTP_POST_VARS["action"] == 'create') $commande = new Commande($db); $commande->livraison_array(); - if ( $commande->fetch($HTTP_POST_VARS["commande_id"])) + if ( $commande->fetch($_POST["commande_id"])) { $soc = new Societe($db); $soc->fetch($commande->soc_id); @@ -130,7 +130,7 @@ if ($HTTP_POST_VARS["action"] == 'create') print '
'; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -148,7 +148,7 @@ if ($HTTP_POST_VARS["action"] == 'create') print ''; print ''; print "\n"; @@ -219,7 +219,7 @@ if ($HTTP_POST_VARS["action"] == 'create') if (defined("MAIN_MODULE_STOCK")) { - $stock = $product->stock_entrepot[$HTTP_POST_VARS["entrepot_id"]]; + $stock = $product->stock_entrepot[$_POST["entrepot_id"]]; print ''; print ''; @@ -290,7 +290,7 @@ else * Confirmation de la suppression * */ - if ($action == 'delete') + if ($_GET["action"] == 'delete') { $html->form_confirm("fiche.php?id=$expedition->id","Supprimer l'expedition","Etes-vous sûr de vouloir supprimer cette expedition ?","confirm_delete"); } @@ -339,7 +339,7 @@ else $entrepot = new Entrepot($db); $entrepot->fetch($expedition->entrepot_id); - print ''; + print ''; print "
Client'.$soc->nom.'
Entrepôt'; $ents = $entrepot->list_array(); - print $ents[$HTTP_POST_VARS["entrepot_id"]]; + print $ents[$_POST["entrepot_id"]]; print 'Auteur$author->fullnameEntrepôt'.$entrepot->libelle.'
Entrepôt'.$entrepot->libelle.'
\n"; @@ -400,55 +400,25 @@ else print ""; /* - * Fin Ajout ligne * */ if ($user->societe_id == 0) { - print '

'; - + print '

'; + if ($expedition->brouillon && $user->rights->expedition->supprimer) { - print "
"; - } - else - { - print ""; + print 'Supprimer'; } - - print ""; - - - - print ''; - print ''; if ($expedition->statut == 0) { if ($user->rights->expedition->valider) { - print ""; + print 'Valider'; } - else - { - print ''; - } - } - elseif ($commande->statut == 1) - { - if ($user->rights->commande->valider) - { - print ""; - } - else - { - print ''; - } - } - else - { - print ''; + } print "
id&action=delete\">Supprimer----id&action=valid\">Valider-id&action=annuler\">Annuler la commande--
";