]> git.evergreen-ils.org Git - Evergreen.git/commit
TPAC: Uniform search lib / depth settings
authorDan Scott <dan@coffeecode.net>
Tue, 27 Dec 2011 17:31:03 +0000 (12:31 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Thu, 29 Dec 2011 15:13:34 +0000 (10:13 -0500)
commitea71899306e026bd0c9c91180a0af76a55fbec08
treec73118d2a904d4fafe47b78ba2c6b04ab87567f8
parent67a2606376232fec9d2803a30f146f4176695402
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>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm