28 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
49 $this->numero = 40000;
51 $this->rights_class =
'multicurrency';
55 $this->family =
"technic";
57 $this->module_position =
'40';
60 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
62 $this->
description =
"Module to manage several foreign currencies in prices and documents";
65 $this->version =
'dolibarr';
67 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
71 $this->picto =
'multicurrency';
77 $this->module_parts = array();
81 $this->dirs = array();
84 $this->config_page_url = array(
"multicurrency.php");
87 $this->hidden =
false;
88 $this->depends = array();
89 $this->requiredby = array();
90 $this->conflictwith = array();
91 $this->phpmin = array(7, 0);
92 $this->need_dolibarr_version = array(3, 0);
93 $this->langfiles = array(
"multicurrency");
100 $this->
const = array();
126 $this->tabs = array();
129 if (!isset($conf->multicurrency->enabled)) {
130 $conf->multicurrency =
new stdClass();
131 $conf->multicurrency->enabled = 0;
133 $this->dictionaries = array();
138 $this->boxes = array();
147 $this->rights = array();
160 $this->menu = array();
249 public function init($options =
'')
253 $res = $this->
_init($sql, $options);
270 public function remove($options =
'')
274 return $this->
_remove($sql, $options);
285 global $conf, $user, $langs;
289 if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) {
290 $langs->loadCacheCurrencies(
'');
292 $multicurrency->code = $conf->currency;
293 $multicurrency->name = $langs->cache_currencies[$conf->currency][
'label'].
' ('.$langs->getCurrencySymbol($conf->currency).
')';
294 $r = $multicurrency->create($user);
297 $multicurrency->addRate(1);
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
Description and activation class for module MyModule.
init($options='')
Function called when module is enabled.
createFirstCurrency()
Function called when module is enabled Create the currency from general setting.
__construct($db)
Constructor.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.