From: erickson Date: Thu, 31 Jan 2008 20:51:13 +0000 (+0000) Subject: disallow marking an item lost that is already marked lost X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f62a3887550bcc05909a5f272b227165747006e7;p=Evergreen.git disallow marking an item lost that is already marked lost git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_1@8556 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml index 72dd5ebddc..5bfff164c1 100644 --- a/Open-ILS/src/extras/ils_events.xml +++ b/Open-ILS/src/extras/ils_events.xml @@ -675,6 +675,12 @@ + + The requested item is already marked as lost + + + + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index b06fc5ff23..fcf6bd8a76 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -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