Fix remove dead code

This commit is contained in:
Laurent Destailleur 2022-02-06 13:06:12 +01:00
parent 3b36465210
commit bd3218b460
16 changed files with 6 additions and 67 deletions

View File

@ -1052,12 +1052,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Create tables and keys required by module:
* - Files module.sql files with create table instructions
* - Then files modules.key.sql with create keys instructions
* - Files module.sql with create table instructions
* - Then modules.key.sql with create keys instructions
* - Then data_xxx.sql (usualy provided by external modules only)
* - Then update_xxx.sql (usualy provided by external modules only)
* Files must be stored in directory defined by reldir (Example: '/install/mysql/tables' or '/module/sql/')
* This function is usually called by the this->init of module descriptors.
* This function may also be called by :
* - _load_tables('/install/mysql/tables/', 'modulename') into the this->init() of core module descriptors.
* - _load_tables('/mymodule/sql/') into the this->init() of external module descriptors.
*
* @param string $reldir Relative directory where to scan files. Example: '/install/mysql/tables' or '/module/sql/'
* @param string $onlywithsuffix Only with the defined suffix

View File

@ -230,8 +230,6 @@ class modApi extends DolibarrModules
{
$sql = array();
$result = $this->_load_tables('/api/sql/');
return $this->_init($sql, $options);
}

View File

@ -467,11 +467,6 @@ class modBom extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/bom/sql/');
if ($result < 0) {
return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
}
// Create extrafields
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -211,8 +211,6 @@ class modDataPolicy extends DolibarrModules {
{
global $langs;
$this->_load_tables('/datapolicy/sql/');
// Create extrafields
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);

View File

@ -266,8 +266,6 @@ class modDav extends DolibarrModules
*/
public function init($options = '')
{
//$this->_load_tables('/dav/sql/');
// Create extrafields
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);

View File

@ -351,11 +351,6 @@ class modEventOrganization extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/eventorganization/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Permissions
$this->remove($options);

View File

@ -442,11 +442,6 @@ class modKnowledgeManagement extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/knowledgemanagement/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -446,11 +446,6 @@ class modMrp extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/mrp/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -265,7 +265,6 @@ class modMultiCurrency extends DolibarrModules
{
$sql = array();
//$this->_load_tables('/multicurrency/sql/');
$res = $this->_init($sql, $options);
if ($res) {

View File

@ -408,11 +408,6 @@ class modPartnership extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/partnership/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -403,11 +403,6 @@ class modRecruitment extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/recruitment/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -301,21 +301,6 @@ class modResource extends DolibarrModules
{
$sql = array();
$result = $this->loadTables();
return $this->_init($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 /resource/sql/
* This function is called by this->init
*
* @return int <=0 if KO, >0 if OK
*/
protected function loadTables()
{
return $this->_load_tables('/resource/sql/');
}
}

View File

@ -283,8 +283,6 @@ class modTakePos extends DolibarrModules
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
$this->_load_tables('/takepos/sql/');
$sql = array();
// Remove permissions and default values

View File

@ -390,11 +390,6 @@ class modWorkstation extends DolibarrModules
{
global $conf, $langs;
$result = $this->_load_tables('/workstation/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -281,11 +281,6 @@ class modZapier extends DolibarrModules
*/
public function init($options = '')
{
$result = $this->_load_tables('/zapier/sql/');
if ($result < 0) {
return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
}
// Create extrafields
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);

View File

@ -411,6 +411,7 @@ class modMyModule extends DolibarrModules
{
global $conf, $langs;
//$result = $this->_load_tables('/install/mysql/tables/', 'mymodule');
$result = $this->_load_tables('/mymodule/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')