From 2901146c94be894dd5dbbd52921e783852e45ba1 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 28 Sep 2006 21:35:29 +0000 Subject: [PATCH] added some report fleshing git-svn-id: svn://svn.open-ils.org/ILS/trunk@6253 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 1 + Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index f2418044ae..da2a573fc9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -705,6 +705,7 @@ sub fetch_callnumber { my %ORG_CACHE; # - these rarely change, so cache them.. sub fetch_org_unit { my( $self, $id ) = @_; + return undef unless $id; return $id if( ref($id) eq 'Fieldmapper::actor::org_unit' ); return $ORG_CACHE{$id} if $ORG_CACHE{$id}; $logger->debug("Fetching org unit $id"); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm b/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm index 4c2fce9631..7b87de6f57 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm @@ -40,8 +40,12 @@ sub retrieve_visible_folders { return $e->event unless $e->checkauth; return $e->event unless $e->allowed('RUN_REPORTS'); + my $class = 'rrf'; + $class = 'rtf' if $type eq 'template'; + my $flesh = {flesh => 1,flesh_fields => { $class => ['owner', 'share_with']}}; + my $meth = "search_reporter_${type}_folder"; - my $fs = $e->$meth( { owner => $e->requestor->id } ); + my $fs = $e->$meth( [{ owner => $e->requestor->id }, $flesh] ); my @orgs; my $oid = $e->requestor->ws_ou; @@ -51,7 +55,7 @@ sub retrieve_visible_folders { $oid = $o->parent_ou; } - my $fs2 = $e->$meth({shared => 't', share_with => \@orgs}); + my $fs2 = $e->$meth([{shared => 't', share_with => \@orgs}, $flesh]); push( @$fs, @$fs2); return $fs; } @@ -69,7 +73,10 @@ sub retrieve_folder_data { return $e->event unless $e->checkauth; return $e->event unless $e->allowed('RUN_REPORTS'); my $meth = "search_reporter_${type}"; - return $e->$meth( { folder => $folderid } ); + my $class = 'rr'; + $class = 'rt' if $type eq 'template'; + my $flesh = {flesh => 1,flesh_fields => { $class => ['owner']}}; + return $e->$meth([{ folder => $folderid }, $flesh]); } -- 2.11.0