From 95f881b96969dda6156d78fbe59410946f61ca99 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 Signed-off-by: Jonathan Druart --- .../prog/en/modules/patroncards/edit-batch.tt | 307 +++++++++--------- .../en/modules/patroncards/edit-layout.tt | 211 ++++++------ .../en/modules/patroncards/edit-profile.tt | 74 +++-- .../en/modules/patroncards/edit-template.tt | 75 +++-- .../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 badff40aa1..4ea92aec0e 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 bd856c757d..ae1481292e 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 4fc2538329..21251014f2 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 83222ed6c4..36437dd6fd 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' %] @@ -188,4 +156,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 5ceb132caa..7edb2497f4 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 3585ea044d..8136394685 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 f2ab3c6daf..203e7cee4d 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.39.5