TPAC: Set search library and depth consistently

Bug #909098 reported by Dan Scott
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

* Evergreen master

Make the TPAC behave more like the JSPAC with respect to a logged-in users's preferred search library or home library.

Also simplify the user's need to understand both "org unit depth" and "org unit" concepts when selecting search scope by simply setting the default depth equal to the chosen org_unit. The CGI "depth" param can still be used to set a specific search depth for custom skins, etc.

From the first commit to user/dbs/tpac_user_ou_pref in the working repository:

   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.

Tags: pullrequest
Revision history for this message
Dan Scott (denials) wrote :

Pushed a few more commits onto the branch - first to sync up with master and resolve a conflict that arose from the merge of LP# 909111, and second to handle a few remaining cases in which the search_ou context variable was not being set correctly (for example, My Account -> Circs / My Account -> Holds).

Changed in evergreen:
milestone: none → 2.2.0alpha2
tags: added: pullrequest
Revision history for this message
Dan Scott (denials) wrote :

Pushed one more commit onto the branch to add the "Preferred search location" preference to the "Account preferences" -> "Search preferences" pane of the TPAC.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Rebased, signed off and pushed to <email address hidden>:working/Evergreen.git
 * [new branch] tpac_user_ou_pref -> collab/dyrcona/tpac_user_ou_pref

Revision history for this message
Dan Scott (denials) wrote :

Pushed to master. Thanks Jason!

Changed in evergreen:
status: New → Fix Committed
Revision history for this message
Kathy Lussier (klussier) wrote :

Thanks Dan! This looks good.

Looking at the order in which the system checks parameters to determine the search ou, it looks like the preferred library and home library might also serve the purpose of identifying which library's holdings should appear first in a list of items (once that work is complete) without necessarily setting the search scope.

We have at least one consortium that likes the idea of NOT setting the search scope with this parameter because home users are often more likely to search the entire consortium and then narrow if they need to. It looks like we can support this by identifying "1" as the value for loc parameter in whichever way we link to the catalog. Even after the patron logs in, the system will continue to search the consortium since the loc parameter is the first matching condition.

Given that we can support this level of flexibility, would it make more sense for the account preferences label to be more generic, maybe something like "preferred library"? Each system could then define what preferred library means for their users.

Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.