From cf599ffa58cfd346a03f3e0db2c5ca043452a182 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 8 Jan 2015 13:06:41 -0800 Subject: [PATCH] JBAS-406 repair BC patron items out API call The API now includes circulations which have a stop_fines values of MAXFINES or LONGOVERDUE, consistent with other items-out API queries. API also updated to use open-ils.cstore instead of storage for efficiency. Signed-off-by: Bill Erickson Conflicts: Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm --- .../src/perlmods/lib/OpenILS/Application/Circ.pm | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 6f415eb82c..6c461782ea 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -203,25 +203,27 @@ __PACKAGE__->register_method( sub checkouts_by_user_opac { my( $self, $client, $auth, $user_id ) = @_; - my $e = new_editor( authtoken => $auth ); + my $e = new_editor(authtoken => $auth); return $e->event unless $e->checkauth; $user_id ||= $e->requestor->id; return $e->event unless my $patron = $e->retrieve_actor_user($user_id); - my $data; - my $search = {usr => $user_id, stop_fines => undef}; - - if( $user_id ne $e->requestor->id ) { - $data = $e->search_action_circulation( - $search, {checkperm=>1, permorg=>$patron->home_ou}) - or return $e->event; - - } else { - $data = $e->search_action_circulation($search); + if ($user_id ne $e->requestor->id) { + return $e->event unless + $e->allowed('VIEW_CIRCULATIONS', $patron->home_ou); } - return $data; + my $search = { + usr => $user_id, + checkin_time => undef, + '-or' => [ + {stop_fines => undef}, + {stop_fines => ['MAXFINES','LONGOVERDUE']} + ] + }; + + return $e->search_action_circulation($search); } -- 2.11.0