From a0de2a791b4d19d02861493f918cc347e6ede837 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 4 Oct 2024 16:43:44 +0000 Subject: [PATCH] Bug 38089: (QA follow-up) Ensure style works on members/printslip.pl When moving the style up, it was moved before the code that handles printing a single slip, i.e. taking the variables and forming a slip hash. This patch moves that code to the top and additionally passes through the CODE of the notice so the ID is not blank Signed-off-by: Martin Renvoize --- .../prog/en/modules/circ/printslip.tt | 37 ++++++++++--------- members/printslip.pl | 1 + 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt index 938c52f41e2..fd36a77f886 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt @@ -3,6 +3,9 @@ [% USE Koha %] [% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] +[% UNLESS slips && slips.size %] + [% SET slips = [{content => slip, is_html => !plain, style => style, id => id }] %] +[% END %] [% FILTER collapse %] [% IF ( caller == 'hold-transfer' ) %] [% t("Hold transfer print receipt") | html %] › @@ -30,28 +33,26 @@ <link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" /> [% END %] [% FOR slip IN slips %] -[% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %] + [% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %] [% END %] [% INCLUDE 'slip-print.inc' #printThenClose %] </head> <body id="circ_printslip" class="circ"> -<div id="receipt"> - -[% UNLESS slips && slips.size %] - [% SET slips = [{content => slip, is_html => !plain, style => style }] %] -[% END %] -[% FOR slip IN slips %] -<div id="slip_[% slip.id | html %]"> -[% UNLESS slip.is_html %] -<pre> -[% IF ( slip.content ) %][% slip.content | html %][% ELSE %]No slip template found[% END %] -</pre> -[% ELSE %] -[% IF ( slip.content ) %][% slip.content | $raw %][% ELSE %]No slip template found[% END %] -[% END %] -</div> -[% IF slips.size > 1 && !loop.last%]<div class="pagebreak"></div>[% END %] -[% END %] + <div id="receipt"> + [% FOR slip IN slips %] + <div id="slip_[% slip.id | html %]"> + [% UNLESS slip.is_html %] + <pre> + [% IF ( slip.content ) %][% slip.content | html %][% ELSE %]No slip template found[% END %] + </pre> + [% ELSE %] + [% IF ( slip.content ) %][% slip.content | $raw %][% ELSE %]No slip template found[% END %] + [% END %] + </div> + [% IF slips.size > 1 && !loop.last%] + <div class="pagebreak"></div> + [% END %] + [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/members/printslip.pl b/members/printslip.pl index 67df3fd808b..9cf130c22fd 100755 --- a/members/printslip.pl +++ b/members/printslip.pl @@ -120,6 +120,7 @@ $template->param( stylesheet => C4::Context->preference("SlipCSS"), error => $error, style => $letter->{style}, + id => $print, ); $template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) ); -- 2.46.2