Bugzilla – Attachment 163634 Details for
Bug 36376
Display library limitations alert in patron's messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36376: Display library limitations alert in patron's messages
Bug-36376-Display-library-limitations-alert-in-pat.patch (text/plain), 4.26 KB, created by
Laura Escamilla
on 2024-03-21 15:37:05 UTC
(
hide
)
Description:
Bug 36376: Display library limitations alert in patron's messages
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-03-21 15:37:05 UTC
Size:
4.26 KB
patch
obsolete
>From 4d1b2ce596d7a3a3864e05951fc648b81bd91ca9 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 20 Mar 2024 18:29:02 +0100 >Subject: [PATCH] Bug 36376: Display library limitations alert in patron's > messages > >Bug 31422 added a warning message when library limitations issue in patron edition page. >We should add this patron's messages in circ and details pages. >Like age limitations. > >Test plan: >1) User's login branch and home library is: Centerville >2) Patron category "B - Board" is limited to Franklin >3) Edit a patron with Board category from Centerville >4) A message appears "The patron's current category (Board) is limited to other libraries." > >Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> >--- > circ/circulation.pl | 3 +++ > .../intranet-tmpl/prog/en/includes/patron_messages.inc | 10 +++++++++- > members/moremember.pl | 5 +++++ > 3 files changed, 17 insertions(+), 1 deletion(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index d61c4851f2..1257d36c16 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -305,6 +305,9 @@ if ($patron) { > $template->param( age_high => $patron->category->upperagelimit ); > } > >+ unless ( Koha::Patron::Categories->search_with_library_limits( { 'me.categorycode' => $patron->categorycode } )->count ) { >+ $template->param( limited_category => 1 ); >+ } > } > > # >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 1a57c097f4..910192a3c9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -1,10 +1,11 @@ > [% USE raw %] > [% USE Branches %] >+[% USE Categories %] > [% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %] > [% SET return_claims = patron.return_claims %] > [% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %] > >-[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %] >+[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || limited_category || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %] > <h3>Attention</h3> > <ul> > [% IF ( has_modifications ) %] >@@ -97,6 +98,13 @@ > </li> > [% END %] > >+ [% IF limited_category %] >+ <li class="limited_category"> >+ <span class="circ-hlt">The patron's current category ([% Categories.GetName(patron.categorycode) | html %]) is limited to other libraries.</span> >+ <a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | uri %]&step=3" class="btn btn-default btn-xs">Change category</a> >+ </li> >+ [% END %] >+ > [% IF ( charges ) %] > [% INCLUDE 'blocked-fines.inc' fines = chargesamount %] > [% END %] >diff --git a/members/moremember.pl b/members/moremember.pl >index 58822ce5bb..41f39d9639 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -37,6 +37,7 @@ use List::MoreUtils qw( uniq ); > use Scalar::Util qw( looks_like_number ); > use Koha::Patron::Attribute::Types; > use Koha::Patron::Restriction::Types; >+use Koha::Patron::Categories; > use Koha::Patron::Messages; > use Koha::CsvProfiles; > use Koha::Holds; >@@ -132,6 +133,10 @@ if ( !$patron->is_valid_age ) { > $template->param( age_high => $patron->category->upperagelimit ); > } > >+unless ( Koha::Patron::Categories->search_with_library_limits( { 'me.categorycode' => $patron->categorycode } )->count ) { >+ $template->param( limited_category => 1 ); >+} >+ > if (C4::Context->preference('ExtendedPatronAttributes')) { > my @attributes = $patron->extended_attributes->as_list; # FIXME Must be improved! > my @classes = uniq( map {$_->type->class} @attributes ); >-- >2.30.2
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 36376
:
163618
|
163621
|
163634
|
164179
|
164180
|
164186