Bugzilla – Attachment 182426 Details for
Bug 39498
Correct display of patron restriction comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39498: correct patron restrictions displays
Bug-39498-correct-patron-restrictions-displays.patch (text/plain), 11.04 KB, created by
Martin Renvoize (ashimema)
on 2025-05-14 06:06:18 UTC
(
hide
)
Description:
Bug 39498: correct patron restrictions displays
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-14 06:06:18 UTC
Size:
11.04 KB
patch
obsolete
>From c7d956e776ceb20244749a3d04e3bb267dfa57a7 Mon Sep 17 00:00:00 2001 >From: PhilipOrr <philip.orr@lmscloud.de> >Date: Tue, 1 Apr 2025 09:59:39 +0000 >Subject: [PATCH] Bug 39498: correct patron restrictions displays > >Test plan: >1. Before applying the patch, check how the display is currently. First set syspref PatronRestrictionTypes to "Allow" >2. Add two different new restriction types, fill out both "Code" and "Label" >3. Go to a patron's checkout page and add one of each of these restrictions, but do not fill out the comment field when adding them! >4. Observe that in the checkouts page and details page of the patron, it just says "Restricted since..." and does not show the restriction types. >5. Add another restriction, this time fill out the comment field >6. Observe that now in checkout and detail pages, the labels from the restriction types are listed and the comment shown. >7. Apply patch >8. Go to patron's details and checkout pages and check the restrictions are now displayed correctly, that is the text "with the explanation" is only shown for the restrictions that actually have a comment >8b. Log in to the OPAC with that patron and check they are displayed correctly in their summary page and when the patron is trying to place a hold. >9. Go to a different patron's account and add a restriction without a comment >10. Check it is now displayed correctly >11. Add more restrictions and check they are displayed correctly. Also add an OVERDUES restriction: >a. find a patron with an overdue item checked out (or create an overdue checkout on a patron's account) >b. go to Tools -> Overdue notice/status triggers >c. set up a rule for that patron's category, e.g. "First" -> Delay: 1, make sure to mark the check box for "Restrict" and "Print" >d. run misc/cronjobs/overdue_notices.pl >e. that patron should now also have an OVERDUES restriction >12. Turn PatronRestrictionTypes off again and check the patrons if everything is still displayed correctly >13. Go to another different patron and add a restriction with no comment, check if it is displayed correctly >14. Add another restriction with a comment and check it is displayed correctly >15. Log in to the OPAC with the patron that had OVERDUES restriction and check they are displayed correctly in their summary page and when the patron is trying to place a hold. >16. Same thing for the other patron without the OVERDUES restriction. > >Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com> >--- > .../prog/en/includes/patron_messages.inc | 43 ++++++++++--------- > .../bootstrap/en/modules/opac-reserve.tt | 39 +++++++++-------- > 2 files changed, 44 insertions(+), 38 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 5d71adf30d7..2a3941d884f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -97,26 +97,29 @@ > until [% userdebarreddate | $KohaDates %] > [% END %] > >- [% IF ( debarredcomment ) %] >- with the explanation: <br /> >- <em> >- [% IF debarredcomment.search('OVERDUES_PROCESS') %] >- Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %] >- [% ELSE %] >- [% FOREACH restriction IN patron.restrictions %] >- <div class="[% restriction.type.code | lower | html %]_restriction"> >- <span class="restriction_expiration"> >- [% IF restriction.expiration %] >- [% restriction.expiration | $KohaDates %] >- [% ELSE %] >- <strong>Indefinite</strong> >- [% END %] >- </span> >- <span class="restriction_detail"> [%- restriction.type.display_text | html -%][%- IF restriction.comment -%]: [%- restriction.comment | html_line_break -%][%- END -%] </span> >- </div> >- [% END %] >- [% END %] </em >- ><br /> >+ [% FOREACH restriction IN patron.restrictions %] >+ <div class="[% restriction.type.code | lower | html %]_restriction"> >+ <em> >+ [%- restriction.type.display_text | html -%]: >+ <span class="restriction_expiration"> >+ [% IF restriction.expiration %] >+ [% restriction.expiration | $KohaDates %] >+ [% ELSE %] >+ <strong>Indefinite</strong> >+ [% END %] >+ </span> >+ [% IF restriction.comment.search('OVERDUES_PROCESS') %] >+ Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %] >+ [% ELSE %] >+ [% IF restriction.comment %] >+ with the explanation: <br /> >+ <span class="restriction_detail"> [%- IF restriction.comment -%][%- restriction.comment | html_line_break -%][%- END -%] </span> >+ [% ELSE %] >+ <span class="restriction_detail"></span> >+ [% END %] >+ [% END %] </em >+ ><br /> >+ </div> > [% END %] > <a class="btn btn-xs btn-default" href="#reldebarments-tab" onclick="(new bootstrap.Tab($('#reldebarments-tab'))).show()"><i class="fa fa-ban"></i> View restrictions</a> > </li> >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 59e57049507..218ccd6cdd0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -55,23 +55,26 @@ > Comment:<br /> > <span id="userdebarred_comment"> > <strong> >- [% IF debarred_comment.search('OVERDUES_PROCESS') %] >- Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %] >- [% ELSE %] >- [% FOR restriction IN logged_in_user.restrictions %] >- <div class="patron_restriction"> >- [%- restriction.type.display_text | html -%][%- IF restriction.comment -%] >+ [% FOR restriction IN logged_in_user.restrictions %] >+ <div class="patron_restriction"> >+ [%- restriction.type.display_text | html -%] >+ [% IF restriction.comment.search('OVERDUES_PROCESS') %] >+ Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | html_line_break %] >+ [% ELSE %] >+ [%- IF restriction.comment -%] > : <span class="restriction_comment">[% restriction.comment | html_line_break %]</span>, frozen until: >- <span class="restriction_expiration"> >- [%- IF restriction.expiration -%] >- [%- restriction.expiration | $KohaDates -%] >- [%- ELSE -%] >- <strong>Indefinite</strong> >- [%- END -%] >- </span> >+ [% ELSE %] >+ , frozen until: > [% END %] >- </div> >- [% END %] >+ <span class="restriction_expiration"> >+ [%- IF restriction.expiration -%] >+ [%- restriction.expiration | $KohaDates -%] >+ [%- ELSE -%] >+ <strong>Indefinite</strong> >+ [%- END -%] >+ </span> >+ [% END %] >+ </div> > [% END %] > </strong> > </span> >@@ -273,9 +276,9 @@ > [% END %] > </select> > [% IF at_least_one_library_not_available_for_pickup %] >- <div class="at_least_one_library_not_available_note" >- >Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items</div >- > >+ <div class="at_least_one_library_not_available_note"> >+ Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items >+ </div> > [% END %] > [% END # / UNLESS bibitemloo.holdable %] > </li> >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39498
:
180126
|
180272
|
182301
|
182425
|
182426
|
182437
|
182491