From 45f6b5bd3ce9a3018af5652be4f95d2b4fff6ba3 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 27 Aug 2003 10:58:49 +0000 Subject: [PATCH] Nettoyage du code --- htdocs/admin/index.php | 1 - htdocs/boutique/editeur/fiche.php | 2 -- htdocs/boutique/editeur/index.php | 1 - htdocs/compta/charges/fiche.php3 | 2 -- htdocs/compta/charges/index.php | 3 --- htdocs/compta/paiement/index.php | 2 -- htdocs/compta/sociales/index.php | 10 +++------- htdocs/compta/voyage/bilan.php3 | 7 +++---- htdocs/compta/voyage/index.php | 7 +++---- htdocs/compta/voyage/reduc.php3 | 16 +++------------- htdocs/compta/voyage/voyage.php3 | 8 +++----- htdocs/contrat/fiche.php | 1 - htdocs/contrat/index.php | 2 -- htdocs/domain/index.php | 1 - htdocs/fichinter/fiche.php3 | 2 -- htdocs/fichinter/index.php | 2 -- htdocs/fourn/contact.php3 | 2 -- htdocs/fourn/people.php3 | 1 - htdocs/main.inc.php3 | 5 +++++ 19 files changed, 20 insertions(+), 55 deletions(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index bbb7f325686..509776aec7c 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -42,7 +42,6 @@ print 'user' . $conf->db->user . '  pass' . $conf->db->pass . '  '; print 'Database name' . $conf->db->name . ' '; - print ''; llxFooter("Dernière modification $Date$ révision $Revision$"); diff --git a/htdocs/boutique/editeur/fiche.php b/htdocs/boutique/editeur/fiche.php index dd46feed371..3c53392c2b8 100644 --- a/htdocs/boutique/editeur/fiche.php +++ b/htdocs/boutique/editeur/fiche.php @@ -22,8 +22,6 @@ require("./pre.inc.php"); -$db = new Db(); - if ($action == 'add') { $editeur = new Editeur($db); diff --git a/htdocs/boutique/editeur/index.php b/htdocs/boutique/editeur/index.php index 98fe893b1fd..a1efdec813e 100644 --- a/htdocs/boutique/editeur/index.php +++ b/htdocs/boutique/editeur/index.php @@ -24,7 +24,6 @@ require("./pre.inc.php"); llxHeader(); -$db = new Db(); if ($sortfield == "") { $sortfield="lower(e.nom)"; } diff --git a/htdocs/compta/charges/fiche.php3 b/htdocs/compta/charges/fiche.php3 index 1d9babf159c..1f735cb7254 100644 --- a/htdocs/compta/charges/fiche.php3 +++ b/htdocs/compta/charges/fiche.php3 @@ -25,8 +25,6 @@ require("../service.class.php3"); llxHeader(); -$db = new Db(); - if ($action == 'add') { $service = new Service($db); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 84fa713dbf5..f6ca10024e3 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -23,8 +23,6 @@ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); - function valeur($sql) { global $db; @@ -41,7 +39,6 @@ function valeur($sql) /* * */ -$db = new Db(); print_titre("Charges"); diff --git a/htdocs/compta/paiement/index.php b/htdocs/compta/paiement/index.php index 503a9651297..d35ece689df 100644 --- a/htdocs/compta/paiement/index.php +++ b/htdocs/compta/paiement/index.php @@ -30,10 +30,8 @@ if ($user->societe_id > 0) exit; } - llxHeader(); -$db = new Db(); /* * diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index ffb7cca43e9..1f2a91b1283 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,13 +15,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); - function valeur($sql) { global $db; @@ -41,8 +39,6 @@ function valeur($sql) /* * */ -$db = new Db(); - if ($action == 'add') { diff --git a/htdocs/compta/voyage/bilan.php3 b/htdocs/compta/voyage/bilan.php3 index 4264de9aee3..7c6b54d49ee 100644 --- a/htdocs/compta/voyage/bilan.php3 +++ b/htdocs/compta/voyage/bilan.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,6 +15,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); @@ -25,7 +25,6 @@ require("./reduc.class.php3"); llxHeader(); -$db = new Db(); if ($action == 'add') { $author = $GLOBALS["REMOTE_USER"]; diff --git a/htdocs/compta/voyage/index.php b/htdocs/compta/voyage/index.php index 515b7c9eb38..217db34c154 100644 --- a/htdocs/compta/voyage/index.php +++ b/htdocs/compta/voyage/index.php @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,12 +15,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); if ($action == 'add') { $author = $GLOBALS["REMOTE_USER"]; diff --git a/htdocs/compta/voyage/reduc.php3 b/htdocs/compta/voyage/reduc.php3 index 56aa37a42f5..d0cbbb853ae 100644 --- a/htdocs/compta/voyage/reduc.php3 +++ b/htdocs/compta/voyage/reduc.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,24 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); - - - -if ($vline) { - $viewline = $vline; -} else { - $viewline = 20; -} print_titre ("Abonnement de réduction"); - print ""; print ""; print ""; diff --git a/htdocs/compta/voyage/voyage.php3 b/htdocs/compta/voyage/voyage.php3 index 02481e70914..b6856c40233 100644 --- a/htdocs/compta/voyage/voyage.php3 +++ b/htdocs/compta/voyage/voyage.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ * * 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 @@ -18,13 +15,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); - ?> diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index e2aec9e1c1f..e06ec1fb047 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -26,7 +26,6 @@ require("../facture.class.php3"); llxHeader(); -$db = new Db(); $mesg = ''; if ($action == 'add') diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 3c412d0e54a..fa8bbd5411d 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -21,8 +21,6 @@ */ require("./pre.inc.php"); -$db = new Db(); - llxHeader(); diff --git a/htdocs/domain/index.php b/htdocs/domain/index.php index f8b463433de..d850bd3566b 100644 --- a/htdocs/domain/index.php +++ b/htdocs/domain/index.php @@ -23,7 +23,6 @@ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); if ($action == 'add') { $author = $GLOBALS["REMOTE_USER"]; diff --git a/htdocs/fichinter/fiche.php3 b/htdocs/fichinter/fiche.php3 index 395bb09858c..256a5cae273 100644 --- a/htdocs/fichinter/fiche.php3 +++ b/htdocs/fichinter/fiche.php3 @@ -23,8 +23,6 @@ require("./pre.inc.php3"); require("./fichinter.class.php3"); require("../project.class.php3"); -$db = new Db(); - /* * Sécurité accés client */ diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 99689dabaab..8c226a8ccb2 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -22,9 +22,7 @@ require("./pre.inc.php3"); require("../contact.class.php3"); - llxHeader(); -$db = new Db(); /* * Liste diff --git a/htdocs/fourn/contact.php3 b/htdocs/fourn/contact.php3 index 009105e372f..0bc7a80b7d9 100644 --- a/htdocs/fourn/contact.php3 +++ b/htdocs/fourn/contact.php3 @@ -32,8 +32,6 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } - -$db = new Db(); if ($sortorder == "") { $sortorder="ASC"; diff --git a/htdocs/fourn/people.php3 b/htdocs/fourn/people.php3 index 0ae3e12bd0f..99985eab31f 100644 --- a/htdocs/fourn/people.php3 +++ b/htdocs/fourn/people.php3 @@ -21,7 +21,6 @@ */ require("./pre.inc.php3"); -$db = new Db(); if ($sortorder == "") { $sortfield="lower(s.nom)"; diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index e9ba9bdc691..93204fc33c9 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -72,6 +72,11 @@ define('FPDF_FONTPATH',DOL_DOCUMENT_ROOT .'/includes/fpdf/font/'); $db = new DoliDb(); +// PEAR +//require("DB.php"); +//$dbpear = new DB(); +// +// $user = new User($db); $user->fetch($GLOBALS["REMOTE_USER"]);
DateDescription