LP1966995: Bootstrap Opac: fix display of 856 $n, $z, and $3
authorGarry Collum <gcollum@gmail.com>
Fri, 5 Aug 2022 14:45:27 +0000 (14:45 +0000)
committerGalen Charlton <gmc@equinoxOLI.org>
Sat, 28 Jan 2023 20:07:27 +0000 (15:07 -0500)
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 <gcollum@gmail.com>
Signed-off-by: Carol Witt <wittc@cwmars.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2

index 7e976fd..d9d7fab 100755 (executable)
         # 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.
                     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;
index 728901c..679b2f9 100755 (executable)
@@ -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 -%]
                 <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
@@ -547,7 +549,9 @@ ctx.metalinks.push('
                             END;
                             -%]
                         </a>
-                        [%-# ' - <span property="description">' _ filtered_note _ '</span>' IF filtered_note %]
+                        [%- '<ul><li property="description">' _ filtered_note _ '</li></ul>' IF filtered_note %]
+                        [%- '<ul><li property="description">' _ filtered_materials _ '</li></ul>' IF filtered_materials %]
+                        [%- '<ul><li property="description">' _ filtered_access _ '</li></ul>' IF filtered_access %]
                         <link property="availability" href="http://schema.org/OnlineOnly" />
                         [%- IF attrs.gtin13; '
                         <meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]