From b3b634538d9124d6f4897257ba5f32ae44d5c936 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Fri, 10 May 2013 12:42:24 -0400 Subject: [PATCH] TPAC: Avoid showing URIs from 856 if we have OpenURL results There is already a lot of logic to deduplicate OpenURL results versus URIs in 856 fields, but in practice URIs in 856s tend to be subject to bitrot, while SFX generally should be trustworthy. Thus, don't generate electronic resources for 856s if we have OpenURL results. Another optimization might be to hide the 856 results in case SFX is wrong, then give users the ability to show them, but that might be something we only want to enable in the staff client... Signed-off-by: Dan Scott --- Open-ILS/src/templates/opac/parts/record/summary.tt2 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index d5aacb4ccc..afa542a7fd 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -109,9 +109,11 @@ [%- END %] [%- END %] -[%- merged_uris = args.uris.merge(args.online_res); -num_uris = merged_uris.size; -IF num_uris > 0; +[%- # Avoid showing URLs from 856 fields if we have OpenURL results + IF openurls.size == 0; + merged_uris = args.uris.merge(args.online_res); + num_uris = merged_uris.size; + IF num_uris > 0; -%]

[% l("Electronic resources") %]

@@ -129,7 +131,8 @@ IF num_uris > 0; [%- END %] [%- IF num_uris > 1 %][% END %]
-[%- END %] +[%- END; + END; %] [%- # Hold/copy summary IF ctx.copy_summary.0.count %] -- 2.11.0