From cfb372c30884dc85e31a8ca5159611dcab2ba98e 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. Signed-off-by: Claire Gravely Fix for QA: Remove unused Dopop function. Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- .../prog/en/includes/reports-toolbar.inc | 10 - .../en/modules/reports/acquisitions_stats.tt | 72 +-- .../prog/en/modules/reports/bor_issues_top.tt | 79 ++- .../prog/en/modules/reports/borrowers_out.tt | 20 +- .../en/modules/reports/borrowers_stats.tt | 8 +- .../en/modules/reports/cash_register_stats.tt | 105 ++-- .../prog/en/modules/reports/cat_issues_top.tt | 77 +-- .../en/modules/reports/catalogue_stats.tt | 78 +-- .../prog/en/modules/reports/dictionary.tt | 42 +- .../modules/reports/guided_reports_start.tt | 496 +++++++++--------- .../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 +- .../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, 718 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 a425919820..d7fa79d6ee 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 04c09e897f..4e5c9161cf 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 4b64802c45..fedf5dc3f7 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 e269042caa..ff4008fb20 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 005886d0cb..95c78f5dd1 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 adba3845cb..36c7f7f779 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 555ea64eb7..756d6e0db8 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,42 @@ [% 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 c1f4aabadf..f47b00e2c9 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 9bcf24bf8e..7e6c45d0ec 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 5902b92cfe..dcf8f5ae55 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 3b9ac4c10b..0b9e0f4df9 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 5373fc3fc9..0043ec5079 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.39.5