From e678098109187e8d76d8567396f622886904fffc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 Nov 2017 14:30:26 +0000 Subject: [PATCH] Bug 19603: Move admin templates JavaScript to the footer: Patrons and circulation This patch modifies the staff client patrons and circulation-related administration 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 each modified template: All button controls, DataTables functionality, tabs, etc. Signed-off-by: Claire Gravely Edit: Rebased Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- .../modules/admin/branch_transfer_limits.tt | 80 +++--- .../prog/en/modules/admin/categories.tt | 22 +- .../prog/en/modules/admin/cities.tt | 35 +-- .../modules/admin/item_circulation_alerts.tt | 101 +++---- .../en/modules/admin/patron-attr-types.tt | 39 +-- .../prog/en/modules/admin/smart-rules.tt | 247 +++++++++--------- .../en/modules/admin/transport-cost-matrix.tt | 116 ++++---- 7 files changed, 333 insertions(+), 307 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt index d8a029d688..f7d57f2db5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt @@ -1,48 +1,12 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Library checkin and transfer policy [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] @@ -119,4 +83,44 @@ [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt index 9d8d65b39c..d017e9fb0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -1,22 +1,16 @@ [% USE Koha %] [% USE KohaDates %] [% USE Price %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Patron categories › [% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %] [% IF op == 'delete_confirm' %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] -[% INCLUDE 'datatables.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'patrons-admin-search.inc' %] @@ -495,4 +489,16 @@ [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'calendar.inc' %] + [% INCLUDE 'datatables.inc' %] + + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt index a440cf14ca..869edc9fea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt @@ -1,23 +1,10 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › [% IF op =='add_form' %]Cities › [% IF city.cityid %] Modify city[% ELSE %] New city[% END %][% ELSE %][% IF op == 'delete_confirm' %]Cities › Confirm deletion of city[% ELSE %] Cities[% END %][% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cities-admin-search.inc' %] @@ -185,5 +172,21 @@ [% INCLUDE 'admin-menu.inc' %] -[% INCLUDE 'intranet-bottom.inc' %] +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + +[% END %] +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt index a765174943..9dd1fd05ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Item circulation alerts [% INCLUDE 'doc-head-close.inc' %] @@ -37,55 +38,8 @@ table.grid td.default { background: #f88; } - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] @@ -202,4 +156,55 @@ $(function(){ [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index cfbbf2ccd5..5a5f293754 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -1,4 +1,5 @@ [% USE AuthorisedValues %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Patron attribute types [% IF ( attribute_type_form ) %] @@ -13,25 +14,8 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] @@ -313,4 +297,23 @@ $(document).ready(function() { [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 99c03d3443..6dc5042f48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -1,130 +1,10 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Circulation and fine rules [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] @@ -834,4 +714,127 @@ $(document).ready(function() { [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'calendar.inc' %] + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt index 7c6ee3f9ef..281c2c5427 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt @@ -1,70 +1,15 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Transport cost matrix [% INCLUDE 'doc-head-close.inc' %] - - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] @@ -144,4 +89,61 @@ $(document).ready(function(){ [% INCLUDE 'admin-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5