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

(-)a/C4/Circulation.pm (-3 / +4 lines)
Lines 682-688 sub CanBookBeIssued { Link Here
682
682
683
    my $item = GetItem(undef, $barcode );
683
    my $item = GetItem(undef, $barcode );
684
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
684
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
685
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
685
    my $biblio = Koha::Biblios->( $item->{biblionumber} );
686
    my $biblioitem = $biblio->biblioitem;
686
    my $effective_itemtype = $item->{itype}; # GetItem deals with that
687
    my $effective_itemtype = $item->{itype}; # GetItem deals with that
687
    my $dbh             = C4::Context->dbh;
688
    my $dbh             = C4::Context->dbh;
688
689
Lines 947-953 sub CanBookBeIssued { Link Here
947
                }
948
                }
948
            }
949
            }
949
        }
950
        }
950
        elsif ($biblioitem->{'notforloan'} == 1){
951
        elsif ($biblioitem->notforloan == 1){
951
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
952
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
952
                $issuingimpossible{NOT_FOR_LOAN} = 1;
953
                $issuingimpossible{NOT_FOR_LOAN} = 1;
953
                $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
954
                $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
Lines 1029-1035 sub CanBookBeIssued { Link Here
1029
    }
1030
    }
1030
1031
1031
    ## CHECK AGE RESTRICTION
1032
    ## CHECK AGE RESTRICTION
1032
    my $agerestriction  = $biblioitem->{'agerestriction'};
1033
    my $agerestriction  = $biblioitem->agerestriction;
1033
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $borrower );
1034
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $borrower );
1034
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1035
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1035
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1036
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
(-)a/circ/bookcount.pl (-4 / +5 lines)
Lines 29-35 use C4::Circulation; Link Here
29
use C4::Output;
29
use C4::Output;
30
use C4::Koha;
30
use C4::Koha;
31
use C4::Auth;
31
use C4::Auth;
32
use C4::Biblio; # GetBiblioItemData
32
use Koha::Biblios;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Libraries;
34
use Koha::Libraries;
35
35
Lines 39-45 my $bi = $input->param('bi'); Link Here
39
my $biblionumber = $input->param('biblionumber');
39
my $biblionumber = $input->param('biblionumber');
40
40
41
my $idata = itemdatanum($itm);
41
my $idata = itemdatanum($itm);
42
my $data  = GetBiblioItemData($bi);
42
my $biblio = Koha::Biblios->find( $biblionumber );
43
die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude!
43
44
44
my $lastmove = lastmove($itm);
45
my $lastmove = lastmove($itm);
45
46
Lines 74-81 for my $library ( @$libraries ) { Link Here
74
75
75
$template->param(
76
$template->param(
76
    biblionumber            => $biblionumber,
77
    biblionumber            => $biblionumber,
77
    title                   => $data->{'title'},
78
    title                   => $biblio->title,
78
    author                  => $data->{'author'},
79
    author                  => $biblio->author,
79
    barcode                 => $idata->{'barcode'},
80
    barcode                 => $idata->{'barcode'},
80
    biblioitemnumber        => $bi,
81
    biblioitemnumber        => $bi,
81
    homebranch              => $idata->{homebranch},
82
    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