From ea71899306e026bd0c9c91180a0af76a55fbec08 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 27 Dec 2011 12:31:03 -0500 Subject: [PATCH] TPAC: Uniform search lib / depth settings The current TPAC code uses logic embedded within the templates to determine which org unit and depth to apply to searches. This commit attempts to standardize the logic within the new OpenILS::WWWW::EGCatLoader::Util::_get_search_lib() function and sets the result as a new context variable, "search_ou". The org unit is determined as follows (first matching condition wins): * specific CGI "loc" value * logged-in user's preferred search library * logged-in user's home org unit * specific CGI "physical_loc" value The depth is set as follows (first matching condition wins): * specific CGI "depth" value * depth of the chosen org_unit As of this commit, a library that wishes to set the a default search org unit for any given user should set the "physical_loc" CGI param; after the user performs their first search, the "loc" CGI param will propagate through most interfaces. When a user clicks "Your account log in", the user's preferred search library or home org unit will be set as the new search lib. At any time after that, the user can select a different org unit from the org unit selector to explicitly set the "loc" CGI param. Signed-off-by: Dan Scott Signed-off-by: Jason Stephenson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index 6e74628a9a..7fa671d96e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -124,6 +124,8 @@ sub _prepare_biblio_search { $depth = $org->ou_type->depth; } $query .= " depth($depth)"; + } else { + $depth = $ctx->{get_aou}->($org)->ou_type->depth; } $logger->info("tpac: site=$site, depth=$depth, query=$query"); -- 2.43.2