From 369ca3633869defa0bf6d1becb15cda282f344b0 Mon Sep 17 00:00:00 2001 From: Bradley Bonner Date: Wed, 29 Aug 2018 13:39:23 -0700 Subject: [PATCH] JBAS-2096 implement hiding for stat cat ""Hidden in BiblioCommons" As discussed in JBAS-2096, this change adds item opac_visible logic changes to support the newly added "Hidden in BiblioCommons" stat cat. Bradley Bonner bbonner@kcls.org --- KCLS/utility-scripts/bc_missing/bc_missing.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/KCLS/utility-scripts/bc_missing/bc_missing.sql b/KCLS/utility-scripts/bc_missing/bc_missing.sql index c846cbeb22..3c0ceb5d48 100644 --- a/KCLS/utility-scripts/bc_missing/bc_missing.sql +++ b/KCLS/utility-scripts/bc_missing/bc_missing.sql @@ -38,6 +38,23 @@ UPDATE asset.copy 'Generic' , 'Normandy Park' , 'Choice Reads', 'Lucky Day', 'Book Club' ) ); + + -- hiding by stat cat (hidden in bibliocommons) + +UPDATE asset.copy + SET (edit_date, opac_visible) = (now(), 'f') + WHERE id IN + ( + SELECT + asset."copy"."id" + FROM + asset."copy" + INNER JOIN asset.stat_cat_entry_copy_map ON asset."copy"."id" = asset.stat_cat_entry_copy_map.owning_copy + WHERE + asset.stat_cat_entry_copy_map.stat_cat = 6 + and asset.copy.deleted = 'f' + and asset.copy.opac_visible = 't' + ); -- make the items that should be visible again as they become some -- kind of "available", but still following our business rules @@ -51,6 +68,7 @@ UPDATE asset.copy ON asset.copy.location = asset.copy_location.id INNER JOIN config.i18n_core ON cast(config.i18n_core.identity_value as integer) = asset.copy_location.id + LEFT OUTER JOIN asset.stat_cat_entry_copy_map ON asset."copy"."id" = asset.stat_cat_entry_copy_map.owning_copy WHERE asset.copy.deleted = 'f' AND asset.copy.opac_visible = 'f' AND asset.copy.status IN ('0', '1', '6', '7', '8') @@ -66,6 +84,7 @@ UPDATE asset.copy 'KidReach' , 'Tech Lab' , 'Storage' , 'Teen Materials' , 'Generic' , 'Normandy Park' , 'Choice Reads', 'Lucky Day', 'Book Club' ) AND floating IS NULL + AND (stat_cat is null or stat_cat != 6) ); -- 2.11.0