[open-ils-commits] r16041 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 29 16:36:11 EDT 2010
Author: phasefx
Date: 2010-03-29 16:36:06 -0400 (Mon, 29 Mar 2010)
New Revision: 16041
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
Log:
create acq.created and acq.rejected events
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-03-29 20:35:38 UTC (rev 16040)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-03-29 20:36:06 UTC (rev 16041)
@@ -2639,6 +2639,7 @@
if ( $cancel_reason ) {
$aur_obj->cancel_reason( $cancel_reason );
$e->update_acq_user_request($aur_obj) or return $e->die_event;
+ create_user_request_events( [ $aur_obj ], 'aur.rejected' );
} else {
$e->delete_acq_user_request($aur_obj);
}
@@ -2707,10 +2708,27 @@
$e->commit;
+ create_user_request_events( [ $aur_obj ], 'aur.created' );
+
return $aur_obj;
}
+sub create_user_request_events {
+ my($user_reqs, $hook) = @_;
+ my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+ $ses->connect;
+
+ for my $user_req (@$user_reqs) {
+ my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $user_req, $user_req->usr->home_ou);
+ $req->recv;
+ }
+
+ $ses->disconnect;
+ return undef;
+}
+
+
__PACKAGE__->register_method(
method => "po_note_CUD_batch",
api_name => "open-ils.acq.po_note.cud.batch",
More information about the open-ils-commits
mailing list