[open-ils-commits] r12610 - in trunk/Open-ILS/src: perlmods/OpenILS/Application/Trigger/Reactor sql/Pg (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 19 11:57:34 EDT 2009


Author: erickson
Date: 2009-03-19 11:57:31 -0400 (Thu, 19 Mar 2009)
New Revision: 12610

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor/MarkItemLost.pm
   trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
Log:
added hook for lost.auto to handle items programatically marked lost (e.g. too long overdue).

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor/MarkItemLost.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor/MarkItemLost.pm	2009-03-19 14:48:33 UTC (rev 12609)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor/MarkItemLost.pm	2009-03-19 15:57:31 UTC (rev 12610)
@@ -29,13 +29,18 @@
     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;
 }
 

Modified: trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql	2009-03-19 14:48:33 UTC (rev 12609)
+++ trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql	2009-03-19 15:57:31 UTC (rev 12610)
@@ -30,6 +30,7 @@
 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');



More information about the open-ils-commits mailing list