From ece91b163c600b3ab01106ac2b9c452fdd63f3f2 Mon Sep 17 00:00:00 2001 From: Philip Orr Date: Thu, 18 Apr 2024 15:41:33 +0000 Subject: [PATCH] Bug 31097: Added more restrictions info Added more info to the restrictions message in circulation as well as to the OPAC display in "Your account" and to the display of restriction messages when trying to place a hold in the OPAC. To Test: 1. Before applying patch, set system preference "PatronRestrictionTypes" to "Allow" 2. Go to Administration -> Patron restriction types 3. Add some restriction types, make sure you fill out both "Code" and "Label" 4. Go to any patron and add one or more of each restriction type 4a. Make sure that you add some with an expiration date and some without 4b. Make sure you add some with a comment and some without 5. Go to that patron's checkout page 6. Notice that only the comments of the restrictions are displayed and not all info is displayed 7. Apply the patch 8. Reload the page 9. Notice the restriction types are now displayed correctly 10. Notice the colon is only displayed if there is a comment 11. Notice the expiration date is also displayed 12. Open the OPAC and log in with that user (or if you want to log in with your own user: make sure they have all the restrictions mentioned above as well) 13. Go to "Your account" in the OPAC 14. Notice the display of restrictions 15. Try to place a hold on any record 16. Notice the display of restrictions --- .../prog/en/includes/patron_messages.inc | 11 +++++++++- .../bootstrap/en/modules/opac-reserve.tt | 22 +++++++++++++++++-- .../bootstrap/en/modules/opac-user.tt | 22 +++++++++++++++++-- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index 75c64cb695..7df1808123 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -70,8 +70,17 @@ [% IF debarredcomment.search('OVERDUES_PROCESS') %] Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %] [% ELSE %] - [% FOR restriction IN patron.restrictions %] + [% FOREACH restriction IN patron.restrictions %] + [% IF restriction.expiration %] + [% restriction.expiration | $KohaDates %] + [% ELSE %] + Indefinite + [% END %] + [% IF restriction.comment %] [% restriction.type.display_text | html %]: [% restriction.comment | html_line_break %]
+ [% ELSE %] + [% restriction.type.display_text | html %]
+ [% END %] [% END %] [% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index bacd8b77cb..b8a5b26f33 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -47,13 +47,31 @@
  • Your account has been frozen. [% IF debarred_comment %] - Comment: + Comment:
    [% IF debarred_comment.search('OVERDUES_PROCESS') %] Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %] [% ELSE %] - [% debarred_comment | html_line_break %] + [% FOR restriction IN logged_in_user.restrictions %] + [% IF restriction.comment %] + [% restriction.type.display_text | html %]: [% restriction.comment | html_line_break %], frozen until: + [% IF restriction.expiration %] + [% restriction.expiration | $KohaDates %] + [% ELSE %] + Indefinite + [% END %] +
    + [% ELSE %] + [% restriction.type.display_text | html %], frozen until: + [% IF restriction.expiration %] + [% restriction.expiration | $KohaDates %] + [% ELSE %] + Indefinite + [% END %] +
    + [% END %] + [% END %] [% END %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index f521bedf47..84fbd6be40 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -168,13 +168,31 @@ [% ELSE %]
  • Please note: Your account has been frozen. [% IF ( borrower.debarredcomment ) %] - Comment: + Comment:
    [% IF borrower.debarredcomment.search('OVERDUES_PROCESS') %] Restriction added by overdues process [% borrower.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %] [% ELSE %] - [% borrower.debarredcomment | html_line_break %] + [% FOR restriction IN logged_in_user.restrictions %] + [% IF restriction.comment %] + [% restriction.type.display_text | html %]: [% restriction.comment | html_line_break %], frozen until: + [% IF restriction.expiration %] + [% restriction.expiration | $KohaDates %] + [% ELSE %] + Indefinite + [% END %] +
    + [% ELSE %] + [% restriction.type.display_text | html %], frozen until: + [% IF restriction.expiration %] + [% restriction.expiration | $KohaDates %] + [% ELSE %] + Indefinite + [% END %] +
    + [% END %] + [% END %] [% END %]
    -- 2.30.2