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();
159 $this->rights[$r][0] = 40001;
160 $this->rights[$r][1] =
'Read currencies and their rates';
161 $this->rights[$r][2] =
'r';
162 $this->rights[$r][3] = 1;
163 $this->rights[$r][4] =
'currency';
164 $this->rights[$r][5] =
'read';
167 $this->rights[$r][0] = 40002;
168 $this->rights[$r][1] =
'Create/Update currencies and their rates';
169 $this->rights[$r][2] =
'w';
170 $this->rights[$r][3] = 0;
171 $this->rights[$r][4] =
'currency';
172 $this->rights[$r][5] =
'write';
175 $this->rights[$r][0] = 40003;
176 $this->rights[$r][1] =
'Delete currencies and their rates';
177 $this->rights[$r][2] =
'w';
178 $this->rights[$r][3] = 0;
179 $this->rights[$r][4] =
'currency';
180 $this->rights[$r][5] =
'delete';
184 $this->menu = array();
309 global $conf, $user, $langs;
313 if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) {
314 $langs->loadCacheCurrencies(
'');
316 $multicurrency->code = $conf->currency;
317 $multicurrency->name = $langs->cache_currencies[$conf->currency][
'label'].
' ('.$langs->getCurrencySymbol($conf->currency).
')';
318 $r = $multicurrency->create($user);
321 $multicurrency->addRate(1);