From b04efa8a288224b3b8afa750fb4bbdf765fe61ad Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 18 Jun 2024 14:18:23 +0000 Subject: [PATCH] Bug 36925: Reinstate export button Signed-off-by: David Nind --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 27 ++++++++++--------- .../ERM/UsageStatisticsReportsViewer.vue | 4 +-- .../prog/js/vue/components/KohaTable.vue | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 39040059ac..48fe6f971b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -665,6 +665,7 @@ function _dt_buttons(params){ let included_ids = params.included_ids || []; let settings = params.settings || {}; let table_settings = params.table_settings; + let hasFilters = params.hasFilters; var exportColumns = ":visible:not(.noExport)"; if( settings.hasOwnProperty("exportColumns") ){ @@ -721,19 +722,21 @@ function _dt_buttons(params){ ]; let buttons = []; - buttons.push( - { - fade: 100, - className: "dt_button_clear_filter", - titleAttr: __("Clear filter"), - enabled: false, - text: ' ' + __("Clear filter") + '', - action: function ( e, dt, node, config ) { - dt.search( "" ).draw("page"); - node.addClass("disabled"); + if(hasFilters){ + buttons.push( + { + fade: 100, + className: "dt_button_clear_filter", + titleAttr: __("Clear filter"), + enabled: false, + text: ' ' + __("Clear filter") + '', + action: function ( e, dt, node, config ) { + dt.search( "" ).draw("page"); + node.addClass("disabled"); + } } - } - ); + ); + } if( included_ids.length > 0 ){ buttons.push( diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportsViewer.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportsViewer.vue index d8123120d6..fac12757bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportsViewer.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportsViewer.vue @@ -96,13 +96,13 @@ export default { ), options: { embed: this.embed, - dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>', + dom: '<"top pager"<"table_entries"ilpB>>tr<"bottom pager"ip>', }, url: () => this.tableURL(this.year, this.params), table_settings: this.report_type.includes("monthly") ? this.monthly_usage_table_settings : this.yearly_usage_table_settings, - add_filters: true, + add_filters: false, }, yearly_filter: null, params: this.params, diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue index b988a2c7df..23f442bb37 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue @@ -29,6 +29,7 @@ export default { let buttons = _dt_buttons({ included_ids, table_settings: this.table_settings, + hasFilters: this.add_filters, }) return { data: [], -- 2.39.2