@@ -, +, @@ Koha::Biblio->biblioitem --- C4/Biblio.pm | 24 ------------------------ C4/ILSDI/Services.pm | 9 ++++++--- catalogue/itemsearch.pl | 5 +++-- cataloguing/merge.pl | 2 -- serials/routing-preview.pl | 3 +-- 5 files changed, 10 insertions(+), 33 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -69,7 +69,6 @@ BEGIN { GetMarcBiblio GetBiblioItemData GetBiblioItemInfosOf - GetBiblioItemByBiblioNumber &GetRecordValue @@ -750,29 +749,6 @@ sub GetBiblioItemData { return ($data); } # sub &GetBiblioItemData -=head2 GetBiblioItemByBiblioNumber - -NOTE : This function has been copy/paste from C4/Biblio.pm from head before zebra integration. - -=cut - -sub GetBiblioItemByBiblioNumber { - my ($biblionumber) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("Select * FROM biblioitems WHERE biblionumber = ?"); - my $count = 0; - my @results; - - $sth->execute($biblionumber); - - while ( my $data = $sth->fetchrow_hashref ) { - push @results, $data; - } - - $sth->finish; - return @results; -} - =head2 GetISBDView $isbd = &GetISBDView({ --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -208,9 +208,13 @@ sub GetRecords { foreach my $biblionumber ( split( / /, $cgi->param('id') ) ) { # Get the biblioitem from the biblionumber - my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0]; - if ( not $biblioitem->{'biblionumber'} ) { + my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblioitem = $biblio->biblioitem; + if ( $biblioitem ) { + $biblioitem = $biblioitem->unblessed; + } else { $biblioitem->{code} = "RecordNotFound"; + # FIXME We should not need to process something else; next? } my $embed_items = 1; @@ -223,7 +227,6 @@ sub GetRecords { # Get most of the needed data my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; - my $biblio = Koha::Biblios->find( $biblionumber ); my $holds = $biblio->current_holds->unblessed; my $issues = GetBiblioIssues($biblionumber); my $items = GetItemsByBiblioitemnumber($biblioitemnumber); --- a/catalogue/itemsearch.pl +++ a/catalogue/itemsearch.pl @@ -233,8 +233,9 @@ if (scalar keys %params > 0) { } foreach my $item (@$results) { - $item->{biblio} = Koha::Biblios->find( $item->{biblionumber} ); - ($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber}); + my $biblio = Koha::Biblios->find( $item->{biblionumber} ); + $item->{biblio} = $biblio; + $item->{biblioitem} = $biblio->biblioitem->unblessed; $item->{status} = $notforloan_map->{$item->{notforloan}}; if (defined $item->{location}) { $item->{location} = $location_map->{$item->{location}}; --- a/cataloguing/merge.pl +++ a/cataloguing/merge.pl @@ -159,8 +159,6 @@ if ($merge) { # Moving orders (orders linked to items of frombiblio have already been moved by MoveItemFromBiblio) my @allorders = GetOrdersByBiblionumber($biblionumber); - my @tobiblioitem = GetBiblioItemByBiblioNumber ($ref_biblionumber); - my $tobiblioitem_biblioitemnumber = $tobiblioitem [0]-> {biblioitemnumber }; foreach my $myorder (@allorders) { $myorder->{'biblionumber'} = $ref_biblionumber; ModOrder ($myorder); --- a/serials/routing-preview.pl +++ a/serials/routing-preview.pl @@ -66,7 +66,6 @@ my $library; if($ok){ # get biblio information.... my $biblionumber = $subs->{'bibnum'}; - my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblionumber); my @itemresults = GetItemsInfo( $biblionumber ); my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode}; $library = Koha::Libraries->find($branch); @@ -95,7 +94,7 @@ if($ok){ branchcode => $branch }); } else { - AddReserve($branch,$routing->{borrowernumber},$biblionumber,\@bibitems,$routing->{ranking}, undef, undef, $notes,$title); + AddReserve($branch,$routing->{borrowernumber},$biblionumber,undef,$routing->{ranking}, undef, undef, $notes,$title); } } } --