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 <dan@coffeecode.net>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>