Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW include custom tpl path for note #31409

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Jonathanbtq
Copy link
Contributor

I included the path to use custom templates for notes.tpl.php.

  • Update commande/notes.php

@@ -137,7 +137,13 @@


$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
Copy link
Member

@eldy eldy Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $conf->modules_parts['tpl'] is empty,what if value for $dirtpls ?
May be this can avoid trouble ?

$dirtpls = array('/core/tpl');
if ($conf->modules_parts['tpl']) {
     $dirtpls = array_merge($conf->modules_parts['tpl'], $dirtpls);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this makes sense. Initializing $dirtpls with /core/tpl as a default ensures there's always a valid path, even if $conf->modules_parts['tpl'] is empty.
I make a update, thanks

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Oct 16, 2024
@frederic34 frederic34 requested a review from eldy October 18, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants