From: Bill Erickson Date: Wed, 29 Oct 2014 21:06:12 +0000 (-0400) Subject: KMAIN-328 - single copy count when searching by lib X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d406a36503b0a897e30ee8499afe3f5cd3c6e8b3;p=working%2FEvergreen.git KMAIN-328 - single copy count when searching by lib Cross-port: b922cca --- diff --git a/KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2 b/KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2 index a1dbb94f0a..566ec21fc1 100644 --- a/KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2 @@ -376,28 +376,15 @@ # Extract the copy count summary count_type = (ctx.is_staff) ? 'staff' : 'public'; - # Consortial copy count summary first - xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; - args.copy_counts = {}; - FOR node IN xml.findnodes(xpath); - FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; - depth = node.getAttribute('depth'); - count_org_unit = node.getAttribute('org_unit'); - args.copy_counts.$depth.$attr = node.getAttribute(attr); - args.org_copy_counts.$count_org_unit.$attr = node.getAttribute(attr); - END; - END; - - # Get preferred library copy count - args.plib_copy_counts = {}; - count_type = 'pref_lib'; - xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; - FOR node IN xml.findnodes(xpath); - FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; - depth = node.getAttribute('depth'); - args.plib_copy_counts.$depth.$attr = node.getAttribute(attr); - END; - END; + # Extract the copy count summary + count_type = (ctx.is_staff) ? 'staff' : 'public'; + xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; + FOR node IN xml.findnodes(xpath); + args.copy_counts = {}; + FOR attr IN ['count', 'available', 'unshadow', 'transcendant']; + args.copy_counts.$attr = node.getAttribute(attr); + END; + END; # "mattype" == "custom marc format specifier" FOR icon_style IN ['mattype', 'item_type']; diff --git a/KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2 b/KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2 index 691a6bb99c..9375560f06 100644 --- a/KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2 @@ -158,7 +158,12 @@ [% END %] - [% PROCESS "opac/parts/result/copy_counts.tt2" %] +
+ [% l('[quant,_1,hold,holds] on first copy returned of [quant,_2,copy,copies]', + rec.hold_count, attrs.copy_counts.count) %] +
+ [% l('[quant,_1,copy,copies] available', attrs.copy_counts.available) %] +
[% IF rec.user_circulated %]
[% l('Checked Out Before') %]