Qual: Removed dead code.

This commit is contained in:
Laurent Destailleur 2011-09-20 22:55:28 +00:00
parent 9740a10d4a
commit 3e02af4db9
5 changed files with 0 additions and 497 deletions

View File

@ -1,115 +0,0 @@
<?php
/* Copyright (C) 2004-2005 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
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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;
}
}
?>

View File

@ -1,103 +0,0 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*
*/
/**
* \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 '<form action="fiche.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$_GET["type"].'">'."\n";
print '<table class="border" width="100%">';
print '<tr>';
print '<td>'.$langs->trans("AccountNumber").'</td><td><input name="numero" size="20" value="'.$compte->numero.'">';
if ($_error == 1)
{
print "Ce numéro de compte existe déjà";
}
if ($_error == 2)
{
print "Valeur(s) manquante(s)";
}
print '</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="intitule" size="40" value="'.$compte->intitule.'"></td></tr>';
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
print '</table>';
print '</form>';
}
$db->close();
llxFooter();
?>

View File

@ -1,78 +0,0 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*
*/
/**
* \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 '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Zone recherche facture
*/
print '<form method="post" action="facture.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>';
print "<tr $bc[0]>";
print '<td>'.$langs->trans("Ref").':</td><td><input type="text" class="flat" size="18" name="sf_ref"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</table></form><br>";
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
print '</td></tr>';
print '</table>';
$db->close();
llxFooter();
?>

View File

@ -1,126 +0,0 @@
<?PHP
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*
*/
/**
* \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 '<table class="liste">';
print '<tr class="liste_titre">';
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 "</tr>\n";
print '<tr class="liste_titre">';
print '<form action="liste.php" method="GET">';
print '<td><input type="text" name="search_numero" value="'.$_GET["search_numero"].'"></td>';
print '<td><input type="text" name="search_intitule" value="'.$_GET["search_intitule"].'"></td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
print '</form>';
print '</tr>';
$var=True;
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$obj->numero.'</td>'."\n";
print '<td>'.$obj->intitule.'</td>';
print '<td align="right" width="100">';
print dol_print_date($db->jdate($obj->dc));
print '</td>';
print "</tr>\n";
$i++;
}
print "</table>";
$db->free($resql);
}
else
{
dol_print_error($db);
}
$db->close();
llxFooter();
?>

View File

@ -1,75 +0,0 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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<EFBFBD>curit<EFBFBD> acc<EFBFBD>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 '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Zone recherche facture
*/
print '<form method="get" action="../facture.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>';
print "<tr $bc[0]><td>";
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref"></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
print "</table></form><br>";
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
print '</td></tr>';
print '</table>';
$db->close();
llxFooter();
?>