mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 03:28:18 +01:00
Fix: Module that have substitution (like numberwords) works again.
This commit is contained in:
@@ -43,6 +43,7 @@ $outputlangs->setDefaultLang($langs->defaultlang);
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! empty($_POST["action"]) && $_POST["action"] == 'setlevel')
|
if (! empty($_POST["action"]) && $_POST["action"] == 'setlevel')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db,"SYSLOG_LEVEL",$_POST["level"],'chaine',0,'',0);
|
dolibarr_set_const($db,"SYSLOG_LEVEL",$_POST["level"],'chaine',0,'',0);
|
||||||
@@ -94,12 +95,12 @@ if ($_POST["action"] == 'test' && trim($_POST["value"]) != '')
|
|||||||
|
|
||||||
if ($_POST["level"])
|
if ($_POST["level"])
|
||||||
{
|
{
|
||||||
$object->total_ttc=$_POST["value"];
|
$object->total_ttc=price2num($_POST["value"]);
|
||||||
$source='__TOTAL_TTC_WORDS__';
|
$source='__TOTAL_TTC_WORDS__';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$object->number=$_POST["value"];
|
$object->number=price2num($_POST["value"]);
|
||||||
$source='__NUMBER_WORDS__';
|
$source='__NUMBER_WORDS__';
|
||||||
}
|
}
|
||||||
$newvaltest=make_substitutions($source,array(),$outputlangs,$object);
|
$newvaltest=make_substitutions($source,array(),$outputlangs,$object);
|
||||||
|
|||||||
@@ -3232,10 +3232,10 @@ function make_substitutions($chaine,$substitutionarray,$outputlangs,$object='')
|
|||||||
foreach ($conf->file->dol_document_root as $dirroot)
|
foreach ($conf->file->dol_document_root as $dirroot)
|
||||||
{
|
{
|
||||||
// If module enabled and complete
|
// If module enabled and complete
|
||||||
if (! empty($conf->$fonc->enabled) && file_exists($dir.'/functions_'.$fonc.'.lib.php'))
|
if (! empty($conf->$fonc->enabled) && file_exists($dirroot.'/includes/modules/substitutions/functions_'.$fonc.'.lib.php'))
|
||||||
{
|
{
|
||||||
dol_syslog("Library functions_".$fonc.".lib.php found into ".$dir);
|
dol_syslog("Library functions_".$fonc.".lib.php found into ".$dirroot);
|
||||||
require_once($dir."/functions_".$fonc.".lib.php");
|
require_once($dirroot."/includes/modules/substitutions/functions_".$fonc.".lib.php");
|
||||||
numberwords_completesubstitutionarray($substitutionarray,$outputlangs,$object);
|
numberwords_completesubstitutionarray($substitutionarray,$outputlangs,$object);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user