Check OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE in checkin_handle_lost.
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 29 Nov 2011 14:22:29 +0000 (09:22 -0500)
committerDan Wells <dbw2@calvin.edu>
Tue, 6 Dec 2011 14:44:15 +0000 (09:44 -0500)
Check the value of OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE before
changing the copy status in checkin_handle_lost. This makes the setting
actually do something.

Add a couple of blank lines to aid in readability.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index e47d701..c00d662 100644 (file)
@@ -3360,7 +3360,11 @@ sub checkin_handle_lost {
         $self->checkin_handle_lost_now_found_restore_od($circ_lib) if $restore_od && ! $self->void_overdues;
     }
 
-    $self->copy->status($U->copy_status(OILS_COPY_STATUS_RESHELVING));
+    my $immediately_available = $U->ou_ancestor_setting_value(
+        $circ_lib, OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE, $self->editor) || 0;
+
+    $self->copy->status($U->copy_status(OILS_COPY_STATUS_RESHELVING)) if ($immediately_available);
+
     $self->update_copy;
 }