[open-ils-commits] [GIT] Evergreen ILS branch master updated. 920145f106003170406543e94ee4e42c32bd70f5

Evergreen Git git at git.evergreen-ils.org
Fri Nov 4 17:52:45 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  920145f106003170406543e94ee4e42c32bd70f5 (commit)
      from  2b6a71ec267c809cc3fea0d5c888aff61255aed8 (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 920145f106003170406543e94ee4e42c32bd70f5
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Nov 2 15:45:06 2011 -0400

    TPac; sort items out list by due date, oldest first
    
    Sort items most in need of return (i.e. oldest due date) to top.  This
    is done by replacing the call to "open-ils.actor.user.checked_out",
    which does a lot more than we need, in a way that does not support
    sorting/paging, with a simple json_query.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index c84bed4..f14a200 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -767,18 +767,27 @@ sub fetch_user_circs {
 
     } else {
 
-        my $circ_data = $U->simplereq(
-            'open-ils.actor', 
-            'open-ils.actor.user.checked_out',
-            $e->authtoken, 
-            $e->requestor->id
-        );
+        my $query = {
+            select => {circ => ['id']},
+            from => 'circ',
+            where => {
+                '+circ' => {
+                    usr => $e->requestor->id,
+                    checkin_time => undef,
+                    '-or' => [
+                        {stop_fines => undef},
+                        {stop_fines => {'not in' => ['LOST','CLAIMSRETURNED','LONGOVERDUE']}}
+                    ],
+                }
+            },
+            order_by => {circ => ['due_date']}
+        };
 
-        @circ_ids =  ( @{$circ_data->{overdue}}, @{$circ_data->{out}} );
+        $query->{limit} = $limit if $limit;
+        $query->{offset} = $offset if $offset;
 
-        if($limit or $offset) {
-            @circ_ids = grep { defined $_ } @circ_ids[0..($offset + $limit - 1)];
-        }
+        my $ids = $e->json_query($query);
+        @circ_ids = map {$_->{id}} @$ids;
     }
 
     return [] unless @circ_ids;

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   29 +++++++++++++-------
 1 files changed, 19 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list