fix: use of getDolGlobal in module builder template

This commit is contained in:
Florian HENRY
2023-08-16 11:59:14 +02:00
parent 83ff60a131
commit e387e009bf
11 changed files with 89 additions and 90 deletions

View File

@@ -244,7 +244,7 @@ if ($action == 'updateMask') {
$tmpobjectkey = GETPOST('object');
if (!empty($tmpobjectkey)) {
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
if ($conf->global->$constforval == "$value") {
if (getDolGlobalString($constforval) == "$value") {
dolibarr_del_const($db, $constforval, $conf->entity);
}
}
@@ -257,7 +257,7 @@ if ($action == 'updateMask') {
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
// The constant that was read before the new set
// We therefore requires a variable to have a coherent view
$conf->global->$constforval = $value;
$conf->global->{$constforval} = $value;
}
// We disable/enable the document template (into llx_document_model table)
@@ -357,10 +357,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@@ -494,10 +494,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}