Modif register_global

This commit is contained in:
Rodolphe Quiedeville
2004-07-21 16:08:31 +00:00
parent f1f5076e8f
commit 4df4636253
7 changed files with 107 additions and 110 deletions

View File

@@ -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 '<form action="'.$PHP_SELF.'" method="post">';
print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="clos" value="0">';
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<tr><td valign="top">Banque</td>';
print '<td colspan="3"><input size="30" type="text" name="bank" value=""></td></tr>';
@@ -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 '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td valign="top">Banque</td>';
print '<td colspan="3">'.$account->bank.'</td></tr>';
print '<tr><td valign="top">Banque</td>';
print '<td colspan="3">'.$account->bank.'</td></tr>';
print '<tr><td valign="top">Libell<6C></td>';
print '<td colspan="3">'.$account->label.'</td></tr>';
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
print '<tr><td>'.$account->code_banque.'</td>';
print '<td>'.$account->code_guichet.'</td>';
print '<td>'.$account->number.'</td>';
print '<td>'.$account->cle_rib.'</td></tr>';
print '<tr><td valign="top">Cl<43> IBAN</td>';
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
print '<tr><td valign="top">Identifiant BIC</td>';
print '<td colspan="3">'.$account->bic.'</td></tr>';
/*
print '<tr><td valign="top">Domiciliation</td>';
print '<td colspan="3">'.$account->domiciliation.'</td></tr>';
*/
print '<tr><td valign="top">Libell<6C></td>';
print '<td colspan="3">'.$account->label.'</td></tr>';
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
print '<tr><td>'.$account->code_banque.'</td>';
print '<td>'.$account->code_guichet.'</td>';
print '<td>'.$account->number.'</td>';
print '<td>'.$account->cle_rib.'</td></tr>';
print '<tr><td valign="top">Cl<43> IBAN</td>';
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
print '<tr><td valign="top">Identifiant BIC</td>';
print '<td colspan="3">'.$account->bic.'</td></tr>';
/*
print '<tr><td valign="top">Domiciliation</td>';
print '<td colspan="3">'.$account->domiciliation.'</td></tr>';
*/
print '<tr><td valign="top">Compte Courant</td>';
print '<td colspan="3">'.$yn[$account->courant].'</td></tr>';
@@ -225,7 +222,7 @@ else
if ($user->admin)
{
print '<a class="tabAction" href="fiche.php?action=edit&id='.$id.'">Editer</a>';
print '<a class="tabAction" href="fiche.php?action=edit&id='.$account->id.'">Editer</a>';
}
print '</div>';
@@ -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 '<div class="titre">Compte bancaire</div><br>';
print '<form action="'.$PHP_SELF.'?id='.$id.'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td valign="top">Banque</td>';
print '<td colspan="3"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
print '<form action="fiche.php?id='.$account->id.'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table class="border" cellpadding="3" cellspacing="0">';
print '<tr><td valign="top">Banque</td>';
print '<td colspan="3"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
print '<tr><td valign="top">Libell<6C></td>';
print '<td colspan="3"><input size="30" type="text" name="label" value="'.$account->label.'"></td></tr>';

View File

@@ -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&amp;cat1=$fk_categ","Supprimer dans la cat<EFBFBD>gorie","Etes-vous s<EFBFBD>r de vouloir supprimer le classement dans la cat<EFBFBD>gorie ?","confirm_delete_categ");
$html->form_confirm("ligne.php?rowid=$rowid&amp;cat1=$fk_categ","Supprimer dans la cat<EFBFBD>gorie","Etes-vous s<EFBFBD>r de vouloir supprimer le classement dans la cat<EFBFBD>gorie ?","confirm_delete_categ");
}
print_titre("Edition de la ligne");
@@ -155,7 +155,7 @@ if ($result)
$var=!$var;
print "<tr $bc[$var]>";
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$rowid&amp;account=$account\">";
print "<form method=\"post\" action=\"ligne.php?rowid=$rowid&amp;account=$account\">";
print "<input type=\"hidden\" name=\"action\" value=\"class\">";
print "<td>".strftime("%d %b %Y",$objp->do)."</td>\n";
@@ -185,7 +185,7 @@ if ($result)
print "<tr $bc[$var]><td>&nbsp;</td><td colspan=\"5\">";
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
print '<input type="hidden" name="action" value="type">';
print '<select name="value">';
print '<option value="CHQ"'.($objp->fk_type == 'CHQ'?' selected':'').'>CHQ</option>';
@@ -211,7 +211,7 @@ if ($result)
print "<tr $bc[$var]><td>Compte</td><td colspan=\"5\"><a href=\"account.php?account=$account\">".$acct->label."</a></td></tr>";
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<tr $bc[$var]><td>Libell&eacute;</td><td colspan=\"5\">";
@@ -232,7 +232,7 @@ if ($result)
}
print "</form>";
print "<form method=\"post\" action=\"$PHP_SELF?rowid=$objp->rowid\">";
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
print '<input type="hidden" name="action" value="num_releve">';
print "<tr $bc[$var]><td>Relev<EFBFBD></td><td colspan=\"5\">";
print '<input name="num_rel" value="'.$objp->num_releve.'">';

View File

@@ -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 '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
print "<td>Facture</td>";
print "<td>Date</td>";
print "<td>";
print_liste_field_titre("Type",$PHP_SELF,"c.libelle","","");
print_liste_field_titre("Type","paiement.php","c.libelle","","");
print '</td><td align="right">Montant</TD>';
print "<td>&nbsp;</td>";
print "</TR>\n";

View File

@@ -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 '<br>';
$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");
}

View File

@@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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();

View File

@@ -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&amp;envente=$envente", $sortfield, $sortorder,'',$num);
print_barre_liste("Recherche d'un produit ou service", $page, "liste.php", "&sref=$sref&snom=$snom&amp;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&amp;type=$type", $sortfield, $sortorder,'',$num);
print_barre_liste($texte, $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id&amp;type=$type", $sortfield, $sortorder,'',$num);
}
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print "<TR class=\"liste_titre\"><td>";
print_liste_field_titre("R<EFBFBD>f",$PHP_SELF, "p.ref","&amp;envente=$envente&amp;type=$type&fourn_id=$fourn_id");
print_liste_field_titre("R<EFBFBD>f","liste.php", "p.ref","&amp;envente=$envente&amp;type=$type&fourn_id=$fourn_id");
print "</td><td>";
print_liste_field_titre("Libell<EFBFBD>",$PHP_SELF, "p.label","&envente=$envente&type=$type&fourn_id=$fourn_id");
print_liste_field_titre("Libell<EFBFBD>","liste.php", "p.label","&envente=$envente&type=$type&fourn_id=$fourn_id");
print "</td><TD align=\"right\">";
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 "</td></tr>\n";
print '<tr class="liste_titre">';

View File

@@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -28,27 +28,27 @@ $mesg = '';
llxHeader("","","Fiche entrep<65>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 "<form action=\"$PHP_SELF\" method=\"post\">\n";
print "<form action=\"fiche.php\" method=\"post\">\n";
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
print_titre("Nouvel entrep<65>t");
@@ -129,7 +129,7 @@ else
{
print_fiche_titre('Edition de la fiche entrepot', $mesg);
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
print '<input type="hidden" name="action" value="update">';
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
@@ -171,14 +171,14 @@ else
print "<br><div class=\"tabsAction\">\n";
if ($action == '' && ($user->rights->produit->modifier || $user->rights->produit->creer))
{
print "<a class=\"tabAction\" href=\"$PHP_SELF?action=edit_price&id=$id\">Changer le prix</a>";
}
{
print "<a class=\"tabAction\" href=\"fiche.php?action=edit_price&id=$id\">Changer le prix</a>";
}
if ($action == '')
{
print "<a class=\"tabAction\" href=\"$PHP_SELF?action=edit&id=$id\">Editer</a>";
}
{
print "<a class=\"tabAction\" href=\"fiche.php?action=edit&id=$id\">Editer</a>";
}
print "</div>";