TPAC: Respect location visibility for result copies user/dbs/tpac_location_visibility
authorDan Scott <dscott@laurentian.ca>
Thu, 11 Oct 2012 05:43:01 +0000 (01:43 -0400)
committerDan Scott <dscott@laurentian.ca>
Thu, 11 Oct 2012 16:12:28 +0000 (12:12 -0400)
Robert Soulliere noted in LP# 1062502 that copies in a location marked
"opac_visible = FALSE" were erroneously being displayed in search
results. This would occur if at least one copy on a record was in a
visible location, but other copies were in an invisible location.

This commit prevents copies in hidden locations from being displayed,
and also adds guards for the visibility of the copy status and the
circulation library.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 45d3f54..c188e97 100644 (file)
                     NEXT IF cp.visible == 'false';
                     
                     loc = copy.findnodes('./*[local-name()="location"]');
+                    NEXT IF loc.getAttribute('opac_visible') == 'false';
+
                     circlib = copy.findnodes('./*[local-name()="circlib"]');
+                    NEXT IF circlib.getAttribute('opac_visible') == 'false';
+
                     status = copy.findnodes('./*[local-name()="status"]');
+                    NEXT IF status.getAttribute('opac_visible') == 'false';
 
                     holding = {
                         label => vol.label,