From 1015fb1192fd9a309f7aee398d077b84ffe54119 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. Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- .../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 5cfbcae66a..50b0aa4529 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 %]
-
    -
  • All
  • + -
    -
    - - -
    - [% IF (Koha.Preference('Mana') == 1) %] - [% IF manamsg %] -
    -

    [% manamsg | html %]

    -
    +
    +
    +
    + + +
    + + [% IF (Koha.Preference('Mana') == 1) %] + [% IF manamsg %] +
    +

    [% manamsg | html %]

    +
    + [% END %] [% END %] - [% END %] -
    - - - - - - - - - - - - - - - - - - [% IF (usecache) %] - - [% ELSE %] - - [% END %] - - [% IF has_obsolete_reports %] - - [% ELSE %] - - [% END %] - - - - - [% FOREACH savedreport IN savedreports %] - [% UNLESS ( loop.odd ) %][% ELSE %][% END %] - - - - - - - - - - - - - - - - - + + +
     IDReport nameTypeGroupSubgroupNotesAuthorCreation dateLast editLast runPublicJSON URLCache expiry (seconds)Cache expiry (seconds)Saved resultsUpdateUpdateActions
    - [% IF ( CAN_user_reports_delete_reports ) %] - - [% END %] - - - - - [% IF ( savedreport.report_name ) %] - [% savedreport.report_name | html %] - [% ELSE %] - [ no name ] - [% END %] - - [% savedreport.type | html %] - - [% savedreport.groupname | html %] - - [% savedreport.subgroupname | html %] - - [% savedreport.notes | html %] - - [% savedreport.borrowersurname | html %] - [% IF ( savedreport.borrowerfirstname ) %] - , [% savedreport.borrowerfirstname | html %] - [% END %] - ([% savedreport.borrowernumber | html %]) - - [% savedreport.date_created | $KohaDates %] - - [% savedreport.last_modified | $KohaDates with_hours => 1 %] - - [% savedreport.last_run | $KohaDates with_hours => 1 %] - - [% IF (savedreport.public) %] - Yes - [% ELSE %] - No - [% END %] - - [% IF (savedreport.public) %] - [% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] - [% ELSE %] - [% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] - [% END %] - - [% savedreport.cache_expiry | html %] - - [% FOR result IN savedreport.results %] - [% result.date_run | html %] -
    - [% END %] -
    - [% IF savedreport.seems_obsolete %] - This report seems obsolete, it uses biblioitems.marcxml field. - Update SQL - [% END %] - -
    - [%# There should be no space between these two buttons, it would render badly %] - Run - -
    - -
    + + + + + + + + + + + + + + + + [% IF (usecache) %] + + [% ELSE %] + + [% END %] + + [% IF has_obsolete_reports %] + + [% ELSE %] + + [% END %] + - [% END %] - -
     IDReport nameTypeGroupSubgroupNotesAuthorCreation dateLast editLast runPublicJSON URLCache expiry (seconds)Cache expiry (seconds)Saved resultsUpdateUpdateActions
    + + + [% FOREACH savedreport IN savedreports %] + [% UNLESS ( loop.odd ) %][% ELSE %][% END %] + + [% IF ( CAN_user_reports_delete_reports ) %] + + [% END %] + + + + + + + [% IF ( savedreport.report_name ) %] + [% savedreport.report_name | html %] + [% ELSE %] + [ no name ] + [% END %] + + + [% savedreport.type | html %] + + + [% savedreport.groupname | html %] + + + [% savedreport.subgroupname | html %] + + + [% savedreport.notes | html %] + + + [% savedreport.borrowersurname | html %] + [% IF ( savedreport.borrowerfirstname ) %] + , [% savedreport.borrowerfirstname | html %] + [% END %] + ([% savedreport.borrowernumber | html %]) + + + [% savedreport.date_created | $KohaDates %] + + + [% savedreport.last_modified | $KohaDates with_hours => 1 %] + + + [% savedreport.last_run | $KohaDates with_hours => 1 %] + + + [% IF (savedreport.public) %] + Yes + [% ELSE %] + No + [% END %] + + + [% IF (savedreport.public) %] + [% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] + [% ELSE %] + [% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] + [% END %] + + + [% savedreport.cache_expiry | html %] + + + [% FOR result IN savedreport.results %] + [% result.date_run | html %] +
    + [% END %] + + + [% IF savedreport.seems_obsolete %] + This report seems obsolete, it uses biblioitems.marcxml field. + Update SQL + [% END %] + + +
    + [%# There should be no space between these two buttons, it would render badly %] + Run + +
    + + + + [% END %] + + - [% IF ( CAN_user_reports_delete_reports ) %] -
    - -
    - [% END %] -
    -
    + [% IF ( CAN_user_reports_delete_reports ) %] +
    + +
    + [% END %] + +
    +
[% ELSE # IF ( savedreports ) %]
@@ -1863,16 +1870,12 @@ } }, table_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() { @@ -2168,8 +2171,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 ); @@ -2183,8 +2186,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.39.5