From c1dd2f20cd3706060bd8a798554f9de1de885dc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Mon, 3 Jun 2013 15:18:36 +0200 Subject: [PATCH] Qual: Clean code. --- dev/skeletons/modMyModule.class.php | 17 ++--------------- htdocs/core/modules/DolibarrModules.class.php | 9 ++++----- htdocs/core/modules/modGravatar.class.php | 15 +-------------- htdocs/core/modules/modHoliday.class.php | 17 ++--------------- htdocs/core/modules/modMargin.class.php | 17 ++--------------- htdocs/core/modules/modPaybox.class.php | 16 ++-------------- htdocs/core/modules/modPaypal.class.php | 17 ++--------------- htdocs/core/modules/modWorkflow.class.php | 10 ---------- 8 files changed, 15 insertions(+), 103 deletions(-) diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 17fa97ec523..8fa37d04ecb 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -242,7 +242,7 @@ class modMyModule extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + $result=$this->_load_tables('/mymodule/sql/'); return $this->_init($sql, $options); } @@ -262,19 +262,6 @@ class modMyModule extends DolibarrModules return $this->_remove($sql, $options); } - - /** - * Create tables, keys and data required by module - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys - * and create data commands must be stored in directory /mymodule/sql/ - * This function is called by this->init - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables('/mymodule/sql/'); - } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index ca709ba4e32..6e30e978546 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> - * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * * This program is free software; you can redistribute it and/or modify @@ -22,13 +22,12 @@ /** * \file htdocs/core/modules/DolibarrModules.class.php - * \brief Fichier de description et activation des modules Dolibarr + * \brief File of parent class of module descriptor class files */ /** - * \class DolibarrModules - * \brief Classe mere des classes de description et activation des modules Dolibarr + * Parent class of module descriptor class files */ abstract class DolibarrModules { @@ -420,7 +419,7 @@ abstract class DolibarrModules if (empty($reldir)) return 1; include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php'; - + $ok = 1; foreach($conf->file->dol_document_root as $dirroot) { diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 47e337d96d3..9a8106619cb 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -189,7 +189,7 @@ class modGravatar extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + //$result=$this->_load_tables(''); return $this->_init($sql,$options); } @@ -209,19 +209,6 @@ class modGravatar extends DolibarrModules return $this->_remove($sql,$options); } - - /** - * Create tables, keys and data required by module - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys - * and create data commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables(''); - } } ?> diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 573d1c41af9..36d02d3260b 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -290,7 +290,7 @@ class modHoliday extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + //$result=$this->_load_tables(''); return $this->_init($sql); } @@ -309,19 +309,6 @@ class modHoliday extends DolibarrModules return $this->_remove($sql); } - - /** - * Create tables, keys and data required by module - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys - * and create data commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables(''); - } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 47ae79bf7df..4aceaa1f73d 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -124,7 +124,7 @@ class modMargin extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + //$result=$this->_load_tables(); return $this->_init($sql); } @@ -143,19 +143,6 @@ class modMargin extends DolibarrModules return $this->_remove($sql); } - - /** - * Create tables and keys required by module - * Files mymodule.sql and mymodule.key.sql with create table and create keys - * commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - //return $this->_load_tables(); - } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index 0d4e5fc8a21..b00de1a93f0 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -185,7 +185,7 @@ class modPayBox extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + //$result=$this->_load_tables(''); return $this->_init($sql,$options); } @@ -205,18 +205,6 @@ class modPayBox extends DolibarrModules return $this->_remove($sql,$options); } - /** - * Create tables and keys required by module - * Files mymodule.sql and mymodule.key.sql with create table and create keys - * commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables(''); - } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 5c19c00b363..1e3645745da 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -177,7 +177,7 @@ class modPaypal extends DolibarrModules { $sql = array(); - $result=$this->load_tables(); + //$result=$this->_load_tables(''); return $this->_init($sql,$options); } @@ -197,19 +197,6 @@ class modPaypal extends DolibarrModules return $this->_remove($sql,$options); } - - /** - * Create tables and keys required by module - * Files mymodule.sql and mymodule.key.sql with create table and create keys - * commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables(''); - } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index c8e744d9b74..7757f2a2548 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -165,15 +165,5 @@ class modWorkflow extends DolibarrModules return $this->_remove($sql,$options); } - /** - * Create tables and keys required by module - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return $this->_load_tables(''); - } } ?> -- GitLab