From e5ae0bf51a9e9b130e665e1cdc9eac86cb56af94 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 18 Oct 2023 16:24:52 +0200 Subject: [PATCH] Bug 35070: Proof of concept Add the following methods to your plugin sub template_include_paths { my ($self) = @_; return [ $self->mbf_path('inc'), ] } Then create a file Koha/Plugin/YourPlugin/inc/background_jobs/plugin_NAMESPACE_JOBTYPE.inc with 3 TT BLOCKs: "process", "report" and "js" --- C4/Templates.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Templates.pm b/C4/Templates.pm index dd54a6e3f4..ea10a6bd20 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -61,6 +61,11 @@ sub new { push @includes, "$htdocs/$_/$lang/includes"; push @includes, "$htdocs/$_/en/includes" unless $lang eq 'en'; } + + my @plugins_include_paths = Koha::Plugins->call( 'template_include_paths', + { interface => $interface, lang => $lang } ); + push @includes, map { $_ ? @$_ : () } @plugins_include_paths; + # Do not use template cache if script is called from commandline my $use_template_cache = C4::Context->config('template_cache_dir') && defined $ENV{GATEWAY_INTERFACE}; my $template = Template->new( -- 2.39.2