[open-ils-commits] r9094 - trunk/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 19 23:24:38 EDT 2008
Author: miker
Date: 2008-03-19 22:50:12 -0400 (Wed, 19 Mar 2008)
New Revision: 9094
Modified:
trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Log:
adding extra staff checks for record visibility
Modified: trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-03-20 01:40:49 UTC (rev 9093)
+++ trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-03-20 02:50:12 UTC (rev 9094)
@@ -437,6 +437,35 @@
CONTINUE;
END IF;
+ ELSE
+
+ PERFORM 1
+ FROM asset.call_number cn
+ JOIN asset.copy cp ON (cp.call_number = cn.id)
+ JOIN actor.org_unit a ON (cp.circ_lib = a.id)
+ JOIN asset.copy_location cl ON (cp.location = cl.id)
+ JOIN config.copy_status cs ON (cp.status = cs.id)
+ WHERE NOT cn.deleted
+ AND NOT cp.deleted
+ AND cp.circ_lib IN ( SELECT * FROM search.explode_array( search_org_list ) )
+ AND cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+ LIMIT 1;
+
+ IF NOT FOUND THEN
+
+ PERFORM 1
+ FROM asset.call_number cn
+ WHERE cn.record IN ( SELECT * FROM search.explode_array( core_result.records ) )
+ LIMIT 1;
+
+ IF FOUND THEN
+ -- RAISE NOTICE ' % were all visibility-excluded ... ', core_result.records;
+ excluded_count := excluded_count + 1;
+ CONTINUE;
+ END IF;
+
+ END IF;
+
END IF;
visible_count := visible_count + 1;
More information about the open-ils-commits
mailing list