Skip to content

Commit

Permalink
Qual: Clean code.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 3, 2013
1 parent 7dc984f commit c1dd2f2
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 103 deletions.
17 changes: 2 additions & 15 deletions dev/skeletons/modMyModule.class.php
Expand Up @@ -242,7 +242,7 @@ function init($options='')
{
$sql = array();

$result=$this->load_tables();
$result=$this->_load_tables('/mymodule/sql/');

return $this->_init($sql, $options);
}
Expand All @@ -262,19 +262,6 @@ function remove($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/');
}
}

?>
?>
9 changes: 4 additions & 5 deletions htdocs/core/modules/DolibarrModules.class.php
Expand Up @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -420,7 +419,7 @@ function _load_tables($reldir)
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)
{
Expand Down
15 changes: 1 addition & 14 deletions htdocs/core/modules/modGravatar.class.php
Expand Up @@ -189,7 +189,7 @@ function init($options='')
{
$sql = array();

$result=$this->load_tables();
//$result=$this->_load_tables('');

return $this->_init($sql,$options);
}
Expand All @@ -209,19 +209,6 @@ function remove($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('');
}
}

?>
17 changes: 2 additions & 15 deletions htdocs/core/modules/modHoliday.class.php
Expand Up @@ -290,7 +290,7 @@ function init()
{
$sql = array();

$result=$this->load_tables();
//$result=$this->_load_tables('');

return $this->_init($sql);
}
Expand All @@ -309,19 +309,6 @@ function remove()
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('');
}
}

?>
?>
17 changes: 2 additions & 15 deletions htdocs/core/modules/modMargin.class.php
Expand Up @@ -124,7 +124,7 @@ function init()
{
$sql = array();

$result=$this->load_tables();
//$result=$this->_load_tables();

return $this->_init($sql);
}
Expand All @@ -143,19 +143,6 @@ function remove()
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();
}
}

?>
?>
16 changes: 2 additions & 14 deletions htdocs/core/modules/modPaybox.class.php
Expand Up @@ -185,7 +185,7 @@ function init($options='')
{
$sql = array();

$result=$this->load_tables();
//$result=$this->_load_tables('');

return $this->_init($sql,$options);
}
Expand All @@ -205,18 +205,6 @@ function remove($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('');
}
}

?>
?>
17 changes: 2 additions & 15 deletions htdocs/core/modules/modPaypal.class.php
Expand Up @@ -177,7 +177,7 @@ function init($options='')
{
$sql = array();

$result=$this->load_tables();
//$result=$this->_load_tables('');

return $this->_init($sql,$options);
}
Expand All @@ -197,19 +197,6 @@ function remove($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('');
}
}

?>
?>
10 changes: 0 additions & 10 deletions htdocs/core/modules/modWorkflow.class.php
Expand Up @@ -165,15 +165,5 @@ function remove($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('');
}
}
?>

0 comments on commit c1dd2f2

Please sign in to comment.