Bugzilla – Attachment 182698 Details for
Bug 39534
Saved report subgroup filter not hidden correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39534: Hide reports subgroup filter if there are no subgroups
Bug-39534-Hide-reports-subgroup-filter-if-there-ar.patch (text/plain), 2.99 KB, created by
Owen Leonard
on 2025-05-21 17:08:57 UTC
(
hide
)
Description:
Bug 39534: Hide reports subgroup filter if there are no subgroups
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-05-21 17:08:57 UTC
Size:
2.99 KB
patch
obsolete
>From f12f5c335a49bac2e11dd2ee1d3f2c23383057f4 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 21 May 2025 16:57:41 +0000 >Subject: [PATCH] Bug 39534: Hide reports subgroup filter if there are no > subgroups > >This patch updates the JavaScript which runs on the list of saved SQL >reports, adding a check for report subgroups to the display of the >report subgroups dropdown. The patch also hides the subgroups dropdown >if there is no saved tab, in which case the tabsInit function doesn't >run. > >To test you should have multiple reports organized in multiple groups >and subgroups. See the test plan on Bug 39534. > >- Go to Reports -> Saved SQL reports. >- If the page loads with the "All" tab active, there should be no > subgroups dropdown. >- If the page loads under a different tab, the subgroups dropdown should > only show if that group has subgroups. >- Switch between the various report group tabs to confirm that the > subgroups dropdown is shown or hidden correctly based on the existence > of subgroups. > >Sponsored-by: Athens County Public Libraries >--- > .../modules/reports/guided_reports_start.tt | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 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 23c48bfe1c9..e9e89af0eb4 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 >@@ -1983,6 +1983,9 @@ > $(document).ready(function(){ > > var activeTab = localStorage.getItem("sql_reports_activetab"); >+ if( activeTab == 0 ){ >+ $("#subgroup_filter_block").hide(); >+ } > > $("body").on('click',".fetch_chart_data",function(){ > if( [% unlimited_total || 0 | $raw %] > 1000 ){ >@@ -2491,13 +2494,17 @@ > > if (g_id && g_id.length > 0) { > col4.search(g_id, {exact:true}).visible(false); >- for(var i in group_subgroups[g_id]) { >- $("#subgroup_filter").append( >- '<option value="' + group_subgroups[g_id][i][0] + '">' >- + group_subgroups[g_id][i][1] + '</option>' >- ); >+ if( group_subgroups[g_id] && group_subgroups[g_id].length > 0 ){ >+ for(var i in group_subgroups[g_id]) { >+ $("#subgroup_filter").append( >+ '<option value="' + group_subgroups[g_id][i][0] + '">' >+ + group_subgroups[g_id][i][1] + '</option>' >+ ); >+ } >+ $("#subgroup_filter_block").show(); >+ } else { >+ $("#subgroup_filter_block").hide(); > } >- $("#subgroup_filter_block").show(); > } else { > $("#subgroup_filter_block").hide(); > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39534
:
182698
|
182723
|
183624