disallow marking an item lost that is already marked lost
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 31 Jan 2008 20:51:13 +0000 (20:51 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 31 Jan 2008 20:51:13 +0000 (20:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_1@8556 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/ils_events.xml
Open-ILS/src/perlmods/OpenILS/Application/Circ.pm

index 72dd5eb..5bfff16 100644 (file)
        </event>
 
 
+       <event code='7018' textcode='COPY_MARKED_LOST'>
+               <desc xml:lang="en-US">The requested item is already marked as lost</desc>
+       </event>
+
+
+
        <!-- ================================================================ -->
 
 
index b06fc5f..fcf6bd8 100644 (file)
@@ -257,6 +257,9 @@ sub new_set_circ_lost {
 
     $e->allowed('SET_CIRC_LOST', $circ->circ_lib) or return $e->die_event;
 
+    return OpenILS::Event->new('COPY_MARKED_LOST')
+           if $copy->status == OILS_COPY_STATUS_LOST;
+
     # ---------------------------------------------------------------------
     # fetch the related org settings
     my $default_price = $U->ou_ancestor_setting_value(
@@ -273,12 +276,10 @@ sub new_set_circ_lost {
 
     # ---------------------------------------------------------------------
     # move the copy into LOST status
-       unless( $copy->status == OILS_COPY_STATUS_LOST ) {
-               $copy->status(OILS_COPY_STATUS_LOST);
-        $copy->editor($e->requestor->id);
-        $copy->edit_date('now');
-        $e->update_asset_copy($copy) or return $e->die_event;
-       }
+    $copy->status(OILS_COPY_STATUS_LOST);
+    $copy->editor($e->requestor->id);
+    $copy->edit_date('now');
+    $e->update_asset_copy($copy) or return $e->die_event;
 
     # ---------------------------------------------------------------------
     # determine the appropriate item price to charge and create the billing