# 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 = {};
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##';
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';
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"]');
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