Enable TPL overriding for document_actions_post_headers.tpl.php

Currently it is not possible to override the "document_actions_post_headers.tpl.php" template via a third party module. This addition of code adds this possibility
This commit is contained in:
Sébastien 2020-10-05 10:16:30 +04:00 committed by GitHub
parent 62177edab1
commit 6c11f7823a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,7 +252,27 @@ if ($object->id > 0)
$permission = $user->rights->fournisseur->facture->creer;
$permtoedit = $user->rights->fournisseur->facture->creer;
$param = '&facid='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir));
foreach ($dirtpls as $module => $reldir)
{
if (!empty($module))
{
$tpl = dol_buildpath($reldir.'/document_actions_post_headers.tpl.php');
}
else
{
$tpl = DOL_DOCUMENT_ROOT.$reldir.'/document_actions_post_headers.tpl.php';
}
if (empty($conf->file->strict_mode)) {
$res = @include $tpl;
} else {
$res = include $tpl; // for debug
}
if ($res) break;
}
} else {
print $langs->trans('ErrorUnknown');
}