From 79c3b38883fda2f10551b09d2ce0926244882c81 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Fri, 5 Aug 2022 14:45:27 +0000 Subject: [PATCH] LP1966995: Bootstrap Opac: fix display of 856 $n, $z, and $3 This fixes the display in the Bootstrap Opac for the 856 subfields n, z, and 3. To test: 1. Create a record(s) with 856 fields which contain a combination of subfield n, z and 3's. 2. Prior to the patch the fields do not display in the bootstrap opac. 3. Apply the patch. 4. The fields will now display. Signed-off-by: Garry Collum Signed-off-by: Carol Witt Signed-off-by: Galen Charlton --- Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 | 8 ++++++-- .../src/templates-bootstrap/opac/parts/record/summary.tt2 | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 index 7e976fd347..d9d7fab5d1 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 @@ -469,9 +469,11 @@ # Extract the 856 URLs that are not otherwise represented by asset.uri's args.online_res = []; FOR node IN xml.findnodes('//*[@tag="856" and @ind1="4" and (@ind2="0" or @ind2="1")]'); - IF node.findnodes('./*[@code="9" or @code="w" or @code="n"]'); NEXT; END; # asset.uri's + IF node.findnodes('./*[@code="9" or @code="w"]'); NEXT; END; # asset.uri's label = node.findnodes('./*[@code="y"]'); - notes = node.findnodes('./*[@code="z" or @code="3"]'); + notes = node.findnodes('./*[@code="z"]'); + access = node.findnodes('./*[@code="n"]'); + materials = node.findnodes('./*[@code="3"]'); FOR href IN node.findnodes('./*[@code="u"]'); NEXT UNLESS href; # it's possible for multiple $u's to exist within 1 856 tag. @@ -482,6 +484,8 @@ href => href.textContent, link => (loop.first AND label) ? label.textContent : href.textContent, note => (loop.first) ? notes.textContent : '' + materials => (loop.first) ? materials.textContent : '' + access => (loop.first) ? access.textContent : '' }); END; END; diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 index 728901c139..679b2f96d2 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 @@ -533,6 +533,8 @@ ctx.metalinks.push(' filtered_href = uri.href | html; filtered_link = uri.link ? uri.link : '' | html; filtered_note = uri.note ? uri.note : '' | html; + filtered_materials = uri.materials ? uri.materials : '' | html; + filtered_access = uri.access ? uri.access : '' | html; -%] [%- IF num_uris == 1 -%]

@@ -547,7 +549,9 @@ ctx.metalinks.push(' END; -%] - [%-# ' - ' _ filtered_note _ '' IF filtered_note %] + [%- '

  • ' _ filtered_note _ '
' IF filtered_note %] + [%- '
  • ' _ filtered_materials _ '
' IF filtered_materials %] + [%- '
  • ' _ filtered_access _ '
' IF filtered_access %] [%- IF attrs.gtin13; ' '; END; %] -- 2.43.2