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

(-)a/C4/Reserves.pm (+6 lines)
Lines 442-447 sub CanBookBeReserved{ Link Here
442
        return 'tooManyReserves';
442
        return 'tooManyReserves';
443
    }
443
    }
444
444
445
    # Check for the age restriction
446
    my $biblioData = C4::Biblio::GetBiblioData( $biblionumber );
447
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
448
    my ($ageRestriction, $daysToAgeRestriction) = C4::Circulation::GetAgeRestriction( $biblioData->{agerestriction}, $borrower );
449
    return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0;
450
445
    my $items = GetItemnumbersForBiblio($biblionumber);
451
    my $items = GetItemnumbersForBiblio($biblionumber);
446
    #get items linked via host records
452
    #get items linked via host records
447
    my @hostitems = get_hostitemnumbers_of($biblionumber);
453
    my @hostitems = get_hostitemnumbers_of($biblionumber);
(-)a/t/db_dependent/Reserves.t (-2 / +5 lines)
Lines 50-56 my $dbh = C4::Context->dbh; Link Here
50
my $builder = t::lib::TestBuilder->new;
50
my $builder = t::lib::TestBuilder->new;
51
51
52
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
52
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
53
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a'");
53
$dbh->do(q|
54
    INSERT INTO marc_subfield_structure (frameworkcode, tagfield, tagsubfield, kohafield)
55
    VALUES ('', '521', 'a', 'biblioitems.agerestriction')
56
    ON DUPLICATE KEY UPDATE kohafield = VALUES(kohafield)
57
|);
54
58
55
## Setup Test
59
## Setup Test
56
# Add branches
60
# Add branches
57
- 

Return to bug 11999