@@ -, +, @@ [% INCLUDE 'patron-title.inc' patron => patron %] the include file cannot be found --- tools/letter.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/tools/letter.pl +++ a/tools/letter.pl @@ -196,6 +196,17 @@ sub add_form { ); my $first_flag_name = 1; my $lang; + + # Get available includes + my $htdocs = C4::Context->config('intrahtdocs'); + my ($theme, $availablethemes); + ($theme, $lang, $availablethemes)= C4::Templates::availablethemes( $htdocs, 'about.tt', 'intranet', $lang); + my @includes; + foreach (@$availablethemes) { + push @includes, "$htdocs/$_/$lang/includes"; + push @includes, "$htdocs/$_/en/includes" unless $lang eq 'en'; + } + # The letter name is contained into each mtt row. # So we can only sent the first one to the template. my $tt = Template->new( @@ -203,6 +214,7 @@ sub add_form { EVAL_PERL => 1, ABSOLUTE => 1, PLUGIN_BASE => 'Koha::Template::Plugin', + INCLUDE_PATH => \@includes, FILTERS => {}, ENCODING => 'UTF-8', } @@ -219,6 +231,7 @@ sub add_form { my $output; my $template = $letter->{content}; + $template = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %][% PROCESS 'html_helpers.inc' %]$template|; unless ( $tt->process( \$template, {}, \$output ) ) { $letter->{tt_error} = $tt->error(); } --