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

(-)a/C4/Biblio.pm (-41 lines)
Lines 68-74 BEGIN { Link Here
68
      GetBiblioItemData
68
      GetBiblioItemData
69
      GetBiblioItemInfosOf
69
      GetBiblioItemInfosOf
70
      GetBiblioItemByBiblioNumber
70
      GetBiblioItemByBiblioNumber
71
      GetBiblioFromItemNumber
72
      GetBiblionumberFromItemnumber
71
      GetBiblionumberFromItemnumber
73
72
74
      &GetRecordValue
73
      &GetRecordValue
Lines 847-891 sub GetBiblionumberFromItemnumber { Link Here
847
    return ($result);
846
    return ($result);
848
}
847
}
849
848
850
=head2 GetBiblioFromItemNumber
851
852
  $item = &GetBiblioFromItemNumber($itemnumber,$barcode);
853
854
Looks up the item with the given itemnumber. if undef, try the barcode.
855
856
C<&itemnodata> returns a reference-to-hash whose keys are the fields
857
from the C<biblio>, C<biblioitems>, and C<items> tables in the Koha
858
database.
859
860
=cut
861
862
#'
863
sub GetBiblioFromItemNumber {
864
    my ( $itemnumber, $barcode ) = @_;
865
    my $dbh = C4::Context->dbh;
866
    my $sth;
867
    if ($itemnumber) {
868
        $sth = $dbh->prepare(
869
            "SELECT * FROM items 
870
            LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
871
            LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
872
             WHERE items.itemnumber = ?"
873
        );
874
        $sth->execute($itemnumber);
875
    } else {
876
        $sth = $dbh->prepare(
877
            "SELECT * FROM items 
878
            LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
879
            LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
880
             WHERE items.barcode = ?"
881
        );
882
        $sth->execute($barcode);
883
    }
884
    my $data = $sth->fetchrow_hashref;
885
    $sth->finish;
886
    return ($data);
887
}
888
889
=head2 GetISBDView 
849
=head2 GetISBDView 
890
850
891
  $isbd = &GetISBDView({
851
  $isbd = &GetISBDView({
892
- 

Return to bug 18276