From a7dbb729891dd6cf79418bc30243ea58aec60112 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 21 Apr 2023 03:24:36 +0000 Subject: [PATCH] Bug 33478: Apply formatting to HOLD_SLIP To test: 1. Place a hold on a record 2. Check in an item attached to the record 3. When the pop-up for the hold is triggered, confirm hold and print slip 4. Confirm your format settings for HOLD_SLIP are applied --- circ/hold-transfer-slip.pl | 3 +- .../includes/notice_format_translations.inc | 16 ++++++++++ .../prog/en/modules/circ/printslip.tt | 31 ++++++++++++++----- 3 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/notice_format_translations.inc diff --git a/circ/hold-transfer-slip.pl b/circ/hold-transfer-slip.pl index 61aef56c4cd..539b2bf4dc0 100755 --- a/circ/hold-transfer-slip.pl +++ b/circ/hold-transfer-slip.pl @@ -46,9 +46,10 @@ if ( my $letter = ReserveSlip ({ branchcode => $session->param('branch') || $userenv->{branch}, reserve_id => $reserve_id, }) ) { - $slip = $letter->{content}; + $slip = $letter; $is_html = $letter->{is_html}; } + $template->param( slip => $slip ) if ($slip); $template->param( caller => 'hold-transfer' ); $template->param( plain => !$is_html ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/notice_format_translations.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/notice_format_translations.inc new file mode 100644 index 00000000000..972a911e7be --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/notice_format_translations.inc @@ -0,0 +1,16 @@ +[% BLOCK translate_justification_types %] + [% SWITCH type %] + [% CASE 'L' %]left + [% CASE 'C' %]center + [% CASE 'R' %]right + [% END %] +[% END %] + +[% BLOCK translate_unit_types %] + [% SWITCH type %] + [% CASE 'POINT' %]pt + [% CASE 'INCH' %]in + [% CASE 'MM' %]mm + [% CASE 'CM' %]cm + [% END %] +[% END %] 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 e75a25b6be8..939fd7dc1e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt @@ -23,15 +23,30 @@ [% INCLUDE 'slip-print.inc' #printThenClose %] + +[% PROCESS 'notice_format_translations.inc' %] +
- -[% IF plain %] -
-[% IF ( slip ) %][% slip | html %][% ELSE %]No slip template found[% END %]
-
-[% ELSE %] -[% IF ( slip ) %][% slip | $raw %][% ELSE %]No slip template found[% END %] -[% END %] + [% IF ( slip ) %] +
+ [% IF slip.is_html %] + [% slip.content | $raw %] + [% ELSE %] +
+                [% slip.content | html %]
+            
+ [% END %] +
+ [% ELSE %] + No slip template found + [% END %] +
[% INCLUDE 'intranet-bottom.inc' %] -- 2.30.2