added some report fleshing
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 21:35:29 +0000 (21:35 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 21:35:29 +0000 (21:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6253 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm

index f241804..da2a573 100644 (file)
@@ -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");
index 4c2fce9..7b87de6 100644 (file)
@@ -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]); 
 }