From a67c87336437e281d99d3c1d466807431ea4d57b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Aug 2022 16:13:26 +0100 Subject: [PATCH] Bug 31095: Remove GetDebarments from members/moremember.pl This patch removes the use of GetDebarments from members/moremember.pl and replaces template references with patrons.restrictions and the new includes introduced in the prior patch Test plan 1. Confirm that the 'Restrictions (x)' tab still appears on the patron details page. 2. Confirm that the 'Restrictions (x)' tab count is correct 3. Confirm that the 'Restrictions (x)' tab table functions 4. Confirm that the 'Restrictions (x)' tab 'Add manual restriction' form works as expected Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit efd9ed271c703ef104b9ff8da1a06a98b9f4d0bb) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/modules/members/moremember.tt | 4 ++-- members/moremember.pl | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index ef0a906c90..e37050d1af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -713,7 +713,7 @@ [% END %]
  • - Restrictions ([% debarments.size || 0 | html %]) + Restrictions ([% patron.restrictions.count | html %])
  • [% SET enrollments = patron.get_club_enrollments %] @@ -748,7 +748,7 @@ [% END %] - [% INCLUDE borrower_debarments.inc %] + [% INCLUDE 'patron-restrictions-tab.inc' %] [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
    diff --git a/members/moremember.pl b/members/moremember.pl index 0523d02831..767b1a783b 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -36,7 +36,6 @@ use C4::Form::MessagingPreferences; use List::MoreUtils qw( uniq ); use Scalar::Util qw( looks_like_number ); use Koha::Patron::Attribute::Types; -use Koha::Patron::Debarments qw( GetDebarments ); use Koha::Patron::Restriction::Types; use Koha::Patron::Messages; use Koha::CsvProfiles; @@ -81,12 +80,11 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) { } $template->param( - restriction_types => scalar Koha::Patron::Restriction::Types->keyed_on_code() + restriction_types => scalar Koha::Patron::Restriction::Types->search() ); if ( $patron->is_debarred ) { $template->param( - 'debarments' => scalar GetDebarments({ borrowernumber => $borrowernumber }), 'userdebarred' => $patron->debarred, 'debarredcomment' => $patron->debarredcomment, ); @@ -281,7 +279,6 @@ $template->param( relatives_borrowernumbers => \@relatives, logged_in_user => $logged_in_user, files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(), - #debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), has_modifications => $has_modifications, ); -- 2.39.5