From fd4197cc60a5c1c21347f1b6f6cd2933f0153a63 Mon Sep 17 00:00:00 2001 From: Lisette Scheer Date: Wed, 21 May 2025 21:26:38 +0000 Subject: [PATCH] Bug 36020: Port default recall notices to Template Toolkit The following notices relating to recalls all need to be updated to use Template Toolkit syntax: RETURN_RECALLED_ITEM PICKUP_RECALLED_ITEM RECALL_REQUESTER_DET To test: 1) Observe the default notice contains <<>> tags 2) Apply the patch 3) reset_all 4) Check that the notice is now all in template toolkit [% %] tags with html selected 5) Enable recalls 6) Enable SMS 7) Check an item out to a patron 8) Make sure the patron has a primary email, sms, and recall notices enabled 9) Make sure a secondary patron has a primary email, sms, and recall notices enabled 10) Generate a recall on the checked out item for the second patron 11) Check the first patron's notices tab to confirm the return recalled item notice generated properly. 12) Check the item back in and generate the recall slip and confirm it generated correctly. 13) Check the second patron's notices tab to confirm the pickup recalled item notice generated properly. Signed-off-by: Aleisha Amohia Signed-off-by: Emily Lamancusa --- C4/Letters.pm | 6 ++ .../mysql/en/mandatory/sample_notices.yml | 67 ++++++++++--------- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index b7c6b0cedd..d97715ee73 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -2003,6 +2003,12 @@ sub _get_tt_params { plural => 'problemreports', pk => 'reportid' }, + recalls => { + module => 'Koha::Recalls', + singular => 'recall', + plural => 'recalls', + pk => 'recall_id' + }, }; my $dbh = C4::Context->dbh; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 1c7a217119..276324f1e0 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -2457,81 +2457,82 @@ tables: code: RETURN_RECALLED_ITEM branchcode: "" name: "Notification to return a recalled item" - is_html: 0 + is_html: 1 title: "Notification to return a recalled item" message_transport_type: email lang: default content: - - "Date: <>" - - "" - - "<> <>," - - "" - - "A recall has been placed on the following item: <> / <> (<>). The due date has been updated, and is now <>. Please return the item before the due date." - - "" + - "Date: [% today | $KohaDates %]
" + - "
" + - "[%~ INCLUDE 'patron-title.inc' patron => borrower, no_title => 1, no_cardnumber => 1 ~%],
" + - "
" + - "A recall has been placed on the following item:[%~ INCLUDE 'biblio-title.inc' biblio=biblio link = 0 %][% IF biblio.author %]/ [% biblio.author %][% END %] ([% item.barcode %]). The due date has been updated, and is now [% item.onloan | $KohaDates %]. Please return the item before the due date.
" + - "
" - "Thank you!" - module: circulation code: PICKUP_RECALLED_ITEM branchcode: "" name: "Recalled item awaiting pickup" - is_html: 0 + is_html: 1 title: "Recalled item awaiting pickup" message_transport_type: email lang: default content: - - "Date: <>" - - "" - - "<> <>," - - "" - - "A recall that you requested on the following item: <> / <> (<>) is now ready for you to pick up at <>. Please pick up your item by <>." - - "" + - "[%- USE Branches -%]
" + - "Date: [% today | $KohaDates %]
" + - "
" + - "[%~ INCLUDE 'patron-title.inc' patron => borrower, no_title => 1, no_cardnumber => 1, no_html = 1 ~%],
" + - "
" + - "A recall that you requested on the following item: [% INCLUDE 'biblio-title.inc' biblio=biblio link = 0 %][% IF biblio.author %] / [% biblio.author %][% END %] ([% item.barcode %]) is now ready for you to pick up at [% Branches.GetName( recall.pickup_library_id) %]. Please pick up your item by [% recall.expiration_date | $KohaDates %].
" + - "
" - "Thank you!" - module: circulation code: RETURN_RECALLED_ITEM branchcode: "" name: "Notification to return a recalled item" - is_html: 0 + is_html: 1 title: "Return recalled item" message_transport_type: sms lang: default content: - - "Your item has been recalled: <> (<>). Please return it by <." + - "Your item has been recalled: [% INCLUDE 'biblio-title.inc' biblio=biblio link = 0 %] ([% item.barcode %]). Please return it by [% item.onloan | $KohaDates %]." - module: circulation code: PICKUP_RECALLED_ITEM branchcode: "" name: "Recalled item awaiting pickup" - is_html: 0 + is_html: 1 title: "Recalled item awaiting pickup" message_transport_type: sms lang: default content: - - "A recalled item: <> (<>) is ready for you to pick up at <>. Please collect by <>." + - "A recalled item: [% INCLUDE 'biblio-title.inc' biblio=biblio link = 0 %]([% item.barcode %]) is ready for you to pick up at [% recall.pickup_library_id %]. Please collect by [% recall.expiration_date | $KohaDates %]." - module: circulation code: RECALL_REQUESTER_DET branchcode: "" name: "Details of patron who recalled item" - is_html: 0 + is_html: 1 title: "Details of patron who recalled item" message_transport_type: print lang: default content: - - "Date: <>" - - "" - - "Recall for pickup at <>" - - "<>, <> (<>)" - - "<>" - - "<> <>, <>, <> <>" - - "<>" - - "" - - "ITEM RECALLED" - - "<> by <>" - - "Barcode: <>" - - "Callnumber: <>" - - "Waiting since: <>" - - "Notes: <>" + - "Date: [% today | $KohaDates %]
" + - "
" + - "Recall for pickup at [% branch.branchname %]
" + - "[% INCLUDE 'patron-title.inc' patron => borrower, no_title => 1, no_html = 1 %]
" + - "[% borrower.phone %]
" + - "[% borrower.streetnumber %][% IF borrower.address %] [% borrower.address %],[% END %][% IF borrower.address2 %] [% borrower.address2 %],[% END %] [% borrower.city %] [% borrower.state %] [% borrower.zipcode %]
" + - "[% borrower.email %]
" + - "
" + - "ITEM RECALLED
" + - "[% INCLUDE 'biblio-title.inc' biblio=biblio link = 0 %][% IF biblio.author %] by [% biblio.author %][% END %]
" + - "Barcode: [% item.barcode %]
" + - "Callnumber: [% item.itemcallnumber %]
" + - "Waiting since: [% recall.waiting_date | $KohaDates %]
" + - "[% IF recall.notes %]Notes: [% recall.notes %]
[% END %]" - module: members code: 2FA_DISABLE -- 2.34.1