From 9f14c31ea4cc79ddf416f07deb463d5dad0b26b9 Mon Sep 17 00:00:00 2001 From: Owen Leonard 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. Signed-off-by: Sally --- .../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' %] Koha › Reports [% IF ( do_it ) %]› Catalog statistics › Results[% ELSE %]› Catalog statistics[% END %] @@ -26,14 +27,17 @@ [% END %] [% END %] - - - - [% FOREACH loopco IN mainloo.loopcol %] - - [% END %] - - +
[% mainloo.line | html %] / [% mainloo.column | html %][% loopco.coltitle | html %]TOTAL
+ + + + [% FOREACH loopco IN mainloo.loopcol %] + + [% END %] + + + + [% FOREACH loopro IN mainloo.looprow %] [% IF ( loopro.hilighted ) %] [% END %] + + - + [% FOREACH loopfoote IN mainloo.loopfooter %] +
[% mainloo.line | html %] / [% mainloo.column | html %][% loopco.coltitle | html %]TOTAL
[% ELSE %][% END %] @@ -50,8 +54,10 @@
TOTALTOTAL (all results) [% loopfoote.totalcol | html %] @@ -59,6 +65,7 @@ [% END %] [% mainloo.total | html %]
[% END %] [% ELSE %] @@ -303,6 +310,8 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] [% END %] -- 2.11.0