Bugzilla – Attachment 75261 Details for
Bug 17247
ILS-DI HoldTitle and HoldItem should check if patron is restricted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17247: Check if patron is debarred in CanItemBeReserved
Bug-17247-Check-if-patron-is-debarred-in-CanItemBe.patch (text/plain), 2.35 KB, created by
Marcel de Rooy
on 2018-05-11 08:42:50 UTC
(
hide
)
Description:
Bug 17247: Check if patron is debarred in CanItemBeReserved
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-05-11 08:42:50 UTC
Size:
2.35 KB
patch
obsolete
>From e2d7c71dc89e01586e75949f8701d42d9db252cf Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 5 Sep 2016 13:50:54 +0200 >Subject: [PATCH] Bug 17247: Check if patron is debarred in CanItemBeReserved >Content-Type: text/plain; charset=utf-8 > >This way, calls to ILS-DI HoldTitle and HoldItem do this check too > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Reserves.pm | 5 +++++ > t/db_dependent/Holds.t | 12 +++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 73b86b6..d7c4183 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -290,6 +290,7 @@ sub CanBookBeReserved{ > cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK. > tooManyReserves, if the borrower has exceeded his maximum reserve amount. > notReservable, if holds on this item are not allowed >+ debarred, if patron is debarred > > =cut > >@@ -308,6 +309,10 @@ sub CanItemBeReserved { > my $patron = Koha::Patrons->find( $borrowernumber ); > my $borrower = $patron->unblessed; > >+ if ($patron->is_debarred) { >+ return 'debarred'; >+ } >+ > # If an item is damaged and we don't allow holds on damaged items, we can stop right here > return 'damaged' > if ( $item->{damaged} >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 1e6c234..2a85496 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -7,7 +7,7 @@ use t::lib::TestBuilder; > > use C4::Context; > >-use Test::More tests => 55; >+use Test::More tests => 56; > use MARC::Record; > use C4::Biblio; > use C4::Items; >@@ -411,6 +411,16 @@ my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $bibnum, '', 1, ); > is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), > 'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); > >+my $debarred_borrowernumber = AddMember( >+ firstname => 'Debarred', >+ surname => 'Patron', >+ categorycode => $category->{categorycode}, >+ branchcode => $branch_1, >+ debarred => '9999-12-31', >+); >+is(CanItemBeReserved($debarred_borrowernumber, $itemnumber), >+ 'debarred', 'Debarred patron cannot reserve'); >+ > > # Helper method to set up a Biblio. > sub create_helper_biblio { >-- >2.1.4
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 17247
:
55174
|
70684
|
72963
|
75261
|
75262
|
75270
|
89652
|
89653
|
93549
|
94037
|
94038