koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 Biblio.pm [dev_week]


From: Joshua Ferraro
Subject: [Koha-cvs] koha/C4 Biblio.pm [dev_week]
Date: Tue, 03 Oct 2006 14:29:57 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Joshua Ferraro <kados>  06/10/03 14:29:57

Modified files:
        C4             : Biblio.pm 

Log message:
        Changing name of MARCgetbiblio2 to &GetMARCFromBiblioitems
        It should be moved to Search.pm
        Added some documentation
        Toins, feel free to add this to rel_3_0

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.115.2.51.2.32&r2=1.115.2.51.2.33

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.51.2.32
retrieving revision 1.115.2.51.2.33
diff -u -b -r1.115.2.51.2.32 -r1.115.2.51.2.33
--- Biblio.pm   3 Oct 2006 12:51:37 -0000       1.115.2.51.2.32
+++ Biblio.pm   3 Oct 2006 14:29:57 -0000       1.115.2.51.2.33
@@ -73,7 +73,7 @@
   &MARCgetbiblio &MARCgetitem &XMLgetbiblio
   &MARCaddword &MARCdelword 
   &MARCdelsubfield
-  &MARCgetbiblio2
+  &GetMARCFromBiblioitems
 );
 
 =head1 NAME
@@ -776,29 +776,32 @@
 
 }
 
-=head2 MARCgetbiblio2
+=head2 GetMARCFromBiblioitems
 
-=cut
-
-sub MARCgetbiblio2 {
+my $record = GetMARCFromBiblioitems($dbh,$biblionumber);
 
-    # Returns MARC::Record of the biblio passed in parameter.
-    my ( $dbh, $bibid ) = @_;
+Returns a MARC::Record of the biblionumber passed as a parameter
   
+warns and returns undef if there's no biblionumber associated with it
 
-    my $sth =
-      $dbh->prepare("select marc from biblioitems where biblionumber=? "  );
+=cut
     
+sub GetMARCFromBiblioitems {
+    my ( $dbh, $bibid ) = @_;
+       # pull out the MARC data from biblioitems
+    my $sth = $dbh->prepare("select marc from biblioitems where biblionumber=? 
"  );
     $sth->execute($bibid);
    my ($marc)=$sth->fetchrow;
+       # turn this into a MARC::Record object
  my $record = MARC::File::USMARC::decode($marc);
-my $oldbiblio = MARCmarc2koha($dbh,$record,'');
+       my $oldbiblio = MARCmarc2koha($dbh,$record,'');
    if($oldbiblio->{'biblionumber'}){
  return $record;
-}else{
+       }
+       else{
        warn "Record $bibid does not have field for biblionumber";
        return undef;
-}
+       }
 }
 
 =head2 MARCgetitem_frombarcode
@@ -2088,7 +2091,10 @@
 
        ## Now calculate lccalnumber
        my 
($cutterextra)=itemcalculator($dbh,$item->{'bibitemnum'},$item->{'itemcallnumber'});
-    my $query = "update items set  
barcode=?,itemnotes=?,itemcallnumber=?,notforloan=?,location=?,multivolumepart=?,multivolume=?,stack=?,wthdrawn=?,holdingbranch=?,homebranch=?,cutterextra=?,
 onloan=?";
+
+    my $query = "UPDATE items SET
+barcode=?,itemnotes=?,itemcallnumber=?,notforloan=?,location=?,multivolumepart=?,multivolume=?,stack=?,wthdrawn=?,holdingbranch=?,homebranch=?,cutterextra=?,
 onloan=?";
+
     my @bind = (
         $item->{'barcode'},                    $item->{'notes'},
         $item->{'itemcallnumber'},     $item->{'notforloan'},
@@ -3140,8 +3146,14 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.51.2.32 2006/10/03 12:51:37 kados Exp $
+# $Id: Biblio.pm,v 1.115.2.51.2.33 2006/10/03 14:29:57 kados Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.51.2.33  2006/10/03 14:29:57  kados
+# Changing name of MARCgetbiblio2 to &GetMARCFromBiblioitems
+# It should be moved to Search.pm
+# Added some documentation
+# Toins, feel free to add this to rel_3_0
+#
 # Revision 1.115.2.51.2.32  2006/10/03 12:51:37  kados
 # minor cleanup
 #




reply via email to

[Prev in Thread] Current Thread [Next in Thread]