From def9029837702c946b688cda8e480a7dbedf9480 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 9 Dec 2009 15:44:52 +0000 Subject: [PATCH] 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) git-svn-id: svn://svn.open-ils.org/ILS/trunk@15121 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/offline/offline.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/offline/offline.pl b/Open-ILS/src/offline/offline.pl index a40b8e5dd1..96b1bcf47e 100755 --- a/Open-ILS/src/offline/offline.pl +++ b/Open-ILS/src/offline/offline.pl @@ -656,8 +656,19 @@ sub ol_handle_checkout { 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 @@ sub ol_handle_renew { 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 ); } -- 2.11.0