From c8ea651ca54ca1df8a0ebab33ee71e99124df817 Mon Sep 17 00:00:00 2001 From: Serhii Bondarenko <47003509+serhiilabs@users.noreply.github.com> Date: Sun, 10 May 2026 16:09:20 +0300 Subject: [PATCH] FIX #38146 Honor tpl override on supplier contacts (#38150) Signed-off-by: Serhii Bondarenko --- htdocs/fourn/commande/contact.php | 11 +++++++++-- htdocs/fourn/facture/contact.php | 11 +++++++++-- htdocs/supplier_proposal/contact.php | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 67b436e308e..430c9c67432 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -5,6 +5,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024 Frédéric France + * Copyright (C) 2026 Serhii Bondarenko * * 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"; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index d15646059f3..3ff6c983bb9 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -5,6 +5,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2023 Christian Foellmann + * Copyright (C) 2026 Serhii Bondarenko * * 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 '
'; //print '
'; - // 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"; } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 32fa86a340f..8e4aa7e0a6e 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -6,6 +6,7 @@ * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2026 Serhii Bondarenko * * 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";