From 3b024e375d70a0baecdc09579258e91493da1b0b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 21 Feb 2018 19:40:06 +0000 Subject: [PATCH] Bug 19961: Move template JavaScript to the footer: Patron card creator This patch modifies the staff client patron card creator templates so that JavaScript is included in the footer instead of the header. Also changed: Removed "type" attribute from script tags. To test, apply the patch and test the JavaScript-driven features of each modified template: All button controls, DataTables functionality, form validation, etc. - Creating and managing layouts - Creating and managing card batches - Creating and managing card templates - Creating and managing printer profiles - Creating and managing images Signed-off-by: Jesse Maseto Signed-off-by: Katrin Fischer --- .../prog/en/modules/patroncards/edit-batch.tt | 307 ++++++++++----------- .../prog/en/modules/patroncards/edit-layout.tt | 211 +++++++------- .../prog/en/modules/patroncards/edit-profile.tt | 74 ++--- .../prog/en/modules/patroncards/edit-template.tt | 75 ++--- .../prog/en/modules/patroncards/image-manage.tt | 96 ++++--- .../prog/en/modules/patroncards/manage.tt | 294 ++++++++++---------- .../prog/en/modules/patroncards/print.tt | 40 ++- 7 files changed, 561 insertions(+), 536 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt index badff40..4ea92ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt @@ -1,162 +1,10 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %] [% INCLUDE 'doc-head-close.inc' %] - [% INCLUDE 'greybox.inc' %] - - [% INCLUDE 'datatables.inc' %] - + + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -274,4 +122,151 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'greybox.inc' %] + [% INCLUDE 'datatables.inc' %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tt index bd856c7..ae14812 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tt @@ -1,111 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › Layout › [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]New[% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -568,4 +466,107 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-profile.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-profile.tt index 4fc2538..2125101 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-profile.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-profile.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › Profiles › [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -138,4 +106,40 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-template.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-template.tt index efe20ff..296131f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-template.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-template.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › Templates › [% IF (template_id) %]Edit ([% template_id %])[% ELSE %]New[% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -176,4 +144,41 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt index 5ceb132..7edb249 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt @@ -1,52 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › Images [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -183,4 +140,51 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt index 3585ea0..8136394 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt @@ -1,4 +1,5 @@ [% USE CGI %] +[% SET footerjs = 1 %] [% BLOCK translate_card_element %] [%- SWITCH element -%] [%- CASE 'layout' -%]layout @@ -24,151 +25,8 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Patron card creator › [% PROCESS translate_card_element element=card_element_title %] [% INCLUDE 'doc-head-close.inc' %] - [% INCLUDE 'greybox.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -270,4 +128,150 @@ [% INCLUDE 'tools-menu.inc' %] - [% INCLUDE 'intranet-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'greybox.inc' %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt index f2ab3c6..203e7ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt @@ -1,20 +1,15 @@ - [% INCLUDE 'doc-head-open.inc' %] +[% SET footerjs = 1 %] + +[% IF ( bidi ) %][% ELSE %][% END %] + Koha › Tools › Patron cards › Patron card printing/exporting + + [% INCLUDE intranetstylesheet.inc %] + [% IF ( IntranetUserCSS ) %][% END %] [% INCLUDE 'doc-head-close.inc' popup => 1%] - +
@@ -118,4 +113,21 @@ [% END %]
- [% INCLUDE 'popup-bottom.inc' %] + +[% IF ( IntranetUserJS ) %] + + + +[% END %] + +[% INCLUDE 'popup-bottom.inc' %] -- 2.1.4