[Koha-cvs] koha/C4 Acquisition.pm [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Mon Feb 5 19:32:42 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	07/02/05 18:32:42

Modified files:
	C4             : Acquisition.pm 

Log message:
	new function : GetRecentAqcui.
	This function enable to list the last x recent acquisition like in koha 2.2

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Acquisition.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.43.2.10&r2=1.43.2.11

Patches:
Index: Acquisition.pm
===================================================================
RCS file: /sources/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.43.2.10
retrieving revision 1.43.2.11
diff -u -b -r1.43.2.10 -r1.43.2.11
--- Acquisition.pm	25 Jan 2007 09:37:38 -0000	1.43.2.10
+++ Acquisition.pm	5 Feb 2007 18:32:42 -0000	1.43.2.11
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Acquisition.pm,v 1.43.2.10 2007/01/25 09:37:38 tipaul Exp $
+# $Id: Acquisition.pm,v 1.43.2.11 2007/02/05 18:32:42 toins Exp $
 
 use strict;
 require Exporter;
@@ -30,7 +30,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.43.2.10 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.43.2.11 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
 
 # used in receiveorder subroutine
 # to provide library specific handling
@@ -60,7 +60,7 @@
   &GetBasket &NewBasket &CloseBasket
   &GetPendingOrders &GetOrder &GetOrders
   &GetOrderNumber &GetLateOrders &NewOrder &DelOrder
-  &SearchOrder &GetHistory
+  &SearchOrder &GetHistory &GetRecentAcqui
   &ModOrder &ModReceiveOrder &ModOrderBiblioNumber
   &GetParcels &GetParcel
 );
@@ -1127,6 +1127,32 @@
     return \@order_loop, $total_qty, $total_price, $total_qtyreceived;
 }
 
+=head2 GetRecentAcqui
+
+   $results = GetRecentAcqui($days);
+
+   C<$results> is a ref to a table which containts hashref
+
+=cut
+
+sub GetRecentAcqui {
+    my $limit  = shift;
+    my $dbh    = C4::Context->dbh;
+    my $query = "
+        SELECT *
+        FROM   biblio
+        ORDER BY timestamp DESC
+        LIMIT  0,".$limit;
+
+    my $sth = $dbh->prepare($query);
+    $sth->execute;
+    my @results;
+    while(my $data = $sth->fetchrow_hashref){
+        push @results,$data;
+    }
+    return \@results;
+}
+
 END { }    # module clean-up code here (global destructor)
 
 1;





More information about the Koha-cvs mailing list