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

(-)a/C4/Circulation.pm (-3 / +4 lines)
Lines 669-675 sub CanBookBeIssued { Link Here
669
669
670
    my $item = GetItem(undef, $barcode );
670
    my $item = GetItem(undef, $barcode );
671
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
671
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
672
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
672
    my $biblio = Koha::Biblios->find( $item->{biblionumber} );
673
    my $biblioitem = $biblio->biblioitem;
673
    my $effective_itemtype = $item->{itype}; # GetItem deals with that
674
    my $effective_itemtype = $item->{itype}; # GetItem deals with that
674
    my $dbh             = C4::Context->dbh;
675
    my $dbh             = C4::Context->dbh;
675
    my $patron_unblessed = $patron->unblessed;
676
    my $patron_unblessed = $patron->unblessed;
Lines 927-933 sub CanBookBeIssued { Link Here
927
                }
928
                }
928
            }
929
            }
929
        }
930
        }
930
        elsif ($biblioitem->{'notforloan'} == 1){
931
        elsif ($biblioitem->notforloan == 1){
931
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
932
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
932
                $issuingimpossible{NOT_FOR_LOAN} = 1;
933
                $issuingimpossible{NOT_FOR_LOAN} = 1;
933
                $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
934
                $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
Lines 1009-1015 sub CanBookBeIssued { Link Here
1009
    }
1010
    }
1010
1011
1011
    ## CHECK AGE RESTRICTION
1012
    ## CHECK AGE RESTRICTION
1012
    my $agerestriction  = $biblioitem->{'agerestriction'};
1013
    my $agerestriction  = $biblioitem->agerestriction;
1013
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $patron->unblessed );
1014
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $patron->unblessed );
1014
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1015
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1015
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1016
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
(-)a/circ/bookcount.pl (-4 / +5 lines)
Lines 28-34 use C4::Circulation; Link Here
28
use C4::Output;
28
use C4::Output;
29
use C4::Koha;
29
use C4::Koha;
30
use C4::Auth;
30
use C4::Auth;
31
use C4::Biblio; # GetBiblioItemData
31
use Koha::Biblios;
32
use Koha::DateUtils;
32
use Koha::DateUtils;
33
use Koha::Libraries;
33
use Koha::Libraries;
34
34
Lines 38-44 my $bi = $input->param('bi'); Link Here
38
my $biblionumber = $input->param('biblionumber');
38
my $biblionumber = $input->param('biblionumber');
39
39
40
my $idata = itemdatanum($itm);
40
my $idata = itemdatanum($itm);
41
my $data  = GetBiblioItemData($bi);
41
my $biblio = Koha::Biblios->find( $biblionumber );
42
die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude!
42
43
43
my $lastmove = lastmove($itm);
44
my $lastmove = lastmove($itm);
44
45
Lines 73-80 for my $library ( @$libraries ) { Link Here
73
74
74
$template->param(
75
$template->param(
75
    biblionumber            => $biblionumber,
76
    biblionumber            => $biblionumber,
76
    title                   => $data->{'title'},
77
    title                   => $biblio->title,
77
    author                  => $data->{'author'},
78
    author                  => $biblio->author,
78
    barcode                 => $idata->{'barcode'},
79
    barcode                 => $idata->{'barcode'},
79
    biblioitemnumber        => $bi,
80
    biblioitemnumber        => $bi,
80
    homebranch              => $idata->{homebranch},
81
    homebranch              => $idata->{homebranch},
(-)a/t/db_dependent/Biblio.t (-5 / +4 lines)
Lines 197-206 sub run_tests { Link Here
197
    my ( $title_field, $title_subfield ) = get_title_field();
197
    my ( $title_field, $title_subfield ) = get_title_field();
198
    is( $marc->subfield( $title_field, $title_subfield ), $title, );
198
    is( $marc->subfield( $title_field, $title_subfield ), $title, );
199
199
200
    my $itemdata = GetBiblioItemData( $biblioitemnumber );
200
    my $biblioitem = Koha::Biblioitems->find( $biblioitemnumber );
201
    is( $itemdata->{ title }, $title,
201
    is( $biblioitem->_result->biblio->title, $title, # Should be $biblioitem->biblio instead, but not needed elsewhere for now
202
        'First test of GetBiblioItemData to get same result of previous two GetBiblioData tests.');
202
        'Do not know if this makes sense - compare result of previous two GetBiblioData tests.');
203
    is( $itemdata->{ isbn }, $isbn,
203
    is( $biblioitem->isbn, $isbn,
204
        'Second test checking it returns the correct isbn.');
204
        'Second test checking it returns the correct isbn.');
205
205
206
    my $success = 0;
206
    my $success = 0;
207
- 

Return to bug 19943