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");
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;
$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;
}
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]);
}