From 620a40a9d7747fbaae5e14eb1fc3b1bb1daf8bb6 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 --- .../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 2dda38be50..18fe6e6dce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -698,7 +698,7 @@ [% END %]
  • - Restrictions ([% debarments.size || 0 | html %]) + Restrictions ([% patron.restrictions.count | html %])
  • [% SET enrollments = patron.get_club_enrollments %] @@ -732,7 +732,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.20.1