From 3e7be71b4d143cd34b1efcd567076a0db5953744 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 2 May 2014 09:10:09 -0400 Subject: [PATCH] LP#925776: Recheck located uri visibility Previous to this commit, once we have determined that there are no local Located URIs or foreign copies, we include the record in the result set in the staff client. However, the desire of library staff is that foreign Located URIs be valid as a visibility limiter. So we now recheck at the end for that situation. This honors the new "Located URIs act like copies" global flag. Signed-off-by: Mike Rylander Signed-off-by: Ben Shum --- Open-ILS/src/sql/Pg/300.schema.staged_search.sql | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql index 5b5774d436..5907e05218 100644 --- a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql +++ b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql @@ -327,7 +327,25 @@ BEGIN AND NOT cp.deleted LIMIT 1; - IF FOUND THEN + IF NOT FOUND THEN + -- Recheck Located URI visibility in the case of no "foreign" copies + PERFORM 1 + FROM asset.call_number cn + JOIN asset.uri_call_number_map map ON (map.call_number = cn.id) + JOIN asset.uri uri ON (map.uri = uri.id) + WHERE NOT cn.deleted + AND cn.label = '##URI##' + AND uri.active + AND cn.record IN ( SELECT * FROM unnest( core_result.records ) ) + AND cn.owning_lib NOT IN ( SELECT * FROM unnest( luri_org_list ) ) + LIMIT 1; + + IF FOUND THEN + -- RAISE NOTICE ' % were excluded for foreign located URIs... ', core_result.records; + excluded_count := excluded_count + 1; + CONTINUE; + END IF; + ELSE -- RAISE NOTICE ' % and multi-home linked records were all visibility-excluded ... ', core_result.records; excluded_count := excluded_count + 1; CONTINUE; -- 2.11.0