Qual: Uniformize code
Perf: Very small per enhancement
This commit is contained in:
parent
b8b1a4f60d
commit
e903719c36
@ -160,7 +160,7 @@ print "<br>\n";
|
|||||||
dol_htmloutput_mesg($message);
|
dol_htmloutput_mesg($message);
|
||||||
|
|
||||||
// List of sending methods
|
// List of sending methods
|
||||||
$listofmethods=(is_array($conf->sms_engine)?$conf->sms_engine:array());
|
$listofmethods=(is_array($conf->sms_engine_modules)?$conf->sms_engine_modules:array());
|
||||||
asort($listofmethods);
|
asort($listofmethods);
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
|
|||||||
@ -28,8 +28,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Conf
|
* Class to stock current configuration
|
||||||
* \brief Class to stock current configuration
|
|
||||||
*/
|
*/
|
||||||
class Conf
|
class Conf
|
||||||
{
|
{
|
||||||
@ -43,7 +42,6 @@ class Conf
|
|||||||
|
|
||||||
//! To store if javascript/ajax is enabked
|
//! To store if javascript/ajax is enabked
|
||||||
public $use_javascript_ajax;
|
public $use_javascript_ajax;
|
||||||
|
|
||||||
//! Used to store current currency
|
//! Used to store current currency
|
||||||
public $currency;
|
public $currency;
|
||||||
//! Used to store current css (from theme)
|
//! Used to store current css (from theme)
|
||||||
@ -53,6 +51,17 @@ class Conf
|
|||||||
public $top_menu;
|
public $top_menu;
|
||||||
public $smart_menu;
|
public $smart_menu;
|
||||||
|
|
||||||
|
public $modules = array(); // List of activated modules
|
||||||
|
public $css_modules = array();
|
||||||
|
public $tabs_modules = array();
|
||||||
|
public $triggers_modules = array();
|
||||||
|
public $menus_modules = array();
|
||||||
|
public $hooks_modules = array();
|
||||||
|
public $login_method_modules = array();
|
||||||
|
public $sms_engine_modules = array();
|
||||||
|
|
||||||
|
var $logbuffer = array();
|
||||||
|
|
||||||
//! To store properties of multi-company
|
//! To store properties of multi-company
|
||||||
public $multicompany;
|
public $multicompany;
|
||||||
//! Used to store running instance for multi-company (default 1)
|
//! Used to store running instance for multi-company (default 1)
|
||||||
@ -60,15 +69,6 @@ class Conf
|
|||||||
//! Used to store list of entities to use for each element
|
//! Used to store list of entities to use for each element
|
||||||
public $entities = array();
|
public $entities = array();
|
||||||
|
|
||||||
public $modules = array(); // List of modules
|
|
||||||
public $css_modules = array();
|
|
||||||
public $tabs_modules = array();
|
|
||||||
public $triggers_modules = array('/core/triggers'); // TODO default triggers should not be into the module list
|
|
||||||
public $menus_modules = array();
|
|
||||||
public $hooks_modules = array();
|
|
||||||
public $login_method_modules = array();
|
|
||||||
|
|
||||||
var $logbuffer = array();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -182,7 +182,7 @@ class Conf
|
|||||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg))
|
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg))
|
||||||
{
|
{
|
||||||
$module=strtolower($reg[1]);
|
$module=strtolower($reg[1]);
|
||||||
$this->sms_engine[$module]=$module; // Add this module in list of modules that provide SMS
|
$this->sms_engine_modules[$module]=$module; // Add this module in list of modules that provide SMS
|
||||||
}
|
}
|
||||||
// If this is a module constant
|
// If this is a module constant
|
||||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg))
|
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg))
|
||||||
@ -209,8 +209,8 @@ class Conf
|
|||||||
$mc->setValues($this);
|
$mc->setValues($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
|
||||||
//var_dump($this->modules);
|
//var_dump($this->modules);
|
||||||
|
|
||||||
// Clean some variables
|
// Clean some variables
|
||||||
@ -289,8 +289,6 @@ class Conf
|
|||||||
if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
|
if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
|
||||||
if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
|
if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
|
||||||
if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
|
if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
|
||||||
if (empty($this->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $this->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
|
|
||||||
if (empty($this->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $this->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
|
|
||||||
|
|
||||||
// Security
|
// Security
|
||||||
if (empty($this->global->USER_PASSWORD_GENERATED)) $this->global->USER_PASSWORD_GENERATED='standard'; // Default password generator
|
if (empty($this->global->USER_PASSWORD_GENERATED)) $this->global->USER_PASSWORD_GENERATED='standard'; // Default password generator
|
||||||
|
|||||||
@ -74,7 +74,8 @@ class Interfaces
|
|||||||
$orders = array();
|
$orders = array();
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
foreach($conf->triggers_modules as $reldir)
|
$dirtriggers=array_merge(array('/core/triggers'),$conf->triggers_modules);
|
||||||
|
foreach($dirtriggers as $reldir)
|
||||||
{
|
{
|
||||||
$dir=dol_buildpath($reldir,0);
|
$dir=dol_buildpath($reldir,0);
|
||||||
//print "xx".$dir;exit;
|
//print "xx".$dir;exit;
|
||||||
@ -203,7 +204,8 @@ class Interfaces
|
|||||||
$orders = array();
|
$orders = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach($conf->triggers_modules as $reldir)
|
$dirtriggers=array_merge(array('/core/triggers'),$conf->triggers_modules);
|
||||||
|
foreach($dirtriggers as $reldir)
|
||||||
{
|
{
|
||||||
$dir=dol_buildpath($reldir,0);
|
$dir=dol_buildpath($reldir,0);
|
||||||
//print "xx".$dir;exit;
|
//print "xx".$dir;exit;
|
||||||
|
|||||||
@ -27,16 +27,15 @@ require_once(DOL_DOCUMENT_ROOT."/core/modules/societe/modules_societe.class.php"
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class mod_codecompta_aquarium
|
* Class to manage accountancy code of thirdparties with Aquarium rules
|
||||||
* \brief Class to manage accountancy code of thirdparties with Aquarium rules
|
|
||||||
*/
|
*/
|
||||||
class mod_codecompta_aquarium extends ModeleAccountancyCode
|
class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||||
{
|
{
|
||||||
var $nom='Aquarium';
|
var $nom='Aquarium';
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
|
|
||||||
var $prefixcustomeraccountancycode='411';
|
var $prefixcustomeraccountancycode;
|
||||||
var $prefixsupplieraccountancycode='401';
|
var $prefixsupplieraccountancycode;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,15 +44,17 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
|||||||
function mod_codecompta_aquarium()
|
function mod_codecompta_aquarium()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
|
if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
|
||||||
|
if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
|
||||||
|
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
|
||||||
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
|
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Return description of module
|
/** Return description of module
|
||||||
*
|
*
|
||||||
* @param string $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @return string Description of module
|
* @return string Description of module
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
function info($langs)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user