From 99095cb94f74b952b705aba51eef7637c391d294 Mon Sep 17 00:00:00 2001
From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Mon, 26 Oct 2009 21:11:18 +0000
Subject: [PATCH] since showing title/auther will be common in predue, overdue,
 billing, etc. notices, provide a helper routine to get the title/author for
 given a copy.  this does the precat dance as well.  Removed the
 get_user_fines_summary helper routine since we can now flesh the 'mus'
 directly on the user

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14612 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 .../OpenILS/Application/Trigger/Reactor.pm         | 35 +++++++++++++++++-----
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
index 6c2fcbb3e2..aa93eb1830 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
@@ -55,19 +55,38 @@ my $_TT_helpers = {
         return $U->get_copy_price(new_editor(), $copy_id);
     },
 
+    # given a copy, returns the title and author in a hash
+    get_copy_bib_basics => sub {
+        my $copy_id = shift;
+        my $copy = new_editor()->retrieve_asset_copy([
+            $copy_id,
+            {
+                flesh => 2,
+                flesh_fields => {
+                    acp => ['call_number'],
+                    acn => ['record']
+                }
+            }
+        ]);
+        if($copy->call_number->id == -1) {
+            return {
+                title => $copy->dummy_title,
+                author => $copy->dummy_author,
+            };
+        } else {
+            my $mvr = $U->record_to_mvr($copy->call_number->record);
+            return {
+                title => $mvr->title,
+                author => $mvr->author
+            };
+        }
+    },
+
     # returns the org unit setting value
     get_org_setting => sub {
         my($org_id, $setting) = @_;
         return $U->ou_ancestor_setting_value($org_id, $setting);
     },
-
-    # returns fines summary information for open transactions
-    get_user_fines_summary => sub {
-        my $user_id = shift;
-        return $U->simplereq(
-            'open-ils.storage', 
-            'open-ils.storage.money.open_user_summary.search', $user_id);
-    }
 };
 
 
-- 
2.11.0