Bugzilla – Attachment 107519 Details for
Bug 26091
Add column configuration and export options to catalog statistics report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26091: Add column configuration and export options to catalog statistics report
Bug-26091-Add-column-configuration-and-export-opti.patch (text/plain), 4.70 KB, created by
Owen Leonard
on 2020-07-29 16:50:22 UTC
(
hide
)
Description:
Bug 26091: Add column configuration and export options to catalog statistics report
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-07-29 16:50:22 UTC
Size:
4.70 KB
patch
obsolete
>From b826ec89a7503e77e319c607ab30de3fb40c17ad Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 29 Jul 2020 16:21:10 +0000 >Subject: [PATCH] Bug 26091: Add column configuration and export options to > catalog statistics report > >This patch makes the catalog statistics report output a DataTable with >on-the-fly column configuration and export options. > >Because the report can generate results with an arbitrary set of table >headers, the columns set to be passed to DataTables is built on the fly >along with the table. There is no global table setting. > >Since the "grand total" cell might reflect a total which includes hidden >columns, the table footer label now indicates "all results." > >To test, apply the patch and go to Reports. > >- Submit a query to the "catalog" statistics wizard which will return > multiple results. >- On the results page, confirm that the DataTable displays correctly and > that all controls work as expected, including column configuration and > export options. >- Submit other queries which will return a different set of columns in > the result. Confirm that everything continues to work as expected. >--- > .../prog/en/modules/reports/catalogue_stats.tt | 57 ++++++++++++++++++---- > 1 file changed, 48 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >index c741b54f8b..47ae397090 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >@@ -1,4 +1,5 @@ > [% USE Branches %] >+[% USE TablesSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Reports [% IF ( do_it ) %]› Catalog statistics › Results[% ELSE %]› Catalog statistics[% END %]</title> >@@ -26,14 +27,17 @@ > [% END %] > [% END %] > >- <table> >- <tr> >- <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th> >- [% FOREACH loopco IN mainloo.loopcol %] >- <th>[% loopco.coltitle | html %]</th> >- [% END %] >- <th>TOTAL</th> >- </tr> >+ <table id="catalogue_stats"> >+ <thead> >+ <tr> >+ <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th> >+ [% FOREACH loopco IN mainloo.loopcol %] >+ <th>[% loopco.coltitle | html %]</th> >+ [% END %] >+ <th>TOTAL</th> >+ </tr> >+ </thead> >+ <tbody> > [% FOREACH loopro IN mainloo.looprow %] > <tr> > [% IF ( loopro.hilighted ) %]<td class="hilighted">[% ELSE %]<td>[% END %] >@@ -50,8 +54,10 @@ > </td> > </tr> > [% END %] >+ </tbody> >+ <tfoot> > <tr> >- <th>TOTAL</th> >+ <th>TOTAL (all results)</th> > [% FOREACH loopfoote IN mainloo.loopfooter %] > <th> > [% loopfoote.totalcol | html %] >@@ -59,6 +65,7 @@ > [% END %] > <th>[% mainloo.total | html %]</th> > </tr> >+ </tfoot> > </table> > [% END %] > [% ELSE %] >@@ -303,6 +310,8 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > <script> > function changeRemovedDateTrStatus() { > var Cellvalue = $("input[name='Cellvalue']:checked").val(); >@@ -335,6 +344,36 @@ > changeRemovedDateTrStatus(); > }); > changeRemovedDateTrStatus(); >+ >+ columns_settings = [% FILTER collapse %] >+ [ >+ { >+ "is_hidden": 0, >+ "columnname": "[% mainloo.line | html %]_[% mainloo.column | html %]", >+ "cannot_be_toggled": 1, >+ "cannot_be_modified": 1 >+ }, >+ [% FOREACH loopco IN mainloo.loopcol %] >+ { >+ "is_hidden": 0, >+ "columnname": "[% loopco.coltitle | html %]", >+ "cannot_be_toggled": 0, >+ "cannot_be_modified": 0 >+ }, >+ [% END %] >+ { >+ "is_hidden": 0, >+ "columnname": "total", >+ "cannot_be_toggled": 0, >+ "cannot_be_modified": 0 >+ }, >+ ]; >+ [% END %] >+ >+ var catalogue_stats = KohaTable("catalogue_stats", { >+ 'autoWidth': false, >+ 'paging': false, >+ }, columns_settings ); > }); > </script> > [% END %] >-- >2.11.0
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 26091
:
107519
|
107790
|
107956
|
108155