Uniformize code

This commit is contained in:
Laurent Destailleur 2011-02-11 19:48:12 +00:00
parent d07aeb87c0
commit e54dd25c04

View File

@ -21,7 +21,7 @@
/** /**
* \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 recurrente * \brief Page to show predefined invoice
* \version $Id$ * \version $Id$
*/ */
@ -33,8 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
$langs->load('bills'); $langs->load('bills');
// Security check // Security check
$facid=isset($_GET["facid"])?$_GET["facid"]:$_POST["facid"]; $facid=GETPOST("facid");
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; $action=GETPOST("action");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$objecttype = 'facture_rec'; $objecttype = 'facture_rec';
if ($action == "create" || $action == "add") $objecttype = ''; if ($action == "create" || $action == "add") $objecttype = '';
@ -83,7 +83,7 @@ if ($_POST["action"] == 'add')
if ($_REQUEST["action"] == 'delete' && $user->rights->facture->supprimer) if ($_REQUEST["action"] == 'delete' && $user->rights->facture->supprimer)
{ {
$fac = new FactureRec($db); $fac = new FactureRec($db);
$fac->delete($_REQUEST["facid"]); $fac->delete(GETPOST("facid"));
$facid = 0 ; $facid = 0 ;
} }
@ -106,9 +106,9 @@ if ($_GET["action"] == 'create')
if ($mesg) print $mesg.'<br>'; if ($mesg) print $mesg.'<br>';
$facture = new Facture($db); $facture = new Facture($db); // Source invoice
$product_static=new Product($db); $product_static=new Product($db);
// Instantiate hooks of thirdparty module // Instantiate hooks of thirdparty module
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules)) if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
{ {
@ -340,7 +340,7 @@ else
if ($facid > 0) if ($facid > 0)
{ {
$fac = New FactureRec($db,0); $fac = new FactureRec($db,0);
if ( $fac->fetch($facid, $user->societe_id) > 0) if ( $fac->fetch($facid, $user->societe_id) > 0)
{ {