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

(-)a/C4/Biblio.pm (-30 lines)
Lines 67-73 BEGIN { Link Here
67
    push @EXPORT, qw(
67
    push @EXPORT, qw(
68
      GetBiblioData
68
      GetBiblioData
69
      GetMarcBiblio
69
      GetMarcBiblio
70
      GetBiblioItemData
71
      GetBiblioItemInfosOf
70
      GetBiblioItemInfosOf
72
      GetBiblioItemByBiblioNumber
71
      GetBiblioItemByBiblioNumber
73
72
Lines 722-755 sub GetBiblioData { Link Here
722
    return ($data);
721
    return ($data);
723
}    # sub GetBiblioData
722
}    # sub GetBiblioData
724
723
725
=head2 GetBiblioItemData
726
727
  $itemdata = &GetBiblioItemData($biblioitemnumber);
728
729
Looks up the biblioitem with the given biblioitemnumber. Returns a
730
reference-to-hash. The keys are the fields from the C<biblio>,
731
C<biblioitems>, and C<itemtypes> tables in the Koha database, except
732
that C<biblioitems.notes> is given as C<$itemdata-E<gt>{bnotes}>.
733
734
=cut
735
736
sub GetBiblioItemData {
737
    my ($biblioitemnumber) = @_;
738
    my $dbh                = C4::Context->dbh;
739
    my $query              = "SELECT *,biblioitems.notes AS bnotes
740
        FROM biblio LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblionumber ";
741
    unless ( C4::Context->preference('item-level_itypes') ) {
742
        $query .= "LEFT JOIN itemtypes on biblioitems.itemtype=itemtypes.itemtype ";
743
    }
744
    $query .= " WHERE biblioitemnumber = ? ";
745
    my $sth = $dbh->prepare($query);
746
    my $data;
747
    $sth->execute($biblioitemnumber);
748
    $data = $sth->fetchrow_hashref;
749
    $sth->finish;
750
    return ($data);
751
}    # sub &GetBiblioItemData
752
753
=head2 GetBiblioItemByBiblioNumber
724
=head2 GetBiblioItemByBiblioNumber
754
725
755
NOTE : This function has been copy/paste from C4/Biblio.pm from head before zebra integration.
726
NOTE : This function has been copy/paste from C4/Biblio.pm from head before zebra integration.
756
- 

Return to bug 19943