Bugzilla – Attachment 182301 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), 9.20 KB, created by
Philip Orr
on 2025-05-12 17:05:12 UTC
(
hide
)
Description:
Bug 39498: correct patron restrictions displays
Filename:
MIME Type:
Creator:
Philip Orr
Created:
2025-05-12 17:05:12 UTC
Size:
9.20 KB
patch
obsolete
>From d454b1140958da121e9a3852081338c3664e6faf 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 | 21 ++++++++------ > .../bootstrap/en/modules/opac-reserve.tt | 29 ++++++++++--------- > 2 files changed, 28 insertions(+), 22 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 5d71adf30d..1a6d00b7c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -97,14 +97,10 @@ > 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"> >+ [%- restriction.type.display_text | html -%]: > <span class="restriction_expiration"> > [% IF restriction.expiration %] > [% restriction.expiration | $KohaDates %] >@@ -112,12 +108,19 @@ > <strong>Indefinite</strong> > [% END %] > </span> >- <span class="restriction_detail"> [%- restriction.type.display_text | html -%][%- IF restriction.comment -%]: [%- restriction.comment | html_line_break -%][%- 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 %] > </div> > [% END %] >- [% END %] </em >- ><br /> >- [% END %] >+ </em><br /> > <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> > <!-- /.blocker --> >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 59e5704950..c49af9c7a5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -55,21 +55,24 @@ > 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 -%] >- : <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> >- [% END %] >+ [%- 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: >+ [% ELSE %] >+ , frozen until: >+ [% END %] >+ <span class="restriction_expiration"> >+ [%- IF restriction.expiration -%] >+ [%- restriction.expiration | $KohaDates -%] >+ [%- ELSE -%] >+ <strong>Indefinite</strong> >+ [%- END -%] >+ </span> > </div> > [% END %] > [% END %] >-- >2.39.5
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