[open-ils-commits] r14104 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 22 17:09:52 EDT 2009


Author: erickson
Date: 2009-09-22 17:09:46 -0400 (Tue, 22 Sep 2009)
New Revision: 14104

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
When a hold has gone around the org-unit loop (if configured) X number of times without finding a copy and is subsequently cancelled, set the cancel cause value and tell the notification innards to react as necessary (e.g. send the patron an email)

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-09-22 20:56:16 UTC (rev 14103)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-09-22 21:09:46 UTC (rev 14104)
@@ -1121,9 +1121,17 @@
 						# We have, and should remove potentials and cancel the hold
 						my @oldmaps = action::hold_copy_map->search( hold => $hold->id );
 						$_->delete for (@oldmaps);
-	
-						$hold->update( { cancel_time => 'now' } );
+
+						# cancel cause = un-targeted expiration
+						$hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
 						$self->method_lookup('open-ils.storage.transaction.commit')->run;
+
+						# tell A/T the hold was cancelled
+						my $fm_hold = $hold->to_fieldmapper;
+						my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+						$ses->request('open-ils.trigger.event.autocreate', 
+							'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
+
 						die "OK\n";
 					}
 				}



More information about the open-ils-commits mailing list