From 3e02af4db97c564f78f8a913ac57b9bb43dfc432 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2011 22:55:28 +0000 Subject: [PATCH] Qual: Removed dead code. --- htdocs/compta/class/comptacompte.class.php | 115 ------------------- htdocs/compta/param/comptes/fiche.php | 103 ----------------- htdocs/compta/param/comptes/index.php | 78 ------------- htdocs/compta/param/comptes/liste.php | 126 --------------------- htdocs/compta/param/index.php | 75 ------------ 5 files changed, 497 deletions(-) delete mode 100644 htdocs/compta/class/comptacompte.class.php delete mode 100644 htdocs/compta/param/comptes/fiche.php delete mode 100644 htdocs/compta/param/comptes/index.php delete mode 100644 htdocs/compta/param/comptes/liste.php delete mode 100644 htdocs/compta/param/index.php diff --git a/htdocs/compta/class/comptacompte.class.php b/htdocs/compta/class/comptacompte.class.php deleted file mode 100644 index d0e55c29561..00000000000 --- a/htdocs/compta/class/comptacompte.class.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/compta/class/comptacompte.class.php - * \ingroup compta - * \brief Fichier de la classe des comptes comptable - */ - - -/** \class ComptaCompte - * \brief Classe permettant la gestion des comptes generaux de compta - */ - -class ComptaCompte -{ - var $db ; - - var $id ; - var $num; - var $intitule; - - /** - * \brief Constructeur de la classe - * \param DB handler acces base de donnees - * \param id id compte (0 par defaut) - */ - - function ComptaCompte($DB, $id=0) - { - $this->db = $DB; - $this->id = $id ; - } - - /** - * \brief Insere le produit en base - * \param user utilisateur qui effectue l'insertion - */ - - function create($user) - { - if (dol_strlen(trim($this->numero)) && dol_strlen(trim($this->intitule))) - { - $sql = "SELECT count(*)"; - $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux "; - $sql .= " WHERE numero = '" .trim($this->numero)."'"; - - $resql = $this->db->query($sql); - - if ( $resql ) - { - $row = $this->db->fetch_array($resql); - if ($row[0] == 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."compta_compte_generaux (date_creation, fk_user_author, numero,intitule)"; - $sql .= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; - - $resql = $this->db->query($sql); - if ( $resql ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."compta_compte_generaux"); - - if ($id > 0) - { - $this->id = $id; - $result = 0; - } - else - { - $result = -2; - dol_syslog("ComptaCompte::Create Erreur $result lecture ID"); - } - } - else - { - $result = -1; - dol_syslog("ComptaCompte::Create Erreur $result INSERT Mysql"); - } - } - else - { - $result = -3; - dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql"); - } - } - else - { - $result = -5; - dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql"); - } - } - else - { - $result = -4; - dol_syslog("ComptaCompte::Create Erreur $result Valeur Manquante"); - } - - return $result; - } -} -?> diff --git a/htdocs/compta/param/comptes/fiche.php b/htdocs/compta/param/comptes/fiche.php deleted file mode 100644 index 4fb01370324..00000000000 --- a/htdocs/compta/param/comptes/fiche.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/param/comptes/fiche.php - * \ingroup compta - * \brief Page de la fiche des comptes comptables - */ - -require("../../../main.inc.php"); - -$mesg = ''; - -if ($_POST["action"] == 'add' && $user->rights->compta->ventilation->parametrer) -{ - $compte = new ComptaCompte($db); - - $compte->numero = $_POST["numero"]; - $compte->intitule = $_POST["intitule"]; - - $e_compte = $compte; - - $res = $compte->create($user); - - if ($res == 0) - { - Header("Location: liste.php"); - } - else - { - if ($res == -3) - { - $_error = 1; - $_GET["action"] = "create"; - $_GET["type"] = $_POST["type"]; - } - if ($res == -4) - { - $_error = 2; - $_GET["action"] = "create"; - $_GET["type"] = $_POST["type"]; - } - } -} - -llxHeader("","Nouveau compte"); - -/* - * Creation d'un compte - * - */ -if ($_GET["action"] == 'create' && $user->rights->compta->ventilation->parametrer) -{ - $html = new Form($db); - $nbligne=0; - - print_fiche_titre($langs->trans("NewAccount")); - - print '
'; - print ''; - print ''; - print ''."\n"; - - print ''; - print ''; - print ''; - print ''; - - print ''; - print '
'.$langs->trans("AccountNumber").''; - if ($_error == 1) - { - print "Ce numéro de compte existe déjà"; - } - if ($_error == 2) - { - print "Valeur(s) manquante(s)"; - } - print '
'.$langs->trans("Label").'
 
'; - print '
'; -} - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/comptes/index.php b/htdocs/compta/param/comptes/index.php deleted file mode 100644 index 59e1fd33bf6..00000000000 --- a/htdocs/compta/param/comptes/index.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/param/comptes/index.php - * \ingroup compta - * \brief Page acceuil zone parametrages - */ - -require("../../../main.inc.php"); - -$langs->load("compta"); -$langs->load("bills"); - -/* - * Securite acces client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -llxHeader("","Accueil Compta"); - -/* - * Affichage page - * - */ -print_fiche_titre($langs->trans("AccountancySetup")); - -print ''; - -print ''; - -print '
'; - -/* - * Zone recherche facture - */ -print '
'; -print ''; - -print ''; -print ""; -print ''; -print ""; -print ''; -print "
'.$langs->trans("SearchABill").'
'.$langs->trans("Ref").':

"; - - - -print '
'; - - - -print '
'; - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/comptes/liste.php b/htdocs/compta/param/comptes/liste.php deleted file mode 100644 index 36a317d20cc..00000000000 --- a/htdocs/compta/param/comptes/liste.php +++ /dev/null @@ -1,126 +0,0 @@ - - * Copyright (C) 2005 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/param/comptes/liste.php - * \ingroup compta - * \brief Onglet de gestion de parametrages des ventilations - */ - -require("../../../main.inc.php"); - - -llxHeader('','Compta - Liste des comptes'); - -$page = $_GET["page"]; -$sortorder = $_GET["sortorder"]; -$sortfield = $_GET["sortfield"]; -if ($sortorder == "") $sortorder="ASC"; -if ($sortfield == "") $sortfield="cg.numero"; - -$offset = $conf->liste_limit * $page ; - -/* - * Mode Liste - * - * - * - */ - -$sql = "SELECT cg.rowid, cg.numero, cg.intitule, cg.date_creation as dc"; - -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux as cg"; - -if (dol_strlen(trim($_GET["search_numero"])) ) -{ - - $sql .= " WHERE cg.numero LIKE '%".$_GET["search_numero"]."%'"; - - if ( dol_strlen(trim($_GET["search_intitule"]))) - { - $sql .= " AND cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; - } - -} -else -{ - if ( dol_strlen(trim($_GET["search_intitule"]))) - { - $sql .= " WHERE cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; - } -} - - -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); - -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - - print_barre_liste("Comptes généraux", $page, "liste.php", "", $sortfield, $sortorder, '', $num); - - print ''; - print ''; - print_liste_field_titre($langs->trans("AccountNumberShort"),"liste.php","cg.numero"); - print_liste_field_titre($langs->trans("Label"),"liste.php","cg.intitule"); - print_liste_field_titre($langs->trans("DateCreation"),"liste.php","cg.date_creation"); - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - - print ''."\n"; - print ''; - print ''; - print "\n"; - $i++; - } - print "
'; - print ''; - print '
'.$obj->numero.''.$obj->intitule.''; - print dol_print_date($db->jdate($obj->dc)); - - print '
"; - $db->free($resql); -} -else -{ - dol_print_error($db); -} - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/index.php b/htdocs/compta/param/index.php deleted file mode 100644 index 28be77fe418..00000000000 --- a/htdocs/compta/param/index.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/compta/param/index.php - * \ingroup compta - * \brief Page acceuil zone parametrage comptabilite - */ - -require("../../main.inc.php"); - -$langs->load("compta"); -$langs->load("bills"); - -/* - * S�curit� acc�s client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -llxHeader("",$langs->trans("AccountancySetup")); - -/* - * Affichage page - * - */ -print_fiche_titre($langs->trans("AccountancySetup")); - -print ''; - -print ''; - -print '
'; - -/* - * Zone recherche facture - */ -print '
'; -print ''; -print ""; -print ''; -print "'; -print "
'.$langs->trans("SearchABill").'
"; -print $langs->trans("Ref").':

"; - - - -print '
'; - - - -print '
'; - -$db->close(); - -llxFooter(); -?>