mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
NEW Introduce getCurrency(). $conf is no more allowed into computed
formulae.
This commit is contained in:
@@ -286,6 +286,17 @@ function getDolGlobalBool($key, $default = false)
|
||||
return (bool) ($conf->global->$key ?? $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the main currency ('EUR', 'USD', ...)
|
||||
*
|
||||
* @return string Value returned
|
||||
*/
|
||||
function getDolCurrency()
|
||||
{
|
||||
global $conf;
|
||||
return (string) $conf->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Dolibarr user constant string value
|
||||
*
|
||||
@@ -11803,8 +11814,9 @@ function dol_eval_new($s)
|
||||
function dol_eval_standard($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1')
|
||||
{
|
||||
// Only this global variables can be read by eval function and returned to caller
|
||||
global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example
|
||||
global $db, $langs, $user, $website, $websitepage;
|
||||
//global $conf; // Disabled. Read of const is done with getDolGlobalString() and read of $conf->currency is done with getDolCurrency()
|
||||
global $db;
|
||||
global $langs, $user, $website, $websitepage;
|
||||
global $action, $mainmenu, $leftmenu;
|
||||
global $mysoc;
|
||||
global $objectoffield; // To allow the use of $objectoffield in computed fields
|
||||
|
||||
Reference in New Issue
Block a user