Qual: Clean code.
This commit is contained in:
parent
7dc984fd6f
commit
c1dd2f20cd
@ -242,7 +242,7 @@ class modMyModule extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
$result=$this->_load_tables('/mymodule/sql/');
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
@ -262,19 +262,6 @@ class modMyModule extends DolibarrModules
|
|||||||
return $this->_remove($sql, $options);
|
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/');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* 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>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -22,13 +22,12 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/DolibarrModules.class.php
|
* \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
|
* Parent class of module descriptor class files
|
||||||
* \brief Classe mere des classes de description et activation des modules Dolibarr
|
|
||||||
*/
|
*/
|
||||||
abstract class DolibarrModules
|
abstract class DolibarrModules
|
||||||
{
|
{
|
||||||
@ -420,7 +419,7 @@ abstract class DolibarrModules
|
|||||||
if (empty($reldir)) return 1;
|
if (empty($reldir)) return 1;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
foreach($conf->file->dol_document_root as $dirroot)
|
foreach($conf->file->dol_document_root as $dirroot)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -189,7 +189,7 @@ class modGravatar extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
//$result=$this->_load_tables('');
|
||||||
|
|
||||||
return $this->_init($sql,$options);
|
return $this->_init($sql,$options);
|
||||||
}
|
}
|
||||||
@ -209,19 +209,6 @@ class modGravatar extends DolibarrModules
|
|||||||
return $this->_remove($sql,$options);
|
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('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -290,7 +290,7 @@ class modHoliday extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
//$result=$this->_load_tables('');
|
||||||
|
|
||||||
return $this->_init($sql);
|
return $this->_init($sql);
|
||||||
}
|
}
|
||||||
@ -309,19 +309,6 @@ class modHoliday extends DolibarrModules
|
|||||||
return $this->_remove($sql);
|
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('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -124,7 +124,7 @@ class modMargin extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
//$result=$this->_load_tables();
|
||||||
|
|
||||||
return $this->_init($sql);
|
return $this->_init($sql);
|
||||||
}
|
}
|
||||||
@ -143,19 +143,6 @@ class modMargin extends DolibarrModules
|
|||||||
return $this->_remove($sql);
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -185,7 +185,7 @@ class modPayBox extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
//$result=$this->_load_tables('');
|
||||||
|
|
||||||
return $this->_init($sql,$options);
|
return $this->_init($sql,$options);
|
||||||
}
|
}
|
||||||
@ -205,18 +205,6 @@ class modPayBox extends DolibarrModules
|
|||||||
return $this->_remove($sql,$options);
|
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('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -177,7 +177,7 @@ class modPaypal extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result=$this->load_tables();
|
//$result=$this->_load_tables('');
|
||||||
|
|
||||||
return $this->_init($sql,$options);
|
return $this->_init($sql,$options);
|
||||||
}
|
}
|
||||||
@ -197,19 +197,6 @@ class modPaypal extends DolibarrModules
|
|||||||
return $this->_remove($sql,$options);
|
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('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -165,15 +165,5 @@ class modWorkflow extends DolibarrModules
|
|||||||
return $this->_remove($sql,$options);
|
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('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user