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

Kyle Hall kyle.m.hall at gmail.com
Mon Nov 19 15:46:24 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/11/19 14:46:24

Modified files:
	C4             : Koha.pm 
	C4/Circulation : Circ2.pm 

Log message:
	Stats for renewals were not including the borrowernumber, or the itemtype. Fixed.

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.17&r2=1.22.2.4.2.18
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.87.2.14.2.34&r2=1.87.2.14.2.35

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.17
retrieving revision 1.22.2.4.2.18
diff -u -b -r1.22.2.4.2.17 -r1.22.2.4.2.18
--- Koha.pm	8 Jul 2007 22:14:21 -0000	1.22.2.4.2.17
+++ Koha.pm	19 Nov 2007 14:46:23 -0000	1.22.2.4.2.18
@@ -84,8 +84,9 @@
 			&getPreviousItemIssues
                         &getItemnumberByBarcode
 
+			&getitemtypes
 
-&getitemtypes
+			&GetItemType
 
 			$DEBUG);
 
@@ -1265,6 +1266,21 @@
 }
 		
 
+sub GetItemType {
+  my ( $itemnumber ) = @_;
+  
+  my $dbh = C4::Context->dbh;
+    
+  my $sth = $dbh->prepare("SELECT biblioitems.itemtype FROM items, biblioitems WHERE items.biblionumber = biblioitems.biblionumber AND items.itemnumber = ?");
+  $sth->execute( $itemnumber ) or return( 0 );
+        
+  my $row = $sth->fetchrow_hashref;
+          
+  my $itemtype = $$row{'itemtype'};
+  $sth->finish;
+              
+  return( $itemtype );              
+}
 
 1;
 __END__

Index: Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Attic/Circ2.pm,v
retrieving revision 1.87.2.14.2.34
retrieving revision 1.87.2.14.2.35
diff -u -b -r1.87.2.14.2.34 -r1.87.2.14.2.35
--- Circulation/Circ2.pm	31 Oct 2007 15:37:05 -0000	1.87.2.14.2.34
+++ Circulation/Circ2.pm	19 Nov 2007 14:46:24 -0000	1.87.2.14.2.35
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.87.2.14.2.34 2007/10/31 15:37:05 kylemhall Exp $
+# $Id: Circ2.pm,v 1.87.2.14.2.35 2007/11/19 14:46:24 kylemhall Exp $
 
 #package to deal with Returns
 #written 3/11/99 by olwen at katipo.co.nz
@@ -1825,7 +1825,8 @@
     $sth->finish;
 
 # Log the renewal
-    UpdateStats($env,$env->{'branchcode'},'renew','','',$itemno);
+    my $itemtype = GetItemType( $itemno );
+    UpdateStats($env,$env->{'branchcode'},'renew','','',$itemno, $itemtype, $bornum);
 
 # Charge a new rental fee, if applicable?
     my ($charge,$type)=calc_charges($env, $itemno, $bornum);





More information about the Koha-cvs mailing list