View | Details | Raw Unified | Return to bug 17247
Collapse All | Expand All

(-)a/C4/Reserves.pm (+5 lines)
Lines 290-295 sub CanBookBeReserved{ Link Here
290
         cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK.
290
         cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK.
291
         tooManyReserves, if the borrower has exceeded his maximum reserve amount.
291
         tooManyReserves, if the borrower has exceeded his maximum reserve amount.
292
         notReservable,   if holds on this item are not allowed
292
         notReservable,   if holds on this item are not allowed
293
         debarred,        if patron is debarred
293
294
294
=cut
295
=cut
295
296
Lines 308-313 sub CanItemBeReserved { Link Here
308
    my $patron = Koha::Patrons->find( $borrowernumber );
309
    my $patron = Koha::Patrons->find( $borrowernumber );
309
    my $borrower = $patron->unblessed;
310
    my $borrower = $patron->unblessed;
310
311
312
    if ($patron->is_debarred) {
313
        return 'debarred';
314
    }
315
311
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
316
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
312
    return 'damaged'
317
    return 'damaged'
313
      if ( $item->{damaged}
318
      if ( $item->{damaged}
(-)a/t/db_dependent/Holds.t (-2 / +11 lines)
Lines 7-13 use t::lib::TestBuilder; Link Here
7
7
8
use C4::Context;
8
use C4::Context;
9
9
10
use Test::More tests => 55;
10
use Test::More tests => 56;
11
use MARC::Record;
11
use MARC::Record;
12
use C4::Biblio;
12
use C4::Biblio;
13
use C4::Items;
13
use C4::Items;
Lines 411-416 my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $bibnum, '', 1, ); Link Here
411
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ),
411
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ),
412
    'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' );
412
    'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' );
413
413
414
my $debarred_borrowernumber = AddMember(
415
    firstname => 'Debarred',
416
    surname => 'Patron',
417
    categorycode => $category->{categorycode},
418
    branchcode => $branch_1,
419
    debarred => '9999-12-31',
420
);
421
is(CanItemBeReserved($debarred_borrowernumber, $itemnumber),
422
    'debarred', 'Debarred patron cannot reserve');
423
414
424
415
# Helper method to set up a Biblio.
425
# Helper method to set up a Biblio.
416
sub create_helper_biblio {
426
sub create_helper_biblio {
417
- 

Return to bug 17247