Skip to content
Permalink
Browse files

Merge pull request #11244 from altatof/8.0

FIX : do not include tpl from disabled modules
  • Loading branch information
eldy committed May 29, 2019
2 parents 2352463 + 83d883c commit a491de01b3a138a77afd985922f4e1efd0b01995
Showing with 48 additions and 12 deletions.
  1. +48 −12 htdocs/core/class/commonobject.class.php
@@ -3715,10 +3715,19 @@ function formAddObjectLine($dateSelector, $seller, $buyer)

// 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 $reldir)
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $module => $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_create.tpl.php');
if (!empty($module) && empty($conf->$module->enabled)) continue;

if (!empty($module))
{
$tpl = dol_buildpath($reldir.'/objectline_create.tpl.php');
}
else
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_create.tpl.php';
}
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -3967,10 +3976,19 @@ function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer

// 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 $reldir)
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $module => $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_view.tpl.php');
if (!empty($module) && empty($conf->$module->enabled)) continue;

if (!empty($module))
{
$tpl = dol_buildpath($reldir.'/objectline_view.tpl.php');
}
else
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php';
}
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -3990,10 +4008,19 @@ function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer

// 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 $reldir)
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $module => $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php');
if (!empty($module) && empty($conf->$module->enabled)) continue;

if (!empty($module))
{
$tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php');
}
else
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_edit.tpl.php';
}
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -4186,10 +4213,19 @@ function printOriginLine($line, $var, $restrictlist='')

// 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 $reldir)
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $module => $reldir)
{
$tpl = dol_buildpath($reldir.'/originproductline.tpl.php');
if (!empty($module) && empty($conf->$module->enabled)) continue;

if (!empty($module))
{
$tpl = dol_buildpath($reldir.'/originproductline.tpl.php');
}
else
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/originproductline.tpl.php';
}
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {

0 comments on commit a491de0

Please sign in to comment.
You can’t perform that action at this time.