From 10f86aa217e43a18f562469361becbbc8ba8cc0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2010 15:32:18 +0000 Subject: [PATCH] Reorganize class files. --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- htdocs/comm/action/class/cactioncomm.class.php | 4 ++-- htdocs/comm/mailing/cibles.php | 2 +- .../comm/mailing/{ => class}/mailing.class.php | 2 +- htdocs/comm/mailing/fiche.php | 2 +- htdocs/comm/mailing/index.php | 2 +- htdocs/comm/mailing/info.php | 2 +- htdocs/comm/mailing/liste.php | 2 +- htdocs/comm/propal/class/propalestats.class.php | 16 ++++++++-------- htdocs/comm/prospect/class/prospect.class.php | 5 ++--- htdocs/commande/class/commande.class.php | 1 - .../{stats => class}/commandestats.class.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/commande/stats/month.php | 2 +- .../{stats => class}/expeditionstats.class.php | 8 ++++++-- htdocs/expedition/stats/month.php | 2 +- 16 files changed, 30 insertions(+), 28 deletions(-) rename htdocs/comm/mailing/{ => class}/mailing.class.php (99%) rename htdocs/commande/{stats => class}/commandestats.class.php (98%) rename htdocs/expedition/{stats => class}/expeditionstats.class.php (94%) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 383f80a9b6f..568b20d456f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -19,12 +19,12 @@ */ /** - * \file htdocs/actioncomm.class.php + * \file htdocs/comm/action/class/actioncomm.class.php * \ingroup commercial * \brief Fichier de la classe des actions commerciales * \version $Id$ */ -require_once(DOL_DOCUMENT_ROOT.'/comm/action/cactioncomm.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'); /** \class ActionComm diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 3b2fead4b7a..dd506f2e5d5 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -18,14 +18,14 @@ */ /** - * \file htdocs/cactioncomm.class.php + * \file htdocs/comm/action/class/cactioncomm.class.php * \ingroup commercial * \brief Fichier de la classe des types d'actions commerciales * \version $Id$ */ -/** +/** * \class CActionComm * \brief Class to manage different types of events */ diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index baaac89b26f..9472cc32de5 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -26,7 +26,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/emailing.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); diff --git a/htdocs/comm/mailing/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php similarity index 99% rename from htdocs/comm/mailing/mailing.class.php rename to htdocs/comm/mailing/class/mailing.class.php index edc585b8141..563de7ed284 100644 --- a/htdocs/comm/mailing/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/comm/mailing/mailing.class.php + * \file htdocs/comm/mailing/class/mailing.class.php * \ingroup mailing * \brief Fichier de la classe de gestion des mailings * \version $Id$ diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index ad5e5870443..f1778d8b76e 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -29,7 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/emailing.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); $langs->load("mails"); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 49cc2a491d9..8dc78f8a7fc 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -26,7 +26,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/class/mailing.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); $langs->load("commercial"); diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 0d8876fb872..84ef8df73ad 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -25,7 +25,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/class/mailing.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/emailing.lib.php"); diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index dc1917e0bd4..564f575e6eb 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -25,7 +25,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT ."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php"); if (!$user->rights->mailing->lire) accessforbidden(); diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 1ecba9a7b2a..da71b12b1f0 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/comm/propal/stats/propalestats.class.php + * \file htdocs/comm/propal/class/propalestats.class.php * \ingroup propales * \brief Fichier de la classe de gestion des stats des propales * \version $Id$ @@ -54,16 +54,16 @@ class PropaleStats extends Stats function PropaleStats($DB, $socid=0) { global $user, $conf; - + $this->db = $DB; $object=new Propal($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as p"; $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; - + $this->field='total'; - + $this->socid = $socid; $this->where.= " fk_statut > 0"; $this->where.= " AND p.fk_soc = s.rowid AND s.entity = ".$conf->entity; @@ -100,7 +100,7 @@ class PropaleStats extends Stats function getNbByYear() { global $user; - + $sql = "SELECT date_format(p.datep,'%Y') as dm, count(*)"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -116,7 +116,7 @@ class PropaleStats extends Stats function getAmountByMonth($year) { global $user; - + $sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -133,7 +133,7 @@ class PropaleStats extends Stats function getAverageByMonth($year) { global $user; - + $sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -152,7 +152,7 @@ class PropaleStats extends Stats function getAllByYear() { global $user; - + $sql = "SELECT date_format(p.datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/comm/prospect/class/prospect.class.php b/htdocs/comm/prospect/class/prospect.class.php index 3e1dfb41c5b..3995a020fcb 100644 --- a/htdocs/comm/prospect/class/prospect.class.php +++ b/htdocs/comm/prospect/class/prospect.class.php @@ -19,12 +19,11 @@ */ /** - * \file htdocs/prospect.class.php + * \file htdocs/comm/prospect/class/prospect.class.php * \ingroup societe * \brief Fichier de la classe des prospects * \version $Id$ -*/ - + */ include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5dd053d9ea4..a9960de5e26 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -26,7 +26,6 @@ * \brief Fichier des classes de commandes * \version $Id$ */ - require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); diff --git a/htdocs/commande/stats/commandestats.class.php b/htdocs/commande/class/commandestats.class.php similarity index 98% rename from htdocs/commande/stats/commandestats.class.php rename to htdocs/commande/class/commandestats.class.php index 8741ba4089a..8e517b76004 100644 --- a/htdocs/commande/stats/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/commande/stats/commandestats.class.php + * \file htdocs/commande/class/commandestats.class.php * \ingroup commandes * \brief Fichier de la classe de gestion des stats des commandes * \version $Id$ diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 5b05cc6bd3e..52f14101396 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -26,7 +26,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); -require_once(DOL_DOCUMENT_ROOT."/commande/stats/commandestats.class.php"); +require_once(DOL_DOCUMENT_ROOT."/commande/class/commandestats.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"); $WIDTH=500; diff --git a/htdocs/commande/stats/month.php b/htdocs/commande/stats/month.php index 035cfa172e1..0515fbdfbbb 100644 --- a/htdocs/commande/stats/month.php +++ b/htdocs/commande/stats/month.php @@ -26,7 +26,7 @@ */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); -require_once(DOL_DOCUMENT_ROOT."/commande/stats/commandestats.class.php"); +require_once(DOL_DOCUMENT_ROOT."/commande/class/commandestats.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"); $GRAPHWIDTH=500; diff --git a/htdocs/expedition/stats/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php similarity index 94% rename from htdocs/expedition/stats/expeditionstats.class.php rename to htdocs/expedition/class/expeditionstats.class.php index 8de665a14ee..fa77dece2ab 100644 --- a/htdocs/expedition/stats/expeditionstats.class.php +++ b/htdocs/expedition/class/expeditionstats.class.php @@ -15,10 +15,14 @@ * 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$ */ +/** + * \file htdocs/expedition/class/expeditionstats.class.php + * \ingroup expedition + * \brief Fichier des classes expedition + * \version $Id$ + */ class ExpeditionStats { var $db; diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index a65fcb28873..703865b64d8 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -26,7 +26,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); -require_once(DOL_DOCUMENT_ROOT."/expedition/stats/expeditionstats.class.php"); +require_once(DOL_DOCUMENT_ROOT."/expedition/class/expeditionstats.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php");