From: Mike Rylander Date: Fri, 2 May 2014 13:10:09 +0000 (-0400) Subject: LP#925776: Recheck located uri visibility X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a61c0c4ff2be9ac1da903f7109a0c90893f88b4f;p=evergreen%2Fpines.git 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 --- 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;