From 092bb7fc02ee7baca66b6174f0c1994f309e89db 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 --- .../en/modules/admin/branch_transfer_limits.tt | 80 +++---- .../prog/en/modules/admin/categories.tt | 21 +- .../intranet-tmpl/prog/en/modules/admin/cities.tt | 35 +-- .../en/modules/admin/item_circulation_alerts.tt | 101 +++++---- .../prog/en/modules/admin/patron-attr-types.tt | 39 ++-- .../prog/en/modules/admin/smart-rules.tt | 247 +++++++++++---------- .../prog/en/modules/admin/transport-cost-matrix.tt | 116 +++++----- 7 files changed, 333 insertions(+), 306 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 d8a029d..f7d57f2 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 eb6be8d..d017e9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -1,21 +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' %] @@ -494,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 a440cf1..869edc9 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 a765174..9dd1fd0 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 cfbbf2c..5a5f293 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 99c03d3..6dc5042 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 7c6ee3f..281c2c5 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.1.4