]> git.evergreen-ils.org Git - working/Evergreen.git/commit - Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
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)
commitd04e4cea8ffbd0e9e9ab5bb11fa6e4b60c3443c5
treecc962b2ad0e9daee6dde565d75842de261901fa2
parentf49146ec6b6c0e54056a911a0f21e2d5c80a38b5
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.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
Open-ILS/src/templates/opac/parts/advanced/search.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2