1 package OpenILS::Application::Trigger::Reactor::MarkItemLongOverdue;
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 long-overdue. This uses
16 the standard mark-long-overdue functionality, creating billings where
19 Required event parameters:
20 "editor" which points to a user ID. This is the user that effectively
21 performs the action. For example, when the copy status is updated,
22 this user is entered as the last editor of the copy.
30 my $e = new_editor(xact => 1);
32 my $requestor = $e->retrieve_actor_user($$env{params}{editor});
35 $logger->error("trigger: MarkItemLongOverdue require 'editor' param");
39 $e->requestor($requestor);
41 my $circ = $$env{target};
42 my $evt = OpenILS::Application::Cat::AssetCommon->
43 set_item_long_overdue($e, $circ->target_copy);
46 $logger->error("trigger: MarkItemLongOverdue ".
47 "failed with event $evt->{textcode}");
53 my $ses = OpenSRF::AppSession->create('open-ils.trigger');
54 $ses->request('open-ils.trigger.event.autocreate',
55 'longoverdue.auto', $circ, $circ->circ_lib);