[open-ils-commits] r14752 - in trunk/Open-ILS/src/perlmods/OpenILS/Application: Circ Storage/CDBI (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 3 16:50:09 EST 2009
Author: erickson
Date: 2009-11-03 16:50:04 -0500 (Tue, 03 Nov 2009)
New Revision: 14752
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
Log:
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
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-11-03 21:38:22 UTC (rev 14751)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-11-03 21:50:04 UTC (rev 14752)
@@ -721,6 +721,7 @@
{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 @@
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,7 +1006,16 @@
/
);
+__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 ) = @_;
my( $reqr, $evt ) = $U->checkses($authtoken);
@@ -1011,10 +1027,20 @@
$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',
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2009-11-03 21:38:22 UTC (rev 14751)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2009-11-03 21:50:04 UTC (rev 14752)
@@ -122,7 +122,7 @@
__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 @@
__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/);
#-------------------------------------------------------------------------------
More information about the open-ils-commits
mailing list