Pickup up hold for other patron
authorDan Pearl <dpearl@cwmars.org>
Tue, 24 Jan 2017 18:59:01 +0000 (13:59 -0500)
committerDan Pearl <dpearl@cwmars.org>
Wed, 1 Mar 2017 19:49:27 +0000 (14:49 -0500)
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 7dd3611..0dcc782 100644 (file)
@@ -864,9 +864,25 @@ sub check_captured_holds {
         return undef;
     }
 
+    /* Get fleshed version of hold so we can grab name of requestor */
+    $hold = $self->editor->retrieve_action_hold_request(
+        [
+            $hold->id,
+            {
+                flesh => 1,
+                flesh_fields => { ahr => [ 'usr' ] }
+            }
+        ]
+    
     $logger->info("circulator: this copy is needed by a different patron to fulfill a hold");
 
-    $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF'));
+    my $user = $hold->usr;
+
+    $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF',
+           { payload => { hold => $hold->id,
+                          patron_name = $user->first_given_name. ' '.
+                                        $user->family_name
+           ));
 }