when retargeting alternate holds after opportunistic checkin capture, only retarget...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 3 Jun 2009 15:22:29 +0000 (15:22 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 3 Jun 2009 15:22:29 +0000 (15:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13298 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index 8c8fd41..e917793 100644 (file)
@@ -1999,9 +1999,10 @@ sub do_hold_notify {
 }
 
 sub retarget_holds {
-    $logger->info("circulator: retargeting prev_check_time=null holds after opportunistic capture");
+    my $self = shift;
+    $logger->info("circulator: retargeting holds @{$self->retarget} after opportunistic capture");
     my $ses = OpenSRF::AppSession->create('open-ils.storage');
-    $ses->request('open-ils.storage.action.hold_request.copy_targeter');
+    $ses->request('open-ils.storage.action.hold_request.copy_targeter', undef, $self->retarget);
     # no reason to wait for the return value
     return;
 }
index ed498aa..ed3d9cd 100644 (file)
@@ -1642,7 +1642,7 @@ sub find_nearest_permitted_hold {
                or return (undef, $editor->event);
 
 
-    my $retarget = 0;
+    my @retarget;
 
        # re-target any other holds that already target this copy
        for my $old_hold (@$old_holds) {
@@ -1653,10 +1653,10 @@ sub find_nearest_permitted_hold {
         $old_hold->clear_prev_check_time;
         $editor->update_action_hold_request($old_hold) 
             or return (undef, $editor->event);
-        $retarget = 1;
+        push(@retarget, $old_hold->id);
        }
 
-       return ($best_hold, undef, $retarget);
+       return ($best_hold, undef, (@retarget) ? \@retarget : undef);
 }