1 package OpenILS::Application::Trigger::Reactor::MarkItemLost;
2 use base 'OpenILS::Application::Trigger::Reactor';
3 use strict; use warnings;
6 use OpenSRF::Utils::Logger qw/:logger/;
7 use OpenILS::Utils::CStoreEditor q/:funcs/;
8 use OpenILS::Application::Cat::AssetCommon;
9 $Data::Dumper::Indent = 0;
15 Marks circulation and corresponding item as lost. This uses
16 the standard mark-lost functionality, creating billings where appropriate.
18 Required event parameters:
19 "editor" which points to a user ID. This is the user that effectively
20 performs the action. For example, when the copy status is updated,
21 this user is entered as the last editor of the copy.
29 my $e = new_editor(xact => 1);
30 $e->requestor($e->retrieve_actor_user($$env{params}{editor}));
32 my $circ = $$env{target};
33 my $evt = OpenILS::Application::Cat::AssetCommon->set_item_lost($e, $circ->target_copy);
35 $logger->error("trigger: MarkItemLost failed with event ".$evt->{textcode});
41 my $ses = OpenSRF::AppSession->create('open-ils.trigger');
42 $ses->request('open-ils.trigger.event.autocreate', 'lost.auto', $circ, $circ->circ_lib);