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 <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit efd9ed271c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2022-08-24 16:13:26 +01:00 committed by Matt Blenkinsop
parent 58cc83f272
commit a67c873364
2 changed files with 3 additions and 6 deletions

View file

@ -713,7 +713,7 @@
[% END %]
<li role="presentation">
<a id="debarments-tab-link" href="#reldebarments" aria-controls="reldebarments" role="tab" data-toggle="tab">Restrictions ([% debarments.size || 0 | html %])</a>
<a id="debarments-tab-link" href="#reldebarments" aria-controls="reldebarments" role="tab" data-toggle="tab">Restrictions ([% patron.restrictions.count | html %])</a>
</li>
[% SET enrollments = patron.get_club_enrollments %]
@ -748,7 +748,7 @@
</div>
[% END %]
[% INCLUDE borrower_debarments.inc %]
[% INCLUDE 'patron-restrictions-tab.inc' %]
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
<div id="reserves" role="tabpanel" class="tab-pane">

View file

@ -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,
);