implemented soft hold ceilings
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Mar 2008 16:35:05 +0000 (16:35 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Mar 2008 16:35:05 +0000 (16:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9073 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 51f690c..4a3f569 100644 (file)
@@ -1028,9 +1028,16 @@ sub check_title_hold {
             return {success => 0};
         }
 
-    } elsif(defined $soft_ceiling) {
-        $logger->info("performing hold possibility check with soft ceiling $soft_ceiling");
-        # XXX soft ceilings.  work up the tree until a potential copy is found
+    } elsif(defined $soft_ceiling and $$params{depth} < $soft_ceiling) {
+        my $depth = $soft_ceiling;
+        # work up the tree and as soon as we find a potential copy, use that depth
+        while($depth >= $$params{depth}) {
+            $logger->info("performing hold possibility check with soft ceiling $depth");
+            return {success => 1, depth => $depth}
+                if do_possibility_checks($e, $patron, $request_lib, $depth, %params);
+            $depth--;
+        }
+        return {success => 0};
 
     } else {
         $logger->info("performing hold possibility check with no ceiling");