From: miker Date: Sun, 16 Dec 2007 19:36:40 +0000 (+0000) Subject: add root ou to the search X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=551c2ee2c20c9edd654a216f740a78aa0a3982d6;p=Evergreen.git add root ou to the search git-svn-id: svn://svn.open-ils.org/ILS/trunk@8224 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index ec6afc3050..8942a6dcee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -537,8 +537,15 @@ sub cat_search_z_style_wrapper { my $authtoken = shift; my $args = shift; + my $cstore = OpenSRF::AppSession->connect('open-ils.cstore'); + + my $ou = $cstore->request( + 'open-ils.cstore.direct.actor.org_unit.search', + { parent_ou => undef } + )->gather(1); + my $result = { service => 'native-evergreen-catalog', records => [] }; - my $searchhash = { limit => $$args{limit}, offset => $$args{offset}}; + my $searchhash = { limit => $$args{limit}, offset => $$args{offset}, org_unit => $ou->id }; $$searchhash{searches}{title} = $$args{search}{title}; $$searchhash{searches}{author} = $$args{search}{author}; @@ -555,7 +562,6 @@ sub cat_search_z_style_wrapper { if ($list->{count} > 0) { $result->{count} = $list->{count}; - my $cstore = OpenSRF::AppSession->connect('open-ils.cstore'); my $records = $cstore->request( 'open-ils.cstore.direct.biblio.record_entry.search.atomic', { id => [ map { ( $_->[0] ) } @{$list->{ids}} ] }