From bf45cf08f761ebd931e373d71d2b5fb7e927740c Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 20 Mar 2024 18:29:02 +0100 Subject: [PATCH] Bug 36376: Display library limitations issue 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." --- 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 42bd3db073..a0f5f301f2 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 ) %]

Attention