updated folder retrieval to fetch shared folders that the requestor
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 13:30:14 +0000 (13:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 28 Sep 2006 13:30:14 +0000 (13:30 +0000)
is within range of

git-svn-id: svn://svn.open-ils.org/ILS/trunk@6247 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 36ff88b..4c2fce9 100644 (file)
@@ -43,8 +43,16 @@ sub retrieve_visible_folders {
        my $meth = "search_reporter_${type}_folder";
        my $fs = $e->$meth( { owner => $e->requestor->id } );
 
-       # XXX fetch folders visible to me
-
+       my @orgs;
+       my $oid = $e->requestor->ws_ou; 
+       while( my ($o) = $U->fetch_org_unit($oid) ) {
+               last unless $o;
+               push( @orgs, $o->id );
+               $oid = $o->parent_ou;
+       }
+
+       my $fs2 = $e->$meth({shared => 't', share_with => \@orgs});
+       push( @$fs, @$fs2);
        return $fs;
 }