From: Adam Bowling Date: Tue, 27 Jan 2015 21:27:43 +0000 (-0500) Subject: Currently, items marked opac_visible = 'f' will not X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fabowling%2Flp1403913_items_visible_staff_client;p=working%2FEvergreen.git Currently, items marked opac_visible = 'f' will not appear for staff members in the staff client. This patch corrects that by allowing items marked invisible to show up in the copy and volume sections of the staff client while still remaining invisible in the TPAC. Signed-off-by: Adam Bowling --- diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index b4bf194d6c..fddf65dcd3 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -87,6 +87,10 @@ # get_marc_attrs( { marc_xml => doc } ) BLOCK get_marc_attrs; xml = args.marc_xml; + is_staff = 'false'; + IF ctx.is_staff; + is_staff = 'true'; + END; # Map item types to schema.org types; impedance mismatch :( args.schema.itemtype = {}; @@ -431,7 +435,7 @@ END; vol.id = volume.getAttribute('id'); - NEXT IF volume.getAttribute('opac_visible') == 'false'; + NEXT IF volume.getAttribute('opac_visible') == 'false' && is_staff = 'false'; NEXT IF volume.getAttribute('deleted') == 'true'; IF vol.label == '##URI##'; @@ -457,14 +461,22 @@ LAST IF part_label != ''; END; # Check copy visibility - cp.deleted = copy.getAttribute('deleted'); - cp.visible = copy.getAttribute('opac_visible'); + cp.deleted = copy.getAttribute('deleted'); + IF is_staff == 'true'; + cp.visible = 'true'; + ELSE; + cp.visible = copy.getAttribute('opac_visible'); + END; NEXT IF (cp.deleted == 'true' OR cp.visible == 'false'); # Iterate through all of the children to determine visibility FOR node IN cp.childNodes; NEXT IF cp.visible == 'false'; - vis = node.getAttribute('opac_visible'); + IF is_staff == 'true'; + vis = 'true'; + ELSE; + vis = node.getAttribute('opac_visible'); + END; del = node.getAttribute('deleted'); IF vis == 'false' or del == 'true'; cp.visible = 'false'; @@ -474,13 +486,13 @@ NEXT IF cp.visible == 'false'; loc = copy.findnodes('./*[local-name()="location"]'); - NEXT IF loc.getAttribute('opac_visible') == 'false'; + NEXT IF loc.getAttribute('opac_visible') == 'false' && is_staff == 'false'; circlib = copy.findnodes('./*[local-name()="circlib"]'); - NEXT IF circlib.getAttribute('opac_visible') == 'false'; + NEXT IF circlib.getAttribute('opac_visible') == 'false' && is_staff == 'false'; status = copy.findnodes('./*[local-name()="status"]'); - NEXT IF status.getAttribute('opac_visible') == 'false'; + NEXT IF status.getAttribute('opac_visible') == 'false' && is_staff == 'false'; # extract the circ_lib id from the circ_lib node circ_lib = copy.findnodes('./*[local-name()="circ_lib"]'); @@ -541,7 +553,7 @@ FOR node IN xml.findnodes(formats_xpath); IF node AND node.textContent; ccvm = ctx.get_ccvm(node.getAttribute('cvmid')); - NEXT IF ccvm.opac_visible == 'f'; + NEXT IF ccvm.opac_visible == 'f' && is_staff == 'false'; format = {}; type = ccvm.code.remove('-'); # blu-ray to bluray