From 3c7b4a9efff63f0c45810fe4e8aa992ee22d7f25 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 ++- .../en/includes/notice_format_translations.inc | 16 ++++++++++++++++ .../prog/en/includes/slip_content.inc | 15 +++++++++++++++ .../prog/en/modules/circ/printslip.tt | 17 +++++++++-------- 4 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/notice_format_translations.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/slip_content.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/includes/slip_content.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/slip_content.inc new file mode 100644 index 00000000000..7c4402b3d56 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/slip_content.inc @@ -0,0 +1,15 @@ +
+ [% IF notice.is_html %] + [% notice.content | $raw %] + [% ELSE %] +
+        [% notice.content | html %]
+    
+ [% 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..38f93c4e912 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,16 @@ [% 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 ) %] + [% PROCESS 'slip_content.inc' notice=slip %] + [% ELSE %] + No slip template found + [% END %] +
[% INCLUDE 'intranet-bottom.inc' %] -- 2.30.2