[open-ils-commits] r14612 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Oct 26 17:11:24 EDT 2009
Author: erickson
Date: 2009-10-26 17:11:18 -0400 (Mon, 26 Oct 2009)
New Revision: 14612
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
Log:
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
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm 2009-10-26 16:43:12 UTC (rev 14611)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm 2009-10-26 21:11:18 UTC (rev 14612)
@@ -55,19 +55,38 @@
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);
- }
};
More information about the open-ils-commits
mailing list