@@ -, +, @@
---
.../tables/items/catalogue_detail.inc | 67 ++++++++++++-------
1 file changed, 41 insertions(+), 26 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc
@@ -3,32 +3,7 @@
[% USE AuthorisedValues %]
[% USE raw %]
-[% BLOCK items_table %]
-
-
+[% BLOCK build_table %]
[% IF (StaffDetailItemSelection) %] | [% END %]
@@ -65,6 +40,34 @@
+[% END %]
+[% BLOCK items_table %]
+
+
+ [% PROCESS build_table tab => tab %]
[% END %][%# end of block items_table %]
@@ -211,8 +214,20 @@
otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %],
};
+ let table_nodes = {
+ holdings: '[% PROCESS 'build_table' tab="holdings" | collapse %]',
+ otherholdings: '[% PROCESS 'build_table' tab="otherholdings" | collapse %]',
+ };
function build_items_table (tab_id, add_filters, dt_options) {
+ if ( dt_options && dt_options.hasOwnProperty('destroy') ) {
+ let table_id = "#"+tab_id+"_table";
+ if( $.fn.dataTable.isDataTable(table_id) ) {
+ $(table_id).DataTable().destroy();
+ }
+ $(table_id).replaceWith(table_nodes[tab_id]);
+ dt_options['destroy'] = null;
+ }
let default_filters = {};
[% IF Koha.Preference('SeparateHoldings') %]
[% SET SeparateHoldingsBranch = Koha.Preference('SeparateHoldingsBranch') || 'homebranch' %];
--