From f3646dce614534298b01402613315c147f32ddb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jan 2005 00:52:31 +0000 Subject: [PATCH] Fix: Pb register_globals=off --- htdocs/product/stock/fiche.php | 69 ++++++++++++++++------------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 4899ba25ce4..04248a5266c 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,8 +21,16 @@ * */ +/** \file htdocs/product/stock/fiche.php + \group stock + \brief Page fiche entrepot + \version $Revision$ +*/ + require("./pre.inc.php"); +$langs->load("products"); + $mesg = ''; @@ -52,18 +60,18 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) if ( $entrepot->update($_GET["id"], $user)) { - $action = ''; + $_GET["cancel"] = ''; $mesg = 'Fiche mise à jour'; } else { - $action = 're-edit'; + $_GET["cancel"] = 're-edit'; $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; } } else { - $action = 're-edit'; + $_GET["cancel"] = 're-edit'; $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; } } @@ -71,16 +79,14 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) llxHeader("","","Fiche entrepôt"); -if ($cancel == $langs->trans("Cancel")) +if ($_GET["cancel"] == $langs->trans("Cancel")) { - $action = ''; + $_GET["action"] = ''; } + + /* - * Affichage - * - */ -/* - * Création + * Affichage fiche en mode création * */ @@ -89,18 +95,18 @@ if ($_GET["action"] == 'create') print "
\n"; print ''; print ''."\n"; - print_titre("Nouvel entrepôt"); + print_titre($langs->trans("NewWarehouse")); - print ''; + print '
'; print ''; print '"; - print ''; - print ''; + print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Description").''; print '
'.$langs->trans("Status").''; + print '
'.$langs->trans("Status").''; print '
 
 
'; print '
'; } @@ -116,14 +122,14 @@ else if ( $result ) { - if ($action <> 'edit' && $action <> 're-edit') + if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') { print_fiche_titre('Fiche entrepot', $mesg); - print ''; + print '
'; print ''; print ''; - print ''; + print ''; print '"; @@ -132,14 +138,14 @@ else } - if (($_GET["action"] == 'edit' || $action == 're-edit') && 1) + if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && 1) { print_fiche_titre('Edition de la fiche entrepot', $mesg); print "id\" method=\"post\">\n"; print ''; - print '
'.$langs->trans("Label").''.$entrepot->libelle.'
'.$langs->trans("Description").''.nl2br($entrepot->description).'
statut'.$entrepot->statuts[$entrepot->statut].'
'.$langs->trans("Status").''.$entrepot->statuts[$entrepot->statut].'
Nb de produits'; print $entrepot->nb_products(); print "
'; + print '
'; print ''; print '"; print ''; print "".'
'.$langs->trans("Label").'
'.$langs->trans("Description").''; print '
'.$langs->trans("Status").''; print ''; print '
 '; @@ -165,10 +166,11 @@ else } else { - print "Error"; + dolibarr_print_error($db); } } + /* ************************************************************************** */ /* */ /* Barre d'action */ @@ -177,12 +179,7 @@ else print "
\n"; -if ($action == '' && ($user->rights->produit->modifier || $user->rights->produit->creer)) -{ - print "Changer le prix"; -} - -if ($action == '') +if ($_GET["action"] == '') { print "id\">".$langs->trans("Edit").""; }