[OPEN-ILS-DEV] Sorting by distance in the OPAC

Paul Waak ptwaak at gmail.com
Tue Jul 14 16:13:24 EDT 2009


I have worked out the back end for sorting the holdings in the OPAC by  
physical distance from a location.  The idea here is to let the OPAC  
in a library display the holdings of other libraries in the system  
according to how far an anonymous user would have to drive to get it  
right away, independent of administrative organization.  Presumably,  
the library can just add ol=<id> to the OPAC URL to trigger this  
behavior.

In the OPAC, I am looking at changing rdetail.js in the default skin  
so the holdings list will be sorted by distance if:

a global called rdetailSortDistance is true AND
getOrigLocation() != globalOrgTree.id() AND
findOrgType(getOrigLocation().ou_type()).can_have_vols()

If any of these conditions are false, then the standard display applies.

If all three conditions are true, then the holdings are sorted by the  
distance of the copy's circ_lib from getOrigLocation().

Is this in line with how getOrigLocation() was meant to be used?  Or  
does the value represent something other than what I am thinking?  I  
am modifying release 1.4.0.4, in case that affects the answer.

Thanks,
Paul

Paul Waak
pwaak at yahoo.com





More information about the Open-ils-dev mailing list