From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 15 Jan 2010 21:06:00 +0000 (+0000)
Subject: Patch from Dan Wells to make the results returned when using in-db circ look more... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e8a168bc2ab60d51dadc248fab4964519eec2132;p=evergreen%2Fpines.git

Patch from Dan Wells to make the results returned when using in-db circ look more like those of the legacy circ scripts.  For more details plus DCO, see libmail.georgialibraries.org/pipermail/open-ils-dev/2010-January/005703.html

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15328 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
index bf7a14c5e8..e2d8ac86ff 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
@@ -634,7 +634,7 @@ sub mk_env {
         my $copy;
 	    my $flesh = { 
 		    flesh => 2, 
-		    flesh_fields => {acp => ['call_number'], acn => ['record']} 
+		    flesh_fields => {acp => ['location', 'status', 'circ_lib', 'age_protect', 'call_number'], acn => ['record']}
 	    };
 	    if($self->copy_id) {
 		    $copy = $e->retrieve_asset_copy(
@@ -1005,6 +1005,11 @@ sub run_patron_permit_scripts {
         push(@allevents, OpenILS::Event->new($_)) for (@$patron_events);
     }
 
+    for (@allevents) {
+       $_->{payload} = $self->copy if 
+             ($_->{textcode} eq 'COPY_NOT_AVAILABLE');
+    }
+
     $logger->info("circulator: permit_patron script returned events: @allevents") if @allevents;
 
     $self->push_events(@allevents);