[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 4179d9760484af0eefd5537e8e95a7981f33d132

Evergreen Git git at git.evergreen-ils.org
Tue Nov 8 13:14: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, rel_2_0 has been updated
       via  4179d9760484af0eefd5537e8e95a7981f33d132 (commit)
      from  e720becf7bc1e64624f6d773440d736bfec9e6b9 (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 4179d9760484af0eefd5537e8e95a7981f33d132
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: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
index c628820..ad39d39 100644
--- a/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
+++ b/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
@@ -266,15 +266,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/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