added hook for lost.auto to handle items programatically marked lost (e.g. too long...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Mar 2009 15:57:31 +0000 (15:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Mar 2009 15:57:31 +0000 (15:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12610 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor/MarkItemLost.pm
Open-ILS/src/sql/Pg/400.schema.action_trigger.sql

index 30fc5e3..eaba44b 100644 (file)
@@ -29,13 +29,18 @@ sub handler {
     my $e = new_editor(xact => 1);
     $e->requestor($e->retrieve_actor_user($$env{params}{editor}));
 
-    my $evt = OpenILS::Application::Cat::AssetCommon->set_item_lost($e, $$env{target}->target_copy);
+    my $circ = $$env{target};
+    my $evt = OpenILS::Application::Cat::AssetCommon->set_item_lost($e, $circ->target_copy);
     if($evt) {
         $logger->error("trigger: MarkItemLost failed with event ".$evt->{textcode});
         return 0;
     }
 
     $e->commit;
+
+    my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+    $ses->request('open-ils.trigger.event.autocreate', 'lost.auto', $circ, $circ->circ_lib);
+
     return 1;
 }
 
index 6abbc75..b147375 100644 (file)
@@ -30,6 +30,7 @@ INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('checkout','
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('checkin','circ','Item checked in');
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('lost','circ','Circulating Item marked Lost');
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('lost.found','circ','Lost Circulating Item checked in');
+INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('lost.auto','circ','Circulating Item automatically marked lost');
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('claims_returned','circ','Circulating Item marked Claims Returned');
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('claims_returned.found','circ','Claims Returned Circulating Item is checked in');
 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('missing','acp','Item marked Missing');