TPAC: Avoid showing URIs from 856 if we have OpenURL results feature/tpac_eresources_highlander_2_4
authorDan Scott <dscott@laurentian.ca>
Fri, 10 May 2013 16:42:24 +0000 (12:42 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 10 May 2013 16:42:24 +0000 (12:42 -0400)
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 <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/record/summary.tt2

index a38bd54..cd484ac 100644 (file)
 [%- END %]
     </div>    
 [%- 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;
 -%]
 <h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
 <div class="rdetail_uris">
@@ -114,7 +116,8 @@ IF num_uris > 0;
     [%- END %]
     [%- IF num_uris > 1 %]</ul>[% END %]
 </div>
-[%- END %]
+[%- END;
+        END; %]
 [%- # Hold/copy summary
     IF ctx.copy_summary.0.count
 %]