From: Ben Shum Date: Fri, 6 Jun 2014 19:01:40 +0000 (-0400) Subject: LP#1102739: Terrible hackery to only show 800t for the summary links X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6eaf80c7026ae4f16b40333ea2378f9fe6088bb8;p=working%2FEvergreen.git LP#1102739: Terrible hackery to only show 800t for the summary links Looking for more ideas here, but showing one example. Also, untested with 880 graphic linking with subfield 6, not sure what consequences there would be. Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/record/series.tt2 b/Open-ILS/src/templates/opac/parts/record/series.tt2 index 951823215d..2891ad7a7f 100644 --- a/Open-ILS/src/templates/opac/parts/record/series.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/series.tt2 @@ -1,5 +1,6 @@ [%- - series_tags = ['440', '490', '800', '810', '811', '830', '694']; + series_tags = ['440', '490', '810', '811', '830', '694']; + title_series_tags = ['800']; loc = ctx.search_ou; BLOCK render_series; @@ -35,6 +36,37 @@ BLOCK render_series; results.push(series); END; END; + FOR tag IN title_series_tags; + FOR node IN ctx.marc_xml.findnodes('//*[@tag="' _ tag _ '"]'); + all_terms = []; + graphics = []; + series = ''; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + IF code == '6'; + linked_fields = [subfield.textContent()]; + target_field = node.getAttribute('tag'); + get_linked_880s; + END; + NEXT UNLESS code.match('[t]'); + # at this point, we actually have a partial term to use. + single_term = subfield.textContent | html; + all_terms.push(subfield.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', '')); + total_term = all_terms.join(" ").replace('\s+$', ''); + + url = mkurl(ctx.opac_root _ '/results', + { qtype=>'series', query=>total_term }, stop_parms.merge(expert_search_parms, general_search_parms) + ); + series = series _ '' _ single_term _ ' '; + END; + FOREACH link880 IN graphics; + link = link880.value | html; + series = series _ '
' _ link _ '
'; + END; + results.push(series); + END; + END; FOR entry IN results; -%]
  • [% entry %]