From: erickson Date: Tue, 3 Nov 2009 21:50:04 +0000 (+0000) Subject: added a .count version of the hold pull list. added the prev_dest column to perl... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7194aa70ec6280f5c1191a8f5d19fdd85a01aa40;p=contrib%2FConifer.git added a .count version of the hold pull list. added the prev_dest column to perl cdbi. reset hold if it goes from non-mint to mint. capture the prev_dest when a hold transit it changed mid-transit git-svn-id: svn://svn.open-ils.org/ILS/trunk@14752 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 22212dcfbd..498befdf0c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -721,6 +721,7 @@ sub update_hold_impl { {hold=>$hold->id, dest_recv_time => undef})->[0] or return $e->die_event; + $transit->prev_dest($transit->dest); # mark the previous destination on the transit $transit->dest($hold->pickup_lib); $e->update_action_hold_transit_copy($transit) or return $e->die_event; @@ -740,6 +741,12 @@ sub update_hold_impl { update_hold_if_frozen($self, $e, $hold, $orig_hold); $e->update_action_hold_request($hold) or return $e->die_event; $e->commit; + + # a change to mint-condition changes the set of potential copies, so retarget the hold; + if($U->is_true($hold->mint_condition) and !$U->is_true($orig_hold->mint_condition)) { + _reset_hold($self, $e->requestor, $hold) + } + return $hold->id; } @@ -999,6 +1006,15 @@ __PACKAGE__->register_method ( / ); +__PACKAGE__->register_method ( + method => "hold_pull_list", + api_name => "open-ils.circ.hold_pull_list.retrieve.count", + signature => q/ + Returns a list of holds that need to be "pulled" + by a given location + / +); + sub hold_pull_list { my( $self, $conn, $authtoken, $limit, $offset ) = @_; @@ -1011,10 +1027,20 @@ sub hold_pull_list { $evt = $U->check_perms($reqr->id, $org, 'VIEW_HOLD'); return $evt if $evt; - if( $self->api_name =~ /id_list/ ) { + if($self->api_name =~ /count/) { + + my $count = $U->storagereq( + 'open-ils.storage.direct.action.hold_request.pull_list.current_copy_circ_lib.status_filtered.count', + $org, $limit, $offset ); + + $logger->info("Grabbing pull list for org unit $org with $count items"); + return $count + + } elsif( $self->api_name =~ /id_list/ ) { return $U->storagereq( 'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered.atomic', $org, $limit, $offset ); + } else { return $U->storagereq( 'open-ils.storage.direct.action.hold_request.pull_list.search.current_copy_circ_lib.status_filtered.atomic', diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm index 6ae0a237c6..3cbfc7ba08 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm @@ -122,7 +122,7 @@ use base qw/action/; __PACKAGE__->table('action_hold_transit_copy'); __PACKAGE__->columns(Primary => 'id'); __PACKAGE__->columns(Essential => qw/source dest persistant_transfer target_copy - source_send_time dest_recv_time prev_hop + source_send_time dest_recv_time prev_hop prev_dest copy_status hold/); #------------------------------------------------------------------------------- @@ -132,7 +132,7 @@ use base qw/action/; __PACKAGE__->table('action_transit_copy'); __PACKAGE__->columns(Primary => 'id'); __PACKAGE__->columns(Essential => qw/source dest persistant_transfer target_copy - source_send_time dest_recv_time prev_hop + source_send_time dest_recv_time prev_hop prev_dest copy_status/); #-------------------------------------------------------------------------------