From: Josh Stompro Date: Wed, 23 Oct 2019 14:23:37 +0000 (-0500) Subject: LP#1849497 - Hide specific org units from staff search results. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fstompro%2Flp1849497_hide_ou_staff_search;p=working%2FEvergreen.git LP#1849497 - Hide specific org units from staff search results. Hard coded example of removing certain org units. Signed-off-by: Josh Stompro --- 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 950a081b63..10fb6ca8a5 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 @@ -1469,6 +1469,14 @@ sub flatten { } unflesh_parents($ot); + #staff shouldn't see ILL copies unless searching ILL sites + if ($self->find_modifier('staff') and ($site_org->id != 138 and $site_org->id != 140)) { + $logger->debug('removing ill orgs from search for staff Before: '.Dumper($dorgs)); + # remove 138 or 140 from dorgs + $dorgs = [ map /(138|140)/ ? () : $_, @$dorgs ]; + $logger->debug('removing ill orgs from search for staff After: '.Dumper($dorgs)); + } + push @{$vis_filter{'c_attr'}}, "search.calculate_visibility_attribute_test('circ_lib','{".join(',', @$dorgs)."}',$negate)";