From a4422f759a81e938e49fd59b2e8c6af999347725 Mon Sep 17 00:00:00 2001 From: Liam Whalen Date: Tue, 16 Jul 2013 17:23:57 -0700 Subject: [PATCH] LP#1441714 Remove 'NO COPIES' in Staff Client When a record has only OPAC invisible items attached to it, the TPAC displays a 'NO COPIES' message in the staff client. This fix skips the check for opac visible items when the staff client is being used. This can result in incomplete information being displayed in the summary of the available items because opac invisible items are often incomplete and do not have shelving locations or libraries assigned to them. This fix checks for ctx.is_staff in a number of lines. This results in holdings being excluded only if the copy is not visible and the ctx.is_staff variable is not set. Signed-off-by: Liam Whalen --- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 0af121c4e5..f34d1ff9f6 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -495,7 +495,7 @@ # Check copy visibility cp.deleted = copy.getAttribute('deleted'); cp.visible = copy.getAttribute('opac_visible'); - NEXT IF (cp.deleted == 'true' OR cp.visible == 'false'); + NEXT IF (cp.deleted == 'true' OR (cp.visible == 'false' AND !(ctx.is_staff))); # Iterate through all of the children to determine visibility FOR node IN cp.childNodes; @@ -507,16 +507,16 @@ END; END; - NEXT IF cp.visible == 'false'; + NEXT IF (cp.visible == 'false' AND !(ctx.is_staff)); loc = copy.findnodes('./*[local-name()="location"]'); - NEXT IF loc.getAttribute('opac_visible') == 'false'; + NEXT IF (loc.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff)); circlib = copy.findnodes('./*[local-name()="circlib"]'); - NEXT IF circlib.getAttribute('opac_visible') == 'false'; + NEXT IF (circlib.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff)); status = copy.findnodes('./*[local-name()="status"]'); - NEXT IF status.getAttribute('opac_visible') == 'false'; + NEXT IF (status.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff)); # extract the circ_lib id from the circ_lib node circ_lib = copy.findnodes('./*[local-name()="circ_lib"]'); -- 2.11.0