From b6d8b648d97a663949146d84b25e695a980efe20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Mar 2010 15:32:56 +0000 Subject: [PATCH] Qual: Remove deprecated files --- htdocs/compta/facture/stats/index.php | 1 + htdocs/rapport/Atome.class.php | 122 ------------------- htdocs/rapport/AtomeFactureValidee.class.php | 93 -------------- htdocs/rapport/AtomePropaleValidee.class.php | 80 ------------ htdocs/rapport/index.php | 100 --------------- 5 files changed, 1 insertion(+), 395 deletions(-) delete mode 100644 htdocs/rapport/Atome.class.php delete mode 100644 htdocs/rapport/AtomeFactureValidee.class.php delete mode 100644 htdocs/rapport/AtomePropaleValidee.class.php delete mode 100644 htdocs/rapport/index.php diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 1bae2a7a3e4..17131f587e3 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -26,6 +26,7 @@ require("../../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/facture/stats/facturestats.class.php"); $WIDTH=500; $HEIGHT=200; diff --git a/htdocs/rapport/Atome.class.php b/htdocs/rapport/Atome.class.php deleted file mode 100644 index ada9d44a6f8..00000000000 --- a/htdocs/rapport/Atome.class.php +++ /dev/null @@ -1,122 +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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * \file htdocs/rapport/Atome.class.php - * \brief Fichier de la classe mere Atome de generation de rapports - * \version $Id$ - */ - -include_once DOL_DOCUMENT_ROOT.'/core/dolgraph.class.php'; - - -/** - \class Atome - \brief Classe m�re des classes de g�n�ration des images de rapports -*/ - -class Atome -{ - var $id; - var $db; - var $name; - var $periode; - var $graph_values; - - /** - * Initialisation de la classe - * - */ - function AtomeInitialize($periode, $name, $daystart) - { - $this->year = strftime("%Y", $daystart); - $this->month = strftime("%m", $daystart); - $this->periode = $periode; - $this->name = $name; - } - - /** - * - * - */ - function ShowGraph() - { - $dir = DOL_DATA_ROOT.'/rapport/images/'; - if (! is_dir($dir)) create_exdir($dir); - - $this->graph_values = array(); - - if ($this->periode == 'year') - { - $filename = $dir . $this->name.$this->year.'.png'; - - for ($i = 0 ; $i < 12 ; $i++) - { - $index = $this->year . substr('00'.($i+1),-2); - $value = 0; - if ($this->datas[$index]) - { - $value = $this->datas[$index]; - } - - $libelle = ucfirst(strftime("%b", dol_mktime(12,0,0,($i+1),1,2004))); - - $this->graph_values[$i] = array($libelle, $value); - } - } - - if ($this->periode == 'month') - { - $filename = $dir . $this->name.$this->year.$this->month.'.png'; - - $datex = mktime(12,0,0,$this->month, 1, $this->year); - $i = 0; - while (strftime("%Y%m", $datex) == $this->year.$this->month) - { - - $index = $this->year . $this->month . substr('00'.($i+1),-2); - $value = 0; - if ($this->datas[$index]) - { - $value = $this->datas[$index]; - } - - $libelle = ($i+1); - - $this->graph_values[$i] = array($libelle, $value); - - $i++; - $datex = $datex + 86400; - } - } - - // var_dump($this->graph_values); - - - $bgraph = new DolGraph(); - $bgraph->SetData($this->graph_values); - $bgraph->bgcolor = array(255,255,255); - $bgraph->SetWidth(600); - $bgraph->SetHeight(400); - $bgraph->draw($filename); - - return $filename; - } -} -?> diff --git a/htdocs/rapport/AtomeFactureValidee.class.php b/htdocs/rapport/AtomeFactureValidee.class.php deleted file mode 100644 index 4f8959e1b50..00000000000 --- a/htdocs/rapport/AtomeFactureValidee.class.php +++ /dev/null @@ -1,93 +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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -include_once(DOL_DOCUMENT_ROOT.'/rapport/Atome.class.php'); - -class AtomeFactureValidee extends Atome -{ - var $id; - var $db; - var $periode; - - /** - * Initialisation de la classe - * - */ - function AtomeFactureValidee($DB, $periode, $daystart) - { - $this->db = $DB ; - $this->name = 'AtomeFactureValidee'; - $this->AtomeInitialize($periode,'AtomeFactureValidee', $daystart); - $this->datas = array(); - } - - /** - * - * - * - */ - function fetch() - { - if ($this->periode == 'year') - { - $sql = "SELECT date_format(f.datef,'%Y%m'), sum(f.amount) as am"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_statut = 1"; - - $sql .= " AND date_format(f.datef,'%Y') = $this->year "; - $sql .= " GROUP BY date_format(f.datef,'%Y%m') ASC ;"; - } - - if ($this->periode == 'month') - { - $sql = "SELECT date_format(f.datef,'%Y%m%d'), sum(f.amount) as am"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_statut = 1"; - $sql .= " AND date_format(f.datef,'%Y%m') = ".$this->year.$this->month; - $sql .= " GROUP BY date_format(f.datef,'%Y%m%d') ASC ;"; - } - - if ($this->db->query($sql) ) - { - $i = 0; - $num = $this->db->num_rows(); - $arr = array(); - while ($i < $num) - { - $row = $this->db->fetch_row($i); - - $arr[$row[0]] = $row[1]; - //print $row[0] .'-'.$row[1]. '
'; - $i++; - } - - $this->db->free(); - $this->datas = $arr; - return $arr; - } - else - { - print $this->db->error(); - print "
$sql"; - return -3; - } - } -} -?> diff --git a/htdocs/rapport/AtomePropaleValidee.class.php b/htdocs/rapport/AtomePropaleValidee.class.php deleted file mode 100644 index c592f352ea6..00000000000 --- a/htdocs/rapport/AtomePropaleValidee.class.php +++ /dev/null @@ -1,80 +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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -include_once(DOL_DOCUMENT_ROOT.'/rapport/Atome.class.php'); - -class AtomePropaleValidee extends Atome -{ - var $id; - var $db; - - - /** - * Initialisation de la classe - * - */ - function AtomePropaleValidee($DB,$periode, $daystart) - { - $this->db = $DB ; - $this->AtomeInitialize($periode, 'AtomePropaleValidee', $daystart); - } - - /** - * - * - * - */ - function fetch() - { - $sql = "SELECT date_format(f.datep,'%Y%m'), sum(f.price) as am"; - $sql .= " FROM ".MAIN_DB_PREFIX."propal as f"; - $sql .= " WHERE f.fk_statut = 2"; - - if ($this->year) - { - $sql .= " AND date_format(f.datep,'%Y') = $this->year "; - $sql .= " GROUP BY date_format(f.datep,'%Y%m') ASC ;"; - } - - if ($this->db->query($sql) ) - { - $i = 0; - $num = $this->db->num_rows(); - $arr = array(); - while ($i < $num) - { - $row = $this->db->fetch_row($i); - - $arr[$row[0]] = $row[1]; - - $i++; - } - return $arr; - - $this->db->free(); - } - else - { - print $this->db->error(); - return -3; - } - } -} -?> diff --git a/htdocs/rapport/index.php b/htdocs/rapport/index.php deleted file mode 100644 index f3c155b24cd..00000000000 --- a/htdocs/rapport/index.php +++ /dev/null @@ -1,100 +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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -require("../main.inc.php"); - -require("./AtomeFactureValidee.class.php"); -require("./AtomePropaleValidee.class.php"); - -llxHeader(); - -print_fiche_titre("Rapports"); - - - -/* - * Initialisation d'un atome - * - * Parametre - * - id de connexion � la bdd - * - p�riode 'year' ou 'month' (Reste � faire les hebdo) - * - une date dans la p�riode voulue - * -> retourne un objet - * - */ -$x = new AtomeFactureValidee($db,'year', time()); - -/* - * Lecture des donn�es - * -> retourne un tableau - */ -$arr = $x->fetch(); -/* - * Cr�ation du graph - * -> retounre le nom du fichier - */ -$img = $x->ShowGraph(); -print $img."
"; - - -// - -$x = new AtomeFactureValidee($db,'year', mktime(12,0,0,1,12,2003)); -$arr = $x->fetch('year'); - -$img = $x->ShowGraph(); -print $img."
"; -for ($i = 1 ; $i < 5; $i++) -{ - $x = new AtomeFactureValidee($db,'month', mktime(12,0,0,$i,12,2003)); - $x->periode = 'month'; - - $arr = $x->fetch('month'); - - - $img = $x->ShowGraph(); - print $img."
"; -} - -// - -$x = new AtomePropaleValidee($db,'year',mktime(12,0,0,1,12,2003)); - -$arr = $x->fetch(); - -var_dump($arr); - -$img = $x->ShowGraph(); -print $img."
"; - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> - - - - - - - - - -