From 2c0b356abd60b42d6c4adf0508103a56b2773808 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 7 Apr 2022 14:39:55 +0000 Subject: [PATCH] Bug 30491: Convert saved reports tabs to Bootstrap This patch updates the saved reports page so that it uses Bootstrap tabs instead of jQueryUI. To test, apply the patch and go to Reports -> Use saved. - On the Saved Reports page you should see multiple tabs. - Each should look correct and work correctly. - Clicking each tab should result in the table of reports filtering correctly for that tab (Patrons tab showing only patrons reports). - If necessary, edit one or more reports so that they have a subgroup. - Confirm that each subgroup selector is correct for each tab, i.e. a subgroup created under "Catalog" should only be available under the Catalog tab. --- .../modules/reports/guided_reports_start.tt | 355 +++++++++--------- 1 file changed, 179 insertions(+), 176 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 675a911cfa..f57211f38c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -240,178 +240,185 @@ [% END %]
-
[% ELSE # IF ( savedreports ) %]
@@ -1912,16 +1919,12 @@ } }, columns_settings); - var rtabs = $("#tabs").tabs({ - create: function( e, ui ){ - tabsInit( ui, rtable ); - }, - activate: function( e, ui ){ - tabsInit( ui, rtable ); - } + $("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) { + tabsInit( $(e.target).parent(), rtable ); }); + if( activeTab ){ - $("#tabs").tabs("option","active", activeTab ); + $("#tabs li:eq(" + activeTab + ") a").tab("show"); } $("#subgroup_filter").change(function() { @@ -2217,8 +2220,8 @@ $("#toggle_auto_links").click(); } - function tabsInit( ui, rtable ){ - var thisTab = ui.newTab ? ui.newTab : ui.tab; + function tabsInit( tab, rtable ){ + var thisTab = tab; // ui.newTab ? ui.newTab : ui.tab; var activeTab = thisTab.index(); localStorage.setItem("sql_reports_activetab", activeTab ); @@ -2232,8 +2235,8 @@ rtable.fnSetColumnVis(4, true); rtable.fnSetColumnVis(5, true); - var g_id = $(ui.newTab).children().attr('id'); - var g_name = $(ui.newTab).text(); + var g_id = $( tab ).children().attr('id'); + var g_name = $( tab ).children().text(); if ( g_name == _("All") ) { g_id = ""; g_name = ""; -- 2.20.1