add shelving location filter support
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jul 2008 01:13:10 +0000 (01:13 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jul 2008 01:13:10 +0000 (01:13 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10063 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm

index f894220..cb61493 100644 (file)
@@ -2321,7 +2321,7 @@ sub staged_fts {
                die "No search arguments were passed to ".$self->api_name;
        }
 
-       my (@statuses,@types,@forms,@lang,@aud,@lit_form,@vformats);
+       my (@statuses,@locations,@types,@forms,@lang,@aud,@lit_form,@vformats);
 
        if ($args{available}) {
                @statuses = (0,7);
@@ -2332,6 +2332,11 @@ sub staged_fts {
                @statuses = @$s;
        }
 
+    if (my $s = $args{locations}) {
+        $s = [$s] if (!ref($s));
+        @locations = @$s;
+    }
+
        if (my $a = $args{audience}) {
                $a = [$a] if (!ref($a));
                @aud = @$a;
@@ -2414,6 +2419,7 @@ sub staged_fts {
        my $param_depth = $args{depth}; $param_depth = 'NULL' unless (defined($param_depth) and length($param_depth) > 0 );
        my $param_searches = OpenSRF::Utils::JSON->perl2JSON( \%stored_proc_search_args ); $param_searches =~ s/\$//go; $param_searches = '$$'.$param_searches.'$$';
        my $param_statuses = '$${' . join(',', map { s/\$//go; "\"$_\""} @statuses) . '}$$';
+       my $param_locations = '$${' . join(',', map { s/\$//go; "\"$_\""} @locations) . '}$$';
        my $param_audience = '$${' . join(',', map { s/\$//go; "\"$_\"" } @aud) . '}$$';
        my $param_language = '$${' . join(',', map { s/\$//go; "\"$_\""} @lang) . '}$$';
        my $param_lit_form = '$${' . join(',', map { s/\$//go; "\"$_\"" } @lit_form) . '}$$';
@@ -2437,6 +2443,7 @@ sub staged_fts {
                     $param_depth,
                     $param_searches,
                     $param_statuses,
+                    $param_locations,
                     $param_audience,
                     $param_language,
                     $param_lit_form,