implemented soft hold stalling by checking soft stall interval setting and passing...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Aug 2007 20:16:35 +0000 (20:16 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Aug 2007 20:16:35 +0000 (20:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7741 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 8a7e825..9bce55d 100644 (file)
@@ -1231,7 +1231,7 @@ sub find_nearest_permitted_hold {
        my $class       = shift;
        my $editor      = shift; # CStoreEditor object
        my $copy                = shift; # copy to target
-       my $user                = shift; # hold recipient
+       my $user                = shift; # staff 
        my $check_only = shift; # do no updates, just see if the copy could fulfill a hold
        my $evt         = OpenILS::Event->new('ACTION_HOLD_REQUEST_NOT_FOUND');
 
@@ -1248,12 +1248,16 @@ sub find_nearest_permitted_hold {
        # hold->type "R" means we need this copy
        for my $h (@$old_holds) { return ($h) if $h->hold_type eq 'R'; }
 
-       $logger->info("circulator: searching for best hold at org ".$user->ws_ou." and copy $bc");
+
+    my $hold_stall_interval = $U->ou_ancestor_setting_value($user->ws_ou, 'circ.hold_stalling.soft');
+
+       $logger->info("circulator: searching for best hold at org ".$user->ws_ou.
+        " and copy $bc with a hold stalling interval of ". ($hold_stall_interval || "(none)"));
 
        # search for what should be the best holds for this copy to fulfill
        my $best_holds = $U->storagereq(
                "open-ils.storage.action.hold_request.nearest_hold.atomic",
-               $user->ws_ou, $copy->id, 10 );
+               $user->ws_ou, $copy->id, 10, $hold_stall_interval );
 
        unless(@$best_holds) {