[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9eaadfeda3506e52651c8b8695da1e569765ec7c
Evergreen Git
git at git.evergreen-ils.org
Tue Oct 18 10:33:06 EDT 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 9eaadfeda3506e52651c8b8695da1e569765ec7c (commit)
from 30fa94a8d64250e336b4f2b56b2901414fcc6323 (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 9eaadfeda3506e52651c8b8695da1e569765ec7c
Author: Sarah E. Chodrow <sarah.chodrow at bibliotheca-itg.com>
Date: Wed Sep 14 09:15:14 2011 -0400
Initial patch from Sarah Chodrow on LP bug 849447.
Also check for standing penalties and expired cards when checking
if it is ok for the patron to checkout, charge_ok.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: Sarah E. Chodrow (sarah.chodrow at bibliotheca-itg.com)
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
index 17389fa..4c1323c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
@@ -275,15 +275,31 @@ sub language {
}
# How much more detail do we need to check here?
+# sec: adding logic to return false if user is barred, has a circulation block
+# or an expired card
sub charge_ok {
my $self = shift;
my $u = $self->{user};
- return
- $u->barred eq 'f' and
+
+ # compute expiration date for borrowing privileges
+ my $expire = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($u->expire_date));
+
+ # determine whether patron should be allowed to circulate materials:
+ # not barred, doesn't owe too much wrt fines/fees, privileges haven't
+ # expired
+ my $no_circ = 't' if
+ (($u->barred eq 't') or
+ ($u->standing_penalties and @{$u->standing_penalties}) or
+ (CORE::time > $expire->epoch));
+
+ return
+ !$no_circ and
$u->active eq 't' and
$u->card->active eq 't';
}
+
+
# How much more detail do we need to check here?
sub renew_ok {
my $self = shift;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list