[open-ils-commits] r8556 - in branches/rel_1_2_1/Open-ILS/src: extras perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jan 31 16:18:52 EST 2008


Author: erickson
Date: 2008-01-31 15:51:13 -0500 (Thu, 31 Jan 2008)
New Revision: 8556

Modified:
   branches/rel_1_2_1/Open-ILS/src/extras/ils_events.xml
   branches/rel_1_2_1/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Log:
disallow marking an item lost that is already marked lost

Modified: branches/rel_1_2_1/Open-ILS/src/extras/ils_events.xml
===================================================================
--- branches/rel_1_2_1/Open-ILS/src/extras/ils_events.xml	2008-01-31 20:47:30 UTC (rev 8555)
+++ branches/rel_1_2_1/Open-ILS/src/extras/ils_events.xml	2008-01-31 20:51:13 UTC (rev 8556)
@@ -675,6 +675,12 @@
 	</event>
 
 
+	<event code='7018' textcode='COPY_MARKED_LOST'>
+		<desc xml:lang="en-US">The requested item is already marked as lost</desc>
+	</event>
+
+
+
 	<!-- ================================================================ -->
 
 

Modified: branches/rel_1_2_1/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- branches/rel_1_2_1/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2008-01-31 20:47:30 UTC (rev 8555)
+++ branches/rel_1_2_1/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2008-01-31 20:51:13 UTC (rev 8556)
@@ -257,6 +257,9 @@
 
     $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 @@
 
     # ---------------------------------------------------------------------
     # 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



More information about the open-ils-commits mailing list