From 976b9a9eae2343e0557592ff10c00c308dc6b530 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 19 Feb 2013 11:42:08 -0500 Subject: [PATCH 1/1] QueryParser: Check for URIs in staff visibility Specifically, don't show staff records with no copies but with URIs unless the URIs are "in scope". Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum --- .../Application/Storage/Driver/Pg/QueryParser.pm | 10 ++++++++++ 1 file changed, 10 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 ff33c237f8..e11aa0d4a9 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 @@ -903,6 +903,16 @@ sub toSQL { AND pr.peer_record = m.source LIMIT 1 ) + AND + NOT EXISTS( + SELECT 1 FROM asset.call_number acn + JOIN asset.uri_call_number_map aucnm ON acn.id = aucnm.call_number + JOIN asset.uri uri ON aucnm.uri = uri.id + WHERE NOT acn.deleted + AND uri.active + AND acn.record = m.source + LIMIT 1 + ) ) SQL } else { -- 2.43.2