[open-ils-commits] [GIT] Evergreen ILS branch master updated. d0572fee8bcf0427901341ba7e9cd24db7162481
Evergreen Git
git at git.evergreen-ils.org
Tue Nov 15 16:36:58 EST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via d0572fee8bcf0427901341ba7e9cd24db7162481 (commit)
from 02211d5c48e703e691564c69b6ef42a98f5e15b6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d0572fee8bcf0427901341ba7e9cd24db7162481
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Tue Oct 18 15:10:07 2011 -0400
Obey renewal rules for SIP2 Checkout
If local policy OR the selfcheck are set to not do renewals than don't
attempt them.
Also, return whether a renewal was attempted (success or failure) so that
the self check on the other end has a better clue what went on.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
index a6d3aab..3a82c79 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
@@ -283,7 +283,7 @@ sub checkin_ok {
}
sub renew_ok {
- return to_bool($config->{policy}->{renew});
+ return to_bool($config->{policy}->{renewal});
}
sub status_update_ok {
@@ -309,7 +309,8 @@ sub offline_ok {
sub checkout {
my ($self, $patron_id, $item_id, $sc_renew, $fee_ack) = @_;
- $sc_renew = 0;
+ # In order to allow renewals the selfcheck AND the config have to say they are allowed
+ $sc_renew = (chr($sc_renew) eq 'Y' && $self->renew_ok());
$self->verify_session;
@@ -340,13 +341,23 @@ sub checkout {
syslog('LOG_DEBUG', "OILS: OpenILS::Checkout data loaded OK, checking out...");
if ($item->{patron} && ($item->{patron} eq $patron_id)) {
- syslog('LOG_INFO', "OILS: OpenILS::Checkout data loaded OK, doing renew...");
- $sc_renew = 1;
+ $xact->renew_ok(1); # So that accept/reject responses have the correct value later
+ if($sc_renew) {
+ syslog('LOG_INFO', "OILS: OpenILS::Checkout data loaded OK, doing renew...");
+ } else {
+ syslog('LOG_INFO', "OILS: OpenILS::Checkout appears to be renew, but renewal disallowed...");
+ $xact->screen_msg("Renewals not permitted");
+ $xact->ok(0);
+ return $xact; # Don't attempt later
+ }
} elsif ($item->{patron} && ($item->{patron} ne $patron_id)) {
# I can't deal with this right now
# XXX check in then check out?
$xact->screen_msg("Item checked out to another patron");
$xact->ok(0);
+ return $xact; # Don't wipe out the screen message later
+ } else {
+ $sc_renew = 0;
}
# Check for fee and $fee_ack. If there is a fee, and $fee_ack
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/perlmods/lib/OpenILS/SIP.pm | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list