diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b9c58477757..1a6d5018eae 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3716,16 +3716,10 @@ abstract class CommonObject // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer $dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl')); - foreach($dirtpls as $module => $reldir) + foreach($dirtpls as $reldir) { - if (!empty($module)) - { - $tpl = dol_buildpath($reldir.'/objectline_create.tpl.php'); - } - else - { - $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_create.tpl.php'; - } + $tpl = dol_buildpath($reldir.'/objectline_create.tpl.php'); + if (empty($conf->file->strict_mode)) { $res=@include $tpl; } else { @@ -3975,16 +3969,10 @@ abstract class CommonObject // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer $dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl')); - foreach($dirtpls as $module => $reldir) + foreach($dirtpls as $reldir) { - if (!empty($module)) - { - $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); - } - else - { - $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php'; - } + $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); + if (empty($conf->file->strict_mode)) { $res=@include $tpl; } else { @@ -4005,16 +3993,10 @@ abstract class CommonObject // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer $dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl')); - foreach($dirtpls as $module => $reldir) + foreach($dirtpls as $reldir) { - if (!empty($module)) - { - $tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php'); - } - else - { - $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_edit.tpl.php'; - } + $tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php'); + if (empty($conf->file->strict_mode)) { $res=@include $tpl; } else { @@ -4208,16 +4190,10 @@ abstract class CommonObject // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer $dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl')); - foreach($dirtpls as $module => $reldir) + foreach($dirtpls as $reldir) { - if (!empty($module)) - { - $tpl = dol_buildpath($reldir.'/originproductline.tpl.php'); - } - else - { - $tpl = DOL_DOCUMENT_ROOT.$reldir.'/originproductline.tpl.php'; - } + $tpl = dol_buildpath($reldir.'/originproductline.tpl.php'); + if (empty($conf->file->strict_mode)) { $res=@include $tpl; } else { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ca182c7b337..c73daa011a5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -383,13 +383,19 @@ if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf-> if (GETPOST('disablemodules','alpha')) $_SESSION["disablemodules"]=GETPOST('disablemodules','alpha'); if (! empty($_SESSION["disablemodules"])) { - $disabled_modules=explode(',',$_SESSION["disablemodules"]); + $modulepartkeys = array('css', 'js', 'tabs', 'triggers', 'login', 'substitutions', 'menus', 'theme', 'sms', 'tpl', 'barcode', 'models', 'societe', 'hooks', 'dir', 'syslog', 'tpllinkable', 'contactelement', 'moduleforexternal'); + + $disabled_modules=explode(',',$_SESSION["disablemodules"]); foreach($disabled_modules as $module) { if ($module) { - if (empty($conf->$module)) $conf->$module=new stdClass(); + if (empty($conf->$module)) $conf->$module=new stdClass(); // To avoid warnings $conf->$module->enabled=false; + foreach($modulepartkeys as $modulepartkey) + { + unset($conf->modules_parts[$modulepartkey][$module]); + } if ($module == 'fournisseur') // Special case { $conf->supplier_order->enabled=0;