From: Bill Erickson Date: Thu, 8 Jan 2015 21:06:41 +0000 (-0800) Subject: JBAS-406 repair BC patron items out API call X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cf599ffa58cfd346a03f3e0db2c5ca043452a182;p=working%2FEvergreen.git 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 --- 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); }