KMAIN-328 - single copy count when searching by lib
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:06:12 +0000 (17:06 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: b922cca

KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2
KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2

index a1dbb94..566ec21 100644 (file)
         # 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']; 
index 691a6bb..9375560 100644 (file)
                                                         [% END %]
 
                                                     </table>
-                                                    [% PROCESS "opac/parts/result/copy_counts.tt2" %]
+                                                    <div>
+                                                        [% l('[quant,_1,hold,holds] on first copy returned of [quant,_2,copy,copies]',
+                                                                rec.hold_count, attrs.copy_counts.count) %]
+                                                        <br/>
+                                                        [% l('[quant,_1,copy,copies] available', attrs.copy_counts.available) %]
+                                                    </div>
                                                     [% IF rec.user_circulated %]
                                                     <div class="result_item_circulated">
                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>