Skip to content

Commit 03e17cd

Browse files
kidclampkfischer
authored andcommitted
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 <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
1 parent 4465931 commit 03e17cd

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt

+19-18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
[% USE Koha %]
44
[% PROCESS 'i18n.inc' %]
55
[% INCLUDE 'doc-head-open.inc' %]
6+
[% UNLESS slips && slips.size %]
7+
[% SET slips = [{content => slip, is_html => !plain, style => style, id => id }] %]
8+
[% END %]
69
<title>[% FILTER collapse %]
710
[% IF ( caller == 'hold-transfer' ) %]
811
[% t("Hold transfer print receipt") | html %] &rsaquo;
@@ -30,28 +33,26 @@
3033
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
3134
[% END %]
3235
[% FOR slip IN slips %]
33-
[% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %]
36+
[% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %]
3437
[% END %]
3538

3639
[% INCLUDE 'slip-print.inc' #printThenClose %]
3740
</head>
3841
<body id="circ_printslip" class="circ">
39-
<div id="receipt">
40-
41-
[% UNLESS slips && slips.size %]
42-
[% SET slips = [{content => slip, is_html => !plain, style => style }] %]
43-
[% END %]
44-
[% FOR slip IN slips %]
45-
<div id="slip_[% slip.id | html %]">
46-
[% UNLESS slip.is_html %]
47-
<pre>
48-
[% IF ( slip.content ) %][% slip.content | html %][% ELSE %]No slip template found[% END %]
49-
</pre>
50-
[% ELSE %]
51-
[% IF ( slip.content ) %][% slip.content | $raw %][% ELSE %]No slip template found[% END %]
52-
[% END %]
53-
</div>
54-
[% IF slips.size > 1 && !loop.last%]<div class="pagebreak"></div>[% END %]
55-
[% END %]
42+
<div id="receipt">
43+
[% FOR slip IN slips %]
44+
<div id="slip_[% slip.id | html %]">
45+
[% UNLESS slip.is_html %]
46+
<pre>
47+
[% IF ( slip.content ) %][% slip.content | html %][% ELSE %]No slip template found[% END %]
48+
</pre>
49+
[% ELSE %]
50+
[% IF ( slip.content ) %][% slip.content | $raw %][% ELSE %]No slip template found[% END %]
51+
[% END %]
52+
</div>
53+
[% IF slips.size > 1 && !loop.last%]
54+
<div class="pagebreak"></div>
55+
[% END %]
56+
[% END %]
5657

5758
[% INCLUDE 'intranet-bottom.inc' %]

members/printslip.pl

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ =head1 moremember.pl
120120
stylesheet => C4::Context->preference("SlipCSS"),
121121
error => $error,
122122
style => $letter->{style},
123+
id => $print,
123124
);
124125

125126
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );

0 commit comments

Comments
 (0)