[open-ils-commits] r15121 - trunk/Open-ILS/src/offline (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 9 10:44:55 EST 2009


Author: erickson
Date: 2009-12-09 10:44:52 -0500 (Wed, 09 Dec 2009)
New Revision: 15121

Modified:
   trunk/Open-ILS/src/offline/offline.pl
Log:
added support for auto-renew in offline processor.  now using renew.override in offline processor to better reflect reality (i.e. the patron thinks they renewed, try harder to make that a reality in the software)

Modified: trunk/Open-ILS/src/offline/offline.pl
===================================================================
--- trunk/Open-ILS/src/offline/offline.pl	2009-12-09 14:39:14 UTC (rev 15120)
+++ trunk/Open-ILS/src/offline/offline.pl	2009-12-09 15:44:52 UTC (rev 15121)
@@ -656,8 +656,19 @@
         return $e if $e;
     }
 
-	return $U->simplereq(
+    my $evt = $U->simplereq(
 		'open-ils.circ', 'open-ils.circ.checkout', $authtoken, $args );
+
+    # if the item is already checked out to this user and we are past 
+    # the configured auto-renewal interval, try to renew the circ.
+    if( ref $evt ne 'ARRAY' and
+        $evt->{textcode} == 'OPEN_CIRCULATION_EXISTS' and 
+        $evt->{payload}->{auto_renew}) {
+
+            return ol_handle_renew($command);
+    }
+
+    return $evt;
 }
 
 
@@ -669,7 +680,7 @@
 	my $args = ol_circ_args_from_command($command);
 	my $t = time;
 	return $U->simplereq(
-		'open-ils.circ', 'open-ils.circ.renew', $authtoken, $args );
+		'open-ils.circ', 'open-ils.circ.renew.override', $authtoken, $args );
 }
 
 



More information about the open-ils-commits mailing list