Fix: Pb register globals

This commit is contained in:
Laurent Destailleur 2005-07-09 19:10:45 +00:00
parent 9e1ecdf43a
commit 0ae2ef4cb3

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -21,7 +21,8 @@
* *
*/ */
/*! \file htdocs/compta/facture/fiche-rec.php /**
\file htdocs/compta/facture/fiche-rec.php
\ingroup facture \ingroup facture
\brief Page d'affichage d'une facture récurrent \brief Page d'affichage d'une facture récurrent
\version $Revision$ \version $Revision$
@ -30,53 +31,55 @@
require("./pre.inc.php"); require("./pre.inc.php");
require("./facture-rec.class.php"); require("./facture-rec.class.php");
require("../../project.class.php");
$user->getrights('facture'); $user->getrights('facture');
if (!$user->rights->facture->lire) if (!$user->rights->facture->lire)
accessforbidden(); accessforbidden();
require("../../project.class.php");
llxHeader('','Facture récurrente','ch-facture.html#s-fac-facture-rec'); llxHeader('','Facture récurrente','ch-facture.html#s-fac-facture-rec');
/* // Sécurité accés client
* Sécurité accés client
*/
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
$socidp = $user->societe_id; $socidp = $user->societe_id;
} }
/* /*
* * Actions
*/ */
if ($_POST["action"] == 'add')
{
$facturerec = new FactureRec($db, $facid);
$facturerec->titre = $_POST["titre"]; // Ajout
if ($_POST["action"] == 'add')
if ($facturerec->create($user) > 0) {
$facturerec = new FactureRec($db, $_POST["facid"]);
$facturerec->titre = $_POST["titre"];
if ($facturerec->create($user) > 0)
{ {
$facid = $facturerec->id; $facid = $facturerec->id;
$action = ''; $action = '';
} }
else else
{ {
$action = "create"; $action = "create";
} }
} }
/*
*
*/
if ($action == 'delete' && $user->rights->facture->supprimer) // Suppression
if ($_POST["action"] == 'delete' && $user->rights->facture->supprimer)
{ {
$fac = new FactureRec($db); $fac = new FactureRec($db);
$fac->delete($facid); $fac->delete($_POST["facid"]);
$facid = 0 ; $facid = 0 ;
} }
/* /*
* *
*/ */
@ -87,8 +90,6 @@ $html = new Form($db);
* *
* Mode creation * Mode creation
* *
*
*
************************************************************************/ ************************************************************************/
if ($_GET["action"] == 'create') if ($_GET["action"] == 'create')
{ {