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

svn at svn.open-ils.org svn at svn.open-ils.org
Tue May 26 10:03:53 EDT 2009


Author: erickson
Date: 2009-05-26 10:03:52 -0400 (Tue, 26 May 2009)
New Revision: 13230

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
   trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
Log:
created hooks and drop points for damaged and checkout.damaged, the latter occuring when a patron is 'linked' to a damaged item (aka charged fines) by virtue of the most recent circulation

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2009-05-26 12:36:47 UTC (rev 13229)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2009-05-26 14:03:52 UTC (rev 13230)
@@ -19,6 +19,7 @@
 use OpenILS::Application::AppUtils;
 
 use OpenSRF::Utils qw/:datetime/;
+use OpenSRF::AppSession;
 use OpenILS::Utils::ModsParser;
 use OpenILS::Event;
 use OpenSRF::EX qw(:try);
@@ -881,6 +882,9 @@
         my $evt = handle_mark_damaged($e, $copy, $owning_lib, $args);
         return $evt if $evt;
 
+        my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+        $ses->request('open-ils.trigger.event.autocreate', 'damaged', $copy, $owning_lib);
+
 	} elsif ( $self->api_name =~ /bindery/ ) {
 		$perm = 'MARK_ITEM_BINDERY';
 		$stat = OILS_COPY_STATUS_BINDERY;
@@ -969,6 +973,10 @@
 
         my $evt = OpenILS::Application::Circ::CircCommon->reopen_xact($e, $circ->id);
         return $evt if $evt;
+
+        my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+        $ses->request('open-ils.trigger.event.autocreate', 'checkout.damaged', $circ, $circ->circ_lib);
+
         return undef;
 
     } else {

Modified: trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql	2009-05-26 12:36:47 UTC (rev 13229)
+++ trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql	2009-05-26 14:03:52 UTC (rev 13230)
@@ -51,6 +51,8 @@
 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES ('format.po.jedi','acqpo','Formats a Purchase Order as a JEDI document',TRUE);
 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES ('format.po.html','acqpo','Formats a Purchase Order as an HTML document',TRUE);
 INSERT INTO action_trigger.hook (key,core_type,description,passive) VALUES ('format.po.pdf','acqpo','Formats a Purchase Order as a PDF document',TRUE);
+INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('damaged','acp','Item marked damaged');
+INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('checkout.damaged','circ','A circulating item is marked damaged and the patron is fined');
 -- and much more, I'm sure
 
 -- Specialized collection modules.  Given an FM object, gather some info and return a scalar or ref.



More information about the open-ils-commits mailing list