my $item = GetItem(undef, $barcode );
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
- my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
+ my $biblio = Koha::Biblios->find( $item->{biblionumber} );
+ my $biblioitem = $biblio->biblioitem;
my $effective_itemtype = $item->{itype}; # GetItem deals with that
my $dbh = C4::Context->dbh;
my $patron_unblessed = $patron->unblessed;
}
}
}
- elsif ($biblioitem->{'notforloan'} == 1){
+ elsif ($biblioitem->notforloan == 1){
if (!C4::Context->preference("AllowNotForLoanOverride")) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
$issuingimpossible{itemtype_notforloan} = $effective_itemtype;
}
## CHECK AGE RESTRICTION
- my $agerestriction = $biblioitem->{'agerestriction'};
+ my $agerestriction = $biblioitem->agerestriction;
my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $patron->unblessed );
if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
if ( C4::Context->preference('AgeRestrictionOverride') ) {
use C4::Output;
use C4::Koha;
use C4::Auth;
-use C4::Biblio; # GetBiblioItemData
+use Koha::Biblios;
use Koha::DateUtils;
use Koha::Libraries;
my $biblionumber = $input->param('biblionumber');
my $idata = itemdatanum($itm);
-my $data = GetBiblioItemData($bi);
+my $biblio = Koha::Biblios->find( $biblionumber );
+die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude!
my $lastmove = lastmove($itm);
$template->param(
biblionumber => $biblionumber,
- title => $data->{'title'},
- author => $data->{'author'},
+ title => $biblio->title,
+ author => $biblio->author,
barcode => $idata->{'barcode'},
biblioitemnumber => $bi,
homebranch => $idata->{homebranch},
my ( $title_field, $title_subfield ) = get_title_field();
is( $marc->subfield( $title_field, $title_subfield ), $title, );
- my $itemdata = GetBiblioItemData( $biblioitemnumber );
- is( $itemdata->{ title }, $title,
- 'First test of GetBiblioItemData to get same result of previous two GetBiblioData tests.');
- is( $itemdata->{ isbn }, $isbn,
+ my $biblioitem = Koha::Biblioitems->find( $biblioitemnumber );
+ is( $biblioitem->_result->biblio->title, $title, # Should be $biblioitem->biblio instead, but not needed elsewhere for now
+ 'Do not know if this makes sense - compare result of previous two GetBiblioData tests.');
+ is( $biblioitem->isbn, $isbn,
'Second test checking it returns the correct isbn.');
my $success = 0;