FIX #38146 Honor tpl override on supplier contacts (#38150)

Signed-off-by: Serhii Bondarenko <serhiilabs@gmail.com>
This commit is contained in:
Serhii Bondarenko 2026-05-10 16:09:20 +03:00 committed by GitHub
parent 25cfb56ec6
commit c8ea651ca5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 6 deletions

View file

@ -5,6 +5,7 @@
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 Serhii Bondarenko <serhiilabs@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -187,8 +188,14 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) {
break;
}
}
} else {
// Contact not found
print "ErrorRecordNotFound";

View file

@ -5,6 +5,7 @@
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2026 Serhii Bondarenko <serhiilabs@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -269,8 +270,14 @@ if ($id > 0 || !empty($ref)) {
//print '<div class="clearboth"></div>';
//print '<br>';
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) {
break;
}
}
} else {
print "ErrorRecordNotFound";
}

View file

@ -6,6 +6,7 @@
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 Serhii Bondarenko <serhiilabs@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -189,8 +190,14 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) {
break;
}
}
} else {
// Contact not found
print "ErrorRecordNotFound";