From 9b893b67c4851b3dbede6774e293cdbd1e9ca2a7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 20 Nov 2017 19:43:11 +0000 Subject: [PATCH] Bug 19663: Move JS to the footer: Reports This patch modifies the staff client's reports templates so that JavaScript is included in the footer instead of the header. To test, apply the patch and test the JavaScript-driven features of reports pages: All button controls, DataTables functionality, form validation, etc. --- .../prog/en/includes/reports-toolbar.inc | 10 - .../prog/en/modules/reports/acquisitions_stats.tt | 72 +-- .../prog/en/modules/reports/bor_issues_top.tt | 79 ++-- .../prog/en/modules/reports/borrowers_out.tt | 20 +- .../prog/en/modules/reports/borrowers_stats.tt | 8 +- .../prog/en/modules/reports/cash_register_stats.tt | 105 ++--- .../prog/en/modules/reports/cat_issues_top.tt | 81 ++-- .../prog/en/modules/reports/catalogue_stats.tt | 78 ++-- .../prog/en/modules/reports/dictionary.tt | 42 +- .../en/modules/reports/guided_reports_start.tt | 496 +++++++++++---------- .../prog/en/modules/reports/issues_avg_stats.tt | 72 +-- .../prog/en/modules/reports/issues_stats.tt | 8 +- .../prog/en/modules/reports/itemslost.tt | 45 +- .../prog/en/modules/reports/itemtypes.tt | 30 +- .../prog/en/modules/reports/orders_by_budget.tt | 40 +- .../prog/en/modules/reports/reserves_stats.tt | 160 +++---- .../prog/en/modules/reports/serials_stats.tt | 32 +- .../prog/en/modules/reviews/reviewswaiting.tt | 6 + 18 files changed, 722 insertions(+), 662 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc index a425919..d7fa79d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc @@ -63,13 +63,3 @@ [% END %] - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt index 04c09e8..4e5c916 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports [% IF ( do_it ) %]› Acquisitions statistics › Results[% ELSE %]› Acquisitions statistics[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -338,4 +306,40 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt index 4b64802..fedf5dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt @@ -1,44 +1,12 @@ [% USE Branches %] [% USE KohaDates %] [% USE ItemTypes %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Patrons with the most checkouts [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -52,13 +20,6 @@
[% IF ( do_it ) %] - - - [% FOREACH mainloo IN mainloop %]

Patrons with the most checkouts

[% IF ( mainloo.loopfilter ) %] @@ -227,4 +188,40 @@ function Dopop(link) { [% INCLUDE 'reports-menu.inc' %]
+ +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt index e269042..ff4008f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt @@ -1,15 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Patrons with no checkouts [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -130,4 +124,14 @@ $(document).ready(function(){ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt index 005886d..95c78f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt @@ -1,13 +1,14 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports [% IF ( do_it ) %]› Patrons statistics › Results[% ELSE %]› Patrons statistics[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -293,4 +294,9 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt index adba384..36c7f7f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt @@ -1,63 +1,13 @@ [% USE KohaDates %] [% USE Price %] [% USE ItemTypes %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports [% IF ( do_it ) %]› Cash register statistics › Results[% ELSE %]› Cash register statistics[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - -[% INCLUDE 'calendar.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -300,4 +250,55 @@ $(document).ready(function() { [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt index 555ea64..fae2f2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt @@ -1,45 +1,10 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Most-circulated items[% IF ( do_it ) %] › Results[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -222,4 +187,46 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] 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 c1f4aab..f47b00e 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,45 +1,10 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports [% IF ( do_it ) %]› Catalog statistics › Results[% ELSE %]› Catalog statistics[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -332,4 +297,43 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt index 9bcf24b..7e6c45d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt @@ -1,26 +1,10 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Guided reports › Dictionary [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'circ-search.inc' %] @@ -284,4 +268,26 @@ [% INCLUDE 'guided-reports-view.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] 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 5902b92..dcf8f5a 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 @@ -1,6 +1,6 @@ [% USE KohaDates %] [% USE Koha %] - +[% SET footerjs = 1 %] [%- BLOCK area_name -%] [%- SWITCH area -%] [%- CASE 'CIRC' -%]Circulation @@ -29,7 +29,6 @@ [%- END -%] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] [% IF ( saved1 ) %] - - -[% INCLUDE 'datatables.inc' %] -[% END %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'circ-search.inc' %] @@ -1138,26 +913,253 @@ Sub report: @@ -174,7 +103,7 @@ - Notification Date + Notification date @@ -182,7 +111,7 @@ - Reminder Date + Reminder date @@ -190,7 +119,7 @@ - Waiting Date + Waiting date @@ -198,7 +127,7 @@ - Cancellation Date + Cancellation date @@ -363,4 +292,79 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt index 3b9ac4c..0b9e0f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt @@ -1,5 +1,6 @@ [% USE KohaDates %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Serials subscriptions stats [% INCLUDE 'doc-head-close.inc' %] @@ -7,21 +8,8 @@ .sql {display: none;} -[% INCLUDE 'datatables.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -146,4 +134,20 @@ [% INCLUDE 'reports-menu.inc' %] + +[% MACRO jsinclude BLOCK %] +[% INCLUDE 'datatables.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt index 5373fc3..0043ec5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Comments › [% IF ( status ) %] Approved comments[% ELSE %] Comments awaiting moderation[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -72,4 +73,9 @@ [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.1.4