From 3a0dd23027cf94d0149ae637eef765f736205f75 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 7 Jun 2013 09:42:57 -0400 Subject: [PATCH] LP1040147 Return wrong-shelf holds in clearable list 1. Change the staff client "View Shelf-Expired Holds" action label to "View Clearable Holds". 2. When "View Clearable Holds" is selected, display both shelf-expired and wrong-shelf holds. New API calls: open-ils.circ.captured_holds.expired_on_shelf_or_wrong_shelf.retrieve open-ils.circ.captured_holds.id_list.expired_on_shelf_or_wrong_shelf.retrieve Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge --- .../lib/OpenILS/Application/Circ/Holds.pm | 35 +++++++++++++++++++ .../chrome/content/main/constants.js | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 7e064920e2..924da087a4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -2056,6 +2056,30 @@ __PACKAGE__->register_method( / ); +__PACKAGE__->register_method( + method => 'fetch_captured_holds', + api_name => + 'open-ils.circ.captured_holds.expired_on_shelf_or_wrong_shelf.retrieve', + stream => 1, + authoritative => 1, + signature => q/ + Returns list of shelf-expired un-fulfilled holds OR wrong shelf holds + for a given shelf lib + / +); + +__PACKAGE__->register_method( + method => 'fetch_captured_holds', + api_name => + 'open-ils.circ.captured_holds.id_list.expired_on_shelf_or_wrong_shelf.retrieve', + stream => 1, + authoritative => 1, + signature => q/ + Returns list of shelf-expired un-fulfilled holds OR wrong shelf holds + for a given shelf lib + / +); + sub fetch_captured_holds { my( $self, $conn, $auth, $org, $match_copy ) = @_; @@ -2097,6 +2121,17 @@ sub fetch_captured_holds { } my $hold_ids = $e->json_query( $query ); + if ($self->api_name =~ /wrong_shelf/) { + # fetch holds whose current_shelf_lib is $org, but whose pickup + # lib is some other org unit. Ignore already-retrieved holds. + my $wrong_shelf = + pickup_lib_changed_on_shelf_holds( + $e, $org, [map {$_->{id}} @$hold_ids]); + # match the layout of other items in $hold_ids + push (@$hold_ids, {id => $_}) for @$wrong_shelf; + } + + for my $hold_id (@$hold_ids) { if($self->api_name =~ /id_list/) { $conn->respond($hold_id->{id}); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 0956d9e4f8..80748cac3b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -140,7 +140,7 @@ var api = { 'HTML_HOLD_PULL_LIST' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_pull_list.print' }, 'FM_AHR_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.on_shelf.retrieve' }, 'FM_AHR_ID_LIST_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.id_list.on_shelf.retrieve.authoritative', 'secure' : false }, - 'FM_AHR_ID_LIST_EXPIRED_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.id_list.expired_on_shelf.retrieve.authoritative', 'secure' : false }, + 'FM_AHR_ID_LIST_EXPIRED_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.id_list.expired_on_shelf_or_wrong_shelf.retrieve', 'secure' : false }, 'FM_AHR_COUNT_FOR_BRE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.bre.holds.count', 'secure' : false }, 'FM_AHR_COUNT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count', 'cacheable' : true, 'ttl' : 60000 }, 'FM_AHR_COUNT_RETRIEVE.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count.authoritative', 'cacheable' : true, 'ttl' : 60000 }, -- 2.43.2