Bug 16759: Handle the otherholdings tab gracefuly
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 24 Oct 2017 22:19:09 +0000 (19:19 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Oct 2017 15:14:40 +0000 (12:14 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt

index 528d7d2..af77f55 100644 (file)
                         [% IF too_many_items %]
                             <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]&amp;viewallitems=1">Click here to view them all.</a></p>
                         [% ELSIF ( itemloop.size ) %]
-                            [% INCLUDE items_table items=itemloop tab="holdings" %]
+                            [% INCLUDE items_table items=itemloop tab="holdings" table_id="holdingst" %]
                             [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
                               [% IF acquisition_details.total_quantity == 1 %]
                                 <span>1 item is on order.</span>
                     [% IF (SeparateHoldings) %]
                         <div id="otherholdings">
                             [% IF (otheritemloop.size) %]
-                                [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
+                                [% INCLUDE items_table items=otheritemloop tab="otherholdings" table_id="otherholdingst" %]
                             [% ELSE %]
                                 <span>No other items.</span>
                             [% END %]
 [%# End of template %]
 
 [% BLOCK items_table %]
-    <table class="holdingst table table-bordered table-striped">
+    <table class="table table-bordered table-striped" id="[% table_id %]">
         <thead>
             <tr>
         [% IF ( item_level_itypes ) %]
         });
 
         var columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ) %];
-        KohaTable(".holdingst", {
+
+        KohaTable("#holdingst", {
+            dom: 'B<"clearfix">t',
+            "columnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+            "bKohaColumnsUseNames": true
+        }, columns_settings);
+
+        KohaTable("#otherholdingst", {
             dom: 'B<"clearfix">t',
             "columnDefs": [
                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },