[open-ils-commits] r16980 - trunk/Open-ILS/src/perlmods/OpenILS/Application (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jul 19 15:03:24 EDT 2010


Author: miker
Date: 2010-07-19 15:03:20 -0400 (Mon, 19 Jul 2010)
New Revision: 16980

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
Log:
use abs() to get page number in either direction

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-07-19 15:06:59 UTC (rev 16979)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-07-19 19:03:20 UTC (rev 16980)
@@ -381,7 +381,7 @@
 	my $copy_locations = shift || [];
 
 
-	my $offset = $page * $limit;
+	my $offset = abs($page) * $limit;
 	my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
 
 	my $o_search = { shortname => $ou };
@@ -1120,7 +1120,7 @@
 	my $statuses = shift || [];
 	my $copy_locations = shift || [];
 
-	my $offset = $limit * $page;
+	my $offset = $limit * abs($page);
 	my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
 
 	my @ou_ids;
@@ -1353,7 +1353,7 @@
 	my $limit = shift || 10;
 	my $page = shift || 0;
 
-	my $offset = $limit * $page;
+	my $offset = $limit * abs($page);
 	my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
 
 	my @list = ();



More information about the open-ils-commits mailing list