From 5aa5e26f4053e7193f7cf8f9b6845f027ce34917 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 11 Sep 2012 09:48:39 -0400 Subject: [PATCH] Add bib_source filter Because it would likely be very useful, if only for staff. Signed-off-by: Thomas Berezansky Signed-off-by: Lebbeous Fogle-Weekley --- .../OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index 8a13776ef5..9ddb169b48 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -499,6 +499,7 @@ __PACKAGE__->add_search_filter( 'during' ); __PACKAGE__->add_search_filter( 'statuses' ); __PACKAGE__->add_search_filter( 'locations' ); __PACKAGE__->add_search_filter( 'location_groups', sub { return __PACKAGE__->location_groups_callback(@_) } ); +__PACKAGE__->add_search_filter( 'bib_source' ); __PACKAGE__->add_search_filter( 'site' ); __PACKAGE__->add_search_filter( 'pref_ou' ); __PACKAGE__->add_search_filter( 'lasso' ); @@ -1092,6 +1093,12 @@ sub flatten { $where .= "${NOT}EXISTS(SELECT 1 FROM biblio.peer_bib_copy_map pr JOIN asset.copy acp ON pr.target_copy = acp.id WHERE m.source = pr.peer_record AND acp.circ_lib IN (SELECT * FROM search_org_list) AND NOT acp.deleted AND acp.status IN (" . join(',', map { $self->QueryParser->quote_value($_) } @{ $filter->args }) . ") LIMIT 1))"; } } + case 'bib_source' { + if (@{$filter->args} > 0) { + $where .= $joiner if $where ne '('; + $where .= "bre.source IN (" . join(',', map { $self->QueryParser->quote_value($_) } @{ $filter->args }) . ")"; + } + } } } } -- 2.43.2