rank_ou() honors pref-lib in non-global context user/berick/expand-rank-ou-func
authorBill Erickson <berick@esilibrary.com>
Thu, 7 Feb 2013 18:43:19 +0000 (13:43 -0500)
committerBill Erickson <berick@esilibrary.com>
Fri, 8 Feb 2013 14:09:45 +0000 (09:09 -0500)
commit2235897037909496c07a9a9a77f76322578b44d1
treeae3a8f0c950a4ecf38f3bd0215fb788f008bfdbc
parent25f8ba16c8825e42c3a154b61b3ee0b0b4a6ab10
rank_ou() honors pref-lib in non-global context

When determining how to sort an org unit (e.g. sorting copies by circ
lib for display in the catalog), allow the pref-lib to affect the sort
order in global and non-global searches.

Org units are now sorted with the following criteria in the following
order.  For example, assume we are sorting a copy circ_lib:

1. circ_lib matches the search_lib
2. circ_lib matches pref_lib
3. distance of circ_lib from pref_lib when pref_lib is a child of
   search_lib, if circ_lib is a child of pref_lib.
   (For example, searching CONS with pref_lib SYS1, items at BR1 will
   sort ahead of items at BR3, since BR1 is a child of the pref_lib).
4. proximity of circ_lib to search_lib, when circ_lib is a child of
   search_lib.
5. In all other cases, circ_lib is sorted to the bottom with the rest of
   the riffraff.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/sql/Pg/990.schema.unapi.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.relax_rank_ou.sql [new file with mode: 0644]