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

Cindy Murdock cmurdock at ccfls.org
Fri May 18 21:52:03 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Cindy Murdock <clm>	07/05/18 19:52:03

Modified files:
	C4             : Koha.pm 

Log message:
	Adding forgotten sub getItemnumberByBarcode

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.15&r2=1.22.2.4.2.16

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.15
retrieving revision 1.22.2.4.2.16
diff -u -b -r1.22.2.4.2.15 -r1.22.2.4.2.16
--- Koha.pm	17 May 2007 17:54:40 -0000	1.22.2.4.2.15
+++ Koha.pm	18 May 2007 19:52:02 -0000	1.22.2.4.2.16
@@ -81,8 +81,8 @@
 			&displaySecondaryServers
 			&displayLanguages
 
-			getPreviousItemIssues
-                        getItemnumberByBarcode
+			&getPreviousItemIssues
+                        &getItemnumberByBarcode
 
 			$DEBUG);
 
@@ -1219,6 +1219,23 @@
    return \@previousIssues;
 }
                 
+sub getItemnumberByBarcode {
+  my ( $barcode ) = @_;
+    
+  my $dbh = C4::Context->dbh;
+        
+  my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE barcode = ?");
+  $sth->execute( $barcode ) or return( 0 );
+	        
+  my $row = $sth->fetchrow_hashref;
+	            
+  my $itemnumber = $$row{'itemnumber'};
+  $sth->finish;
+	                    
+  return( $itemnumber );
+}
+		
+
 
 1;
 __END__





More information about the Koha-cvs mailing list