Add custom tpl to note (#38437)

* add custom tpl to note propal

Updated note.php to include template files from multiple directories.

* add custom tpl to note facture

Refactor template inclusion for notes to search multiple directories.

* add custom tpl to note fichinter

Refactor template inclusion for notes to check multiple directories.

* add custom tpl to note tocket

Updated copyright year for Charlene Benke and modified template inclusion logic.

* add custom tpl to note (mrp)

Refactor note template inclusion to support multiple directories.

* add custom tpl to note module builder

Updated the template to include notes from multiple directories.

* Refactor template inclusion in note.php

Updated note.php to include template files dynamically from multiple directories.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Charlène Benke 2026-05-26 16:02:36 +02:00 committed by GitHub
parent c06d30c6e2
commit 46f4f49420
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 15 deletions

View file

@ -153,8 +153,13 @@ if ($object->id > 0) {
print '<div class="underbanner clearboth"></div>';
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';
print dol_get_fiche_end();

View file

@ -163,8 +163,13 @@ if ($id > 0 || !empty($ref)) {
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print dol_get_fiche_end();
}

View file

@ -152,8 +152,13 @@ if ($id > 0 || !empty($ref)) {
print '<div class="underbanner clearboth"></div>';
$cssclass = 'titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print dol_get_fiche_end();
}

View file

@ -129,8 +129,13 @@ if ($id > 0 || !empty($ref)) {
print '<div class="underbanner clearboth"></div>';
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';
print dol_get_fiche_end();

View file

@ -227,8 +227,13 @@ if ($id > 0 || !empty($ref)) {
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';
print dol_get_fiche_end();

View file

@ -156,8 +156,13 @@ if ($id > 0 || !empty($ref)) {
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';
print dol_get_fiche_end();

View file

@ -5,7 +5,7 @@
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2025-2026 Charlene Benke <charlene@patas-monkey.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
@ -158,8 +158,13 @@ if ($id > 0 || !empty($ref)) {
print '<div class="underbanner clearboth"></div>';
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach ($dirtpls as $reldir) {
$res = @include dol_buildpath($reldir.'/notes.tpl.php');
if ($res) {
break;
}
}
print '</div>';
print dol_get_fiche_end();