From 4df4636253cd5b4c9bb59ccc725aed6fcbd4d19d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 21 Jul 2004 16:08:31 +0000 Subject: [PATCH] Modif register_global --- htdocs/compta/bank/fiche.php | 131 ++++++++++++++--------------- htdocs/compta/bank/ligne.php | 14 +-- htdocs/compta/paiement.php | 12 +-- htdocs/compta/paiement/fiche.php | 4 +- htdocs/compta/paiement/rapport.php | 8 +- htdocs/product/liste.php | 12 +-- htdocs/product/stock/fiche.php | 36 ++++---- 7 files changed, 107 insertions(+), 110 deletions(-) diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index c63a62d1e27..c5756f289de 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -56,29 +56,26 @@ if ($_POST["action"] == 'add') $id = $account->create($user->id); } -if ($action == 'update') +if ($_POST["action"] == 'update') { - $account = new Account($db, $id); - $account->fetch($id); + $account = new Account($db, $_GET["id"]); + $account->fetch($_GET["id"]); - $account->bank = $_POST["bank"]; - $account->label = $_POST["label"]; - - $account->courant = $_POST["courant"]; - $account->clos = $_POST["clos"]; - - $account->code_banque = $_POST["code_banque"]; - $account->code_guichet = $_POST["code_guichet"]; - $account->number = $_POST["number"]; - $account->cle_rib = $_POST["cle_rib"]; - $account->bic = $_POST["bic"]; - $account->iban_prefix = $_POST["iban_prefix"]; - $account->domiciliation = $_POST["domiciliation"]; - - $account->proprio = $_POST["proprio"]; + $account->bank = $_POST["bank"]; + $account->label = $_POST["label"]; + $account->courant = $_POST["courant"]; + $account->clos = $_POST["clos"]; + $account->code_banque = $_POST["code_banque"]; + $account->code_guichet = $_POST["code_guichet"]; + $account->number = $_POST["number"]; + $account->cle_rib = $_POST["cle_rib"]; + $account->bic = $_POST["bic"]; + $account->iban_prefix = $_POST["iban_prefix"]; + $account->domiciliation = $_POST["domiciliation"]; + $account->proprio = $_POST["proprio"]; $account->adresse_proprio = $_POST["adresse_proprio"]; - $account->update($id, $user); + $account->update($_GET["id"], $user); } @@ -89,15 +86,15 @@ if ($action == 'update') /* */ /* ************************************************************************** */ -if ($action == 'create') +if ($_GET["action"] == 'create') { print_titre("Nouveau compte bancaire"); - print '
'; + print ''; print ''; print ''; - print ''; + print '
'; print ''; print ''; @@ -153,46 +150,46 @@ if ($action == 'create') /* ************************************************************************** */ else { - if ($id && $action != 'edit') + if ($_GET["id"] && $_GET["action"] != 'edit') { - $account = new Account($db, $id); - $account->fetch($id); + $account = new Account($db, $_GET["id"]); + $account->fetch($_GET["id"]); /* * Affichage onglets */ $h = 0; - $head[$h][0] = DOL_URL_ROOT."$PHP_SELF"; + $head[$h][0] = "fiche.php?id=$account->id"; $head[$h][1] = "Compte bancaire $account->number"; $h++; - dolibarr_fiche_head($head, $hselected); + dolibarr_fiche_head($head, $hselected); - print '
Banque
'; + print '
'; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - /* - print ''; - print ''; - */ + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + /* + print ''; + print ''; + */ print ''; print ''; @@ -225,7 +222,7 @@ else if ($user->admin) { - print 'Editer'; + print 'Editer'; } print ''; @@ -238,24 +235,24 @@ else /* */ /* ************************************************************************** */ - if ($id && $action == 'edit' && $user->admin) - { - - $account = new Account($db, $id); - $account->fetch($id); - - $form = new Form($db); - + if ($_GET["id"] && $_GET["action"] == 'edit' && $user->admin) + { + + $account = new Account($db, $_GET["id"]); + $account->fetch($_GET["id"]); + + $form = new Form($db); + print '
Compte bancaire

'; - - print ''; - print ''; - - print '
Banque'.$account->bank.'
Banque'.$account->bank.'
Libellé'.$account->label.'
Code BanqueCode GuichetNuméroClé RIB
'.$account->code_banque.''.$account->code_guichet.''.$account->number.''.$account->cle_rib.'
Clé IBAN'.$account->iban_prefix.'
Identifiant BIC'.$account->bic.'
Domiciliation'.$account->domiciliation.'
Libellé'.$account->label.'
Code BanqueCode GuichetNuméroClé RIB
'.$account->code_banque.''.$account->code_guichet.''.$account->number.''.$account->cle_rib.'
Clé IBAN'.$account->iban_prefix.'
Identifiant BIC'.$account->bic.'
Domiciliation'.$account->domiciliation.'
Compte Courant'.$yn[$account->courant].'
'; - - print ''; - print ''; - + + print ''; + print ''; + + print '
Banque
'; + + print ''; + print ''; + print ''; print ''; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 7a9463e7d4f..9a0ecdfbc61 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -89,13 +89,13 @@ if ($action == 'update') $result = $db->query($sql); } -if ($HTTP_POST_VARS["action"] == 'type') +if ($_POST["action"] == 'type') { $sql = "update ".MAIN_DB_PREFIX."bank set fk_type='$value' where rowid = $rowid;"; $result = $db->query($sql); } -if ($HTTP_POST_VARS["action"] == 'num_releve') +if ($_POST["action"] == 'num_releve') { $sql = "update ".MAIN_DB_PREFIX."bank set num_releve=$num_rel where rowid = $rowid;"; $result = $db->query($sql); @@ -121,7 +121,7 @@ if ($result) if ($action == 'delete_categ') { $html = new Form($db); - $html->form_confirm("$PHP_SELF?rowid=$rowid&cat1=$fk_categ","Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); + $html->form_confirm("ligne.php?rowid=$rowid&cat1=$fk_categ","Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); } print_titre("Edition de la ligne"); @@ -155,7 +155,7 @@ if ($result) $var=!$var; print ""; - print ""; + print ""; print ""; print "\n"; @@ -185,7 +185,7 @@ if ($result) print ""; - print "rowid\">"; + print "rowid\">"; print ""; print "
Banque
Libellé
".strftime("%d %b %Y",$objp->do)."
 "; - print "rowid\">"; + print "rowid\">"; print ''; print '
Compte".$acct->label."
Libellé"; @@ -232,7 +232,7 @@ if ($result) } print ""; - print "
rowid\">"; + print "rowid\">"; print ''; print "
Relevé"; print ''; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 17829a917f5..84fa64c94eb 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -33,9 +33,9 @@ $facid=isset($_GET["facid"])?$_GET["facid"]:$_POST["facid"]; if ($_POST["action"] == 'add_paiement') { - if ($HTTP_POST_VARS["paiementid"] > 0) + if ($_POST["paiementid"] > 0) { - + $datepaye = $db->idate(mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], @@ -48,11 +48,11 @@ if ($_POST["action"] == 'add_paiement') if (substr($key,0,7) == 'amount_') { $other_facid = substr($key,7); - + $amounts[$other_facid] = $_POST[$key]; } } - + // TODO Mettre toute la chaine dans une même transaction // Creation de la ligne paiement @@ -361,14 +361,14 @@ if ($action == '') $i = 0; $var=True; - print_barre_liste("Paiements", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num); + print_barre_liste("Paiements", $page, "paiement.php","",$sortfield,$sortorder,'',$num); print ''; print ''; print ""; print ""; print "'; print ""; print "\n"; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 165088326d8..80985d7cdae 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -25,7 +25,7 @@ require("../../paiement.class.php"); $user->getrights('facture'); -if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == 'yes' && $user->rights->facture->creer) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->facture->creer) { $paiement = new Paiement($db); $paiement->id = $_GET["id"]; @@ -63,7 +63,7 @@ $html = new Form($db); if ($_GET["action"] == 'delete') { print '
'; - $html->form_confirm("$PHP_SELF?id=$paiement->id","Supprimer le paiement","Etes-vous sûr de vouloir supprimer ce paiement ?","confirm_delete"); + $html->form_confirm("fiche.php?id=$paiement->id","Supprimer le paiement","Etes-vous sûr de vouloir supprimer ce paiement ?","confirm_delete"); } diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 307f04b5408..b02cae48e58 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2004 Rodolphe Quiedeville * * 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 @@ -33,12 +33,12 @@ require("../../includes/modules/rapport/pdf_paiement.class.php"); $dir = DOL_DOCUMENT_ROOT."/document/rapport/"; -if ($HTTP_POST_VARS["action"] == 'gen') +if ($_POST["action"] == 'gen') { $rap = new pdf_paiement($db); - $rap->write_pdf_file($dir, $HTTP_POST_VARS["remonth"], $HTTP_POST_VARS["reyear"]); + $rap->write_pdf_file($dir, $_POST["remonth"], $_POST["reyear"]); - $year = $HTTP_POST_VARS["reyear"]; + $year = $_POST["reyear"]; } llxHeader(); diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 448a46b3dc4..702c98e3d0a 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -58,7 +58,7 @@ if ($fourn_id > 0) $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf"; } -if ($HTTP_POST_VARS["sall"]) +if ($_POST["sall"]) { $sql .= " WHERE lower(p.ref) like '%".strtolower($sall)."%'"; $sql .= " OR lower(p.label) like '%".strtolower($sall)."%'"; @@ -114,7 +114,7 @@ if ($result) { llxHeader("","","Recherche Produit/Service"); - print_barre_liste("Recherche d'un produit ou service", $page, $PHP_SELF, "&sref=$sref&snom=$snom&envente=$envente", $sortfield, $sortorder,'',$num); + print_barre_liste("Recherche d'un produit ou service", $page, "liste.php", "&sref=$sref&snom=$snom&envente=$envente", $sortfield, $sortorder,'',$num); } else { @@ -129,17 +129,17 @@ if ($result) $envente=1; } - print_barre_liste($texte, $page, $PHP_SELF, "&sref=$sref&snom=$snom&fourn_id=$fourn_id&type=$type", $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id&type=$type", $sortfield, $sortorder,'',$num); } print '
FactureDate"; - print_liste_field_titre("Type",$PHP_SELF,"c.libelle","",""); + print_liste_field_titre("Type","paiement.php","c.libelle","",""); print 'Montant 
'; print "\n"; print ''; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 2af5161ed5e..36563565aec 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2004 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -28,27 +28,27 @@ $mesg = ''; llxHeader("","","Fiche entrepôt"); -if ($HTTP_POST_VARS["action"] == 'add') +if ($_POST["action"] == 'add') { $entrepot = new Entrepot($db); - $entrepot->ref = $HTTP_POST_VARS["ref"]; - $entrepot->libelle = $HTTP_POST_VARS["libelle"]; - $entrepot->description = $HTTP_POST_VARS["desc"]; - $entrepot->statut = $HTTP_POST_VARS["statut"]; + $entrepot->ref = $_POST["ref"]; + $entrepot->libelle = $_POST["libelle"]; + $entrepot->description = $_POST["desc"]; + $entrepot->statut = $_POST["statut"]; $id = $entrepot->create($user); $action = ''; } -if ($HTTP_POST_VARS["action"] == 'update' && $cancel <> 'Annuler') +if ($_POST["action"] == 'update' && $cancel <> 'Annuler') { $entrepot = new Entrepot($db); if ($entrepot->fetch($id)) { - $entrepot->libelle = $HTTP_POST_VARS["libelle"]; - $entrepot->description = $HTTP_POST_VARS["desc"]; - $entrepot->statut = $HTTP_POST_VARS["statut"]; + $entrepot->libelle = $_POST["libelle"]; + $entrepot->description = $_POST["desc"]; + $entrepot->statut = $_POST["statut"]; if ( $entrepot->update($id, $user)) { @@ -79,7 +79,7 @@ if ($cancel == 'Annuler') */ if ($_GET["action"] == 'create') { - print "\n"; + print "\n"; print ''; print ''."\n"; print_titre("Nouvel entrepôt"); @@ -129,7 +129,7 @@ else { print_fiche_titre('Edition de la fiche entrepot', $mesg); - print "\n"; + print "\n"; print ''; print '
"; - print_liste_field_titre("Réf",$PHP_SELF, "p.ref","&envente=$envente&type=$type&fourn_id=$fourn_id"); + print_liste_field_titre("Réf","liste.php", "p.ref","&envente=$envente&type=$type&fourn_id=$fourn_id"); print ""; - print_liste_field_titre("Libellé",$PHP_SELF, "p.label","&envente=$envente&type=$type&fourn_id=$fourn_id"); + print_liste_field_titre("Libellé","liste.php", "p.label","&envente=$envente&type=$type&fourn_id=$fourn_id"); print ""; - print_liste_field_titre("Prix de vente",$PHP_SELF, "p.price","&envente=$envente&type=$type&fourn_id=$fourn_id"); + print_liste_field_titre("Prix de vente","liste.php", "p.price","&envente=$envente&type=$type&fourn_id=$fourn_id"); print "
'; @@ -171,14 +171,14 @@ else print "
\n"; if ($action == '' && ($user->rights->produit->modifier || $user->rights->produit->creer)) - { - print "Changer le prix"; - } +{ + print "Changer le prix"; +} if ($action == '') - { - print "Editer"; - } +{ + print "Editer"; +} print "
";