From: Bill Erickson Date: Fri, 7 Aug 2015 15:48:56 +0000 (-0400) Subject: JBAS-769 CHS title/author subfield trimming X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cdebc323b03f0c6162836d5a9586f1366df78cb5;p=working%2FEvergreen.git JBAS-769 CHS title/author subfield trimming Title now shows 245a,b and author is 100a,c Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/opac/extras/circ/alt_holds_print.html b/Open-ILS/web/opac/extras/circ/alt_holds_print.html index 3ad3145415..17d6fb755b 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.html +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.html @@ -98,8 +98,12 @@ ${usr.display_name} ${action} ${hold_type} + + ${title} + ${author} ${current_copy.location.name} ${current_copy.call_number.prefix.label} ${current_copy.call_number.label} ${current_copy.call_number.suffix.label} ${current_copy.barcode} ${current_copy.parts_stringified} diff --git a/Open-ILS/web/opac/extras/circ/alt_holds_print.js b/Open-ILS/web/opac/extras/circ/alt_holds_print.js index 4075a98f86..859754384a 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.js +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.js @@ -214,6 +214,37 @@ function do_clear_holds_from_cache(cache_key) { var hold = hashify_fields(resp.hold_details); hold.action = resp.action; + var xmlDoc = new DOMParser().parseFromString( + hold.current_copy.call_number.record.marc,"text/xml"); + + var m100a = ''; + var m100c = ''; + var m245a = ''; + var m245b = ''; + + dojo.forEach( + xmlDoc.documentElement.getElementsByTagName('datafield'), + function(node) { + var tag = node.getAttribute('tag'); + if (tag == '100') { + dojo.forEach(node.childNodes, function(sub_node) { + var code = sub_node.getAttribute('code'); + if (code == 'a') m100a = sub_node.textContent; + if (code == 'c') m100c = sub_node.textContent; + }); + } else if (tag == '245') { + dojo.forEach(node.childNodes, function(sub_node) { + var code = sub_node.getAttribute('code'); + if (code == 'a') m245a = sub_node.textContent; + if (code == 'b') m245b = sub_node.textContent; + }); + } + } + ); + + hold.author = m100a + ' ' + m100c; + hold.title = m245a + ' ' + m245b; + if(resp.hold_details.hold_type) { hold.hold_type = resp.hold_details.hold_type; } else {