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

(-)a/C4/Biblio.pm (-24 lines)
Lines 69-75 BEGIN { Link Here
69
      GetMarcBiblio
69
      GetMarcBiblio
70
      GetBiblioItemData
70
      GetBiblioItemData
71
      GetBiblioItemInfosOf
71
      GetBiblioItemInfosOf
72
      GetBiblioItemByBiblioNumber
73
72
74
      &GetRecordValue
73
      &GetRecordValue
75
74
Lines 750-778 sub GetBiblioItemData { Link Here
750
    return ($data);
749
    return ($data);
751
}    # sub &GetBiblioItemData
750
}    # sub &GetBiblioItemData
752
751
753
=head2 GetBiblioItemByBiblioNumber
754
755
NOTE : This function has been copy/paste from C4/Biblio.pm from head before zebra integration.
756
757
=cut
758
759
sub GetBiblioItemByBiblioNumber {
760
    my ($biblionumber) = @_;
761
    my $dbh            = C4::Context->dbh;
762
    my $sth            = $dbh->prepare("Select * FROM biblioitems WHERE biblionumber = ?");
763
    my $count          = 0;
764
    my @results;
765
766
    $sth->execute($biblionumber);
767
768
    while ( my $data = $sth->fetchrow_hashref ) {
769
        push @results, $data;
770
    }
771
772
    $sth->finish;
773
    return @results;
774
}
775
776
=head2 GetISBDView 
752
=head2 GetISBDView 
777
753
778
  $isbd = &GetISBDView({
754
  $isbd = &GetISBDView({
(-)a/C4/ILSDI/Services.pm (-3 / +6 lines)
Lines 208-216 sub GetRecords { Link Here
208
    foreach my $biblionumber ( split( / /, $cgi->param('id') ) ) {
208
    foreach my $biblionumber ( split( / /, $cgi->param('id') ) ) {
209
209
210
        # Get the biblioitem from the biblionumber
210
        # Get the biblioitem from the biblionumber
211
        my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0];
211
        my $biblio = Koha::Biblios->find( $biblionumber );
212
        if ( not $biblioitem->{'biblionumber'} ) {
212
        my $biblioitem = $biblio->biblioitem;
213
        if ( $biblioitem ) {
214
            $biblioitem = $biblioitem->unblessed;
215
        } else {
213
            $biblioitem->{code} = "RecordNotFound";
216
            $biblioitem->{code} = "RecordNotFound";
217
            # FIXME We should not need to process something else; next?
214
        }
218
        }
215
219
216
        my $embed_items = 1;
220
        my $embed_items = 1;
Lines 223-229 sub GetRecords { Link Here
223
227
224
        # Get most of the needed data
228
        # Get most of the needed data
225
        my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
229
        my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
226
        my $biblio = Koha::Biblios->find( $biblionumber );
227
        my $holds  = $biblio->current_holds->unblessed;
230
        my $holds  = $biblio->current_holds->unblessed;
228
        my $issues           = GetBiblioIssues($biblionumber);
231
        my $issues           = GetBiblioIssues($biblionumber);
229
        my $items            = GetItemsByBiblioitemnumber($biblioitemnumber);
232
        my $items            = GetItemsByBiblioitemnumber($biblioitemnumber);
(-)a/catalogue/itemsearch.pl (-2 / +3 lines)
Lines 233-240 if (scalar keys %params > 0) { Link Here
233
        }
233
        }
234
234
235
        foreach my $item (@$results) {
235
        foreach my $item (@$results) {
236
            $item->{biblio} = Koha::Biblios->find( $item->{biblionumber} );
236
            my $biblio = Koha::Biblios->find( $item->{biblionumber} );
237
            ($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber});
237
            $item->{biblio} = $biblio;
238
            $item->{biblioitem} = $biblio->biblioitem->unblessed;
238
            $item->{status} = $notforloan_map->{$item->{notforloan}};
239
            $item->{status} = $notforloan_map->{$item->{notforloan}};
239
            if (defined $item->{location}) {
240
            if (defined $item->{location}) {
240
                $item->{location} = $location_map->{$item->{location}};
241
                $item->{location} = $location_map->{$item->{location}};
(-)a/cataloguing/merge.pl (-2 lines)
Lines 159-166 if ($merge) { Link Here
159
159
160
    # Moving orders (orders linked to items of frombiblio have already been moved by MoveItemFromBiblio)
160
    # Moving orders (orders linked to items of frombiblio have already been moved by MoveItemFromBiblio)
161
    my @allorders = GetOrdersByBiblionumber($biblionumber);
161
    my @allorders = GetOrdersByBiblionumber($biblionumber);
162
    my @tobiblioitem = GetBiblioItemByBiblioNumber ($ref_biblionumber);
163
    my $tobiblioitem_biblioitemnumber = $tobiblioitem [0]-> {biblioitemnumber };
164
    foreach my $myorder (@allorders) {
162
    foreach my $myorder (@allorders) {
165
        $myorder->{'biblionumber'} = $ref_biblionumber;
163
        $myorder->{'biblionumber'} = $ref_biblionumber;
166
        ModOrder ($myorder);
164
        ModOrder ($myorder);
(-)a/serials/routing-preview.pl (-3 / +1 lines)
Lines 66-72 my $library; Link Here
66
if($ok){
66
if($ok){
67
    # get biblio information....
67
    # get biblio information....
68
    my $biblionumber = $subs->{'bibnum'};
68
    my $biblionumber = $subs->{'bibnum'};
69
    my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblionumber);
70
    my @itemresults = GetItemsInfo( $biblionumber );
69
    my @itemresults = GetItemsInfo( $biblionumber );
71
    my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
70
    my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
72
    $library = Koha::Libraries->find($branch);
71
    $library = Koha::Libraries->find($branch);
Lines 95-101 if($ok){ Link Here
95
                    branchcode     => $branch
94
                    branchcode     => $branch
96
                });
95
                });
97
            } else {
96
            } else {
98
                AddReserve($branch,$routing->{borrowernumber},$biblionumber,\@bibitems,$routing->{ranking}, undef, undef, $notes,$title);
97
                AddReserve($branch,$routing->{borrowernumber},$biblionumber,undef,$routing->{ranking}, undef, undef, $notes,$title);
99
        }
98
        }
100
    }
99
    }
101
	}
100
	}
102
- 

Return to bug 18255