koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Members.pm


From: Robert Lyon
Subject: [Koha-cvs] koha/C4 Members.pm
Date: Tue, 06 Jun 2006 23:36:37 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     Robert Lyon <bob_lyon>  06/06/06 23:36:37

Modified files:
        C4             : Members.pm 

Log message:
        merging Katipo changes...
        
        site specific chage for issues data being stored in two tables

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&r1=1.22&r2=1.23

Patches:
Index: Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- Members.pm  6 Jun 2006 15:54:36 -0000       1.22
+++ Members.pm  6 Jun 2006 23:36:37 -0000       1.23
@@ -19,7 +19,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Members.pm,v 1.22 2006/06/06 15:54:36 btoumi Exp $
+# $Id: Members.pm,v 1.23 2006/06/06 23:36:37 bob_lyon Exp $
 
 use strict;
 require Exporter;
@@ -31,7 +31,7 @@
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
-$VERSION = do { my @v = '$Revision: 1.22 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.23 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -869,6 +869,7 @@
 
     #FIXME: sanity-check order and limit
     my $dbh   = C4::Context->dbh;
+    my $count=0;
     my $query = "Select * from issues,biblio,items,biblioitems
   where borrowernumber=? and
   items.biblioitemnumber=biblioitems.biblioitemnumber and
@@ -886,8 +887,35 @@
     while ( my $data = $sth->fetchrow_hashref ) {
         $result[$i] = $data;
         $i++;
+       $count++;
+    }
+
+    # get all issued items for bornum from oldissues table
+    # large chunk of older issues data put into table oldissues
+    # to speed up db calls for issuing items
+    if(C4::Context->preference("ReadingHistory")){
+          my $query2="SELECT * FROM oldissues,biblio,items,biblioitems
+                      WHERE borrowernumber=? 
+                      AND items.biblioitemnumber=biblioitems.biblioitemnumber
+                      AND items.itemnumber=oldissues.itemnumber
+                      AND items.biblionumber=biblio.biblionumber
+                      ORDER BY $order";
+          if ($limit !=0){
+                $limit=$limit-$count;
+                $query2.=" limit $limit";
+          }
+
+          my $sth2=$dbh->prepare($query2);
+          $sth2->execute($bornum);
+
+          while (my $data2=$sth2->fetchrow_hashref){
+                $result[$i]=$data2;
+                $i++;
+          }
+          $sth2->finish;
     }
     $sth->finish;
+
     return ( $i, address@hidden );
 }
 




reply via email to

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