From a6abaca8d0d36835e4a5fd4fb9b906cc9e573953 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 28 Nov 2017 15:41:54 +0000 Subject: [PATCH] Bug 19653: Move tools templates JavaScript to the footer: Additional tools This patch modifies the staff client "Additional tools" templates so that JavaScript is included in the footer instead of the header: - Calendar - CSV profiles - Log viewer - News - Task scheduler - Edit quotes for QOTD feature - Upload Note that the log viewer template has been modified so that the "interface" variable (passed to the template to provide the correct path to staff client assets) isn't overwritten by an "interface" variable required by the log viewer. To test, apply the patch and test the JavaScript-driven features of each modified template: All button controls, DataTables functionality, form validation, etc. Signed-off-by: Claire Gravely Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/csv-profiles.tt | 56 +- .../prog/en/modules/tools/holidays.tt | 402 ++++++------ .../prog/en/modules/tools/koha-news.tt | 134 ++-- .../prog/en/modules/tools/quotes-upload.tt | 602 +++++++++--------- .../prog/en/modules/tools/quotes.tt | 352 +++++----- .../prog/en/modules/tools/scheduler.tt | 21 +- .../prog/en/modules/tools/upload.tt | 323 +++++----- .../prog/en/modules/tools/viewlog.tt | 19 +- 8 files changed, 969 insertions(+), 940 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt index cdbaab9fe5..e9d97d38d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt @@ -1,28 +1,7 @@ -[% INCLUDE 'doc-head-open.inc' %]Koha › Tools › CSV export profiles[% INCLUDE 'doc-head-close.inc' %] - +[% SET footerjs = 1 %] +[% INCLUDE 'doc-head-open.inc' %] +Koha › Tools › CSV export profiles +[% INCLUDE 'doc-head-close.inc' %] @@ -304,4 +283,31 @@ function reloadPage(p) { [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index e81b14f785..98c24cd619 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -1,207 +1,9 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › [% Branches.GetName( branch ) %] calendar [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] -[% INCLUDE 'datatables.inc' %] - - - - [% IF ( plugin ) %] @@ -402,4 +244,165 @@ $(document).ready(function() { [% END %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index e5706c679c..a711dde098 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -1,6 +1,7 @@ [% USE Koha %] [% USE AuthorisedValues %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › @@ -11,8 +12,8 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -56,12 +57,12 @@ [% END %] [% BLOCK translate_log_interface %] -[% SWITCH interface %] +[% SWITCH log_interface %] [% CASE 'INTRANET' %]Intranet [% CASE 'OPAC' %]OPAC [% CASE 'SIP' %]SIP [% CASE 'COMMANDLINE' %]Command-line -[% CASE %][% interface %] +[% CASE %][% log_interface %] [% END %] [% END %] @@ -145,9 +146,9 @@ [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] [% IF interfaces.grep(interf).size %] - + [% ELSE %] - + [% END %] [% END %] @@ -244,7 +245,7 @@ [% loopro.info |html %] [% END %] - [% PROCESS translate_log_interface interface=loopro.interface %] + [% PROCESS translate_log_interface log_interface=loopro.interface %] [% END %] @@ -276,4 +277,10 @@ [% END %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5