From a10811698f9bf976ce1374e37e854cd01e247d4b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 8 May 2018 13:45:37 +0000 Subject: [PATCH] Bug 19709: Move template JavaScript to the footer: Labels This patch modifies the staff client label creator 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, form validation, etc. This patch also modifies the templates to use the Bootstrap grid instead of YUI, and removes obsolete "text/javascript" attributes from + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -186,10 +21,12 @@ New [% END %] -
-
-
-
+ +
+
+
+
+ [% INCLUDE 'labels-toolbar.inc' %] [% IF ( err ) %] [% BLOCK xlate_errtype %] @@ -311,10 +148,178 @@
[% END %]
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] + +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + [% INCLUDE 'greybox.inc' %] + [% INCLUDE 'datatables.inc' %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt index 402ea9e24c..c1ae3e051c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% BLOCK translate_label_types %] [% SWITCH type %] [% CASE 'BIB' %]Biblio @@ -10,36 +11,8 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator › Layouts › [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]New[% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% BLOCK translate_justification_types %] [% SWITCH type %] [% CASE 'L' %]Left @@ -57,16 +30,14 @@ Layouts › [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]New[% END %] -
-
-
-
-
+ +
+
+
+
+ [% INCLUDE 'labels-toolbar.inc' %] -
-
-
[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] label layout @@ -207,10 +178,45 @@
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] + +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt index 03d1a50b50..944d736501 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator › Profiles › [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -46,16 +14,14 @@ Profiles › [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%]
-
-
-
-
-
+ +
+
+
+
+ [% INCLUDE 'labels-toolbar.inc' %] -
-

Edit printer profile

-
Profile settings
    @@ -138,12 +104,51 @@
-
-
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] + + +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt index b9ba5562e1..75a35671e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator › Templates › [% IF ( template_id ) %]Edit ([% template_id %])[% ELSE %]New[% END %] [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -46,20 +14,17 @@ Templates › [% IF ( template_id ) %]Edit ([% template_id %])[% ELSE %]New[% END %]
-
-
-
-
-
+ +
+
+
+
[% INCLUDE 'labels-toolbar.inc' %] -
-
-
+

Edit label template

-
-

Edit label template

-
+
+
  1. @@ -119,7 +84,7 @@
-
+
  1. @@ -176,7 +141,6 @@
-
Cancel @@ -184,12 +148,52 @@ [% END %]
-
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] + + +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt index 79f790795c..4bf1aaed32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt @@ -1,4 +1,5 @@ [% USE Asset %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator [% INCLUDE 'doc-head-close.inc' %] @@ -14,20 +15,24 @@ Tools › Label creator
-
-
-
-
-
- [% INCLUDE 'labels-toolbar.inc' %] -
-
-
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] +
+
+
+
+ [% INCLUDE 'labels-toolbar.inc' %] +
+
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt index 18a4467ffe..3dd7899fa6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt @@ -1,4 +1,5 @@ [% USE Asset %] +[% SET footerjs = 1 %] [% BLOCK translate_label_element %] [%- SWITCH element -%] [%- CASE 'layout' -%]layout @@ -14,83 +15,9 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator › [% PROCESS translate_label_element element=label_element_title %] [% INCLUDE 'doc-head-close.inc' %] - [% INCLUDE 'greybox.inc' %] - - [% Asset.css("css/datatables.css") %] -[% INCLUDE 'datatables.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -100,13 +27,21 @@ Label creator › [% PROCESS translate_label_element element=label_element_title %]
-
-
-
-
+ +
+
+
+
+ [% INCLUDE 'labels-toolbar.inc' %] -
-
+ + [% IF ( error ) %] +
+ WARNING: An error was encountered and the [% op %] operation for [% label_element %] [% element_id %] was not completed. Please have your system administrator check the error log for details. +
+ [% END %] + +
Current library: [% LoginBranchname %]
[% IF ( table_loop ) %]
@@ -176,18 +111,85 @@ [% PROCESS translate_label_element element=label_element %].

[% END %]
- [% IF ( error ) %] -
-
- WARNING: An error was encountered and the [% op %] operation for [% label_element %] [% element_id %] was not completed. Please have your system administrator check the error log for details. -
-
- [% END %] -
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
- [% INCLUDE 'intranet-bottom.inc' %] + +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + [% INCLUDE 'greybox.inc' %] + [% INCLUDE 'datatables.inc' %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt index 0bb80b9427..914d375f72 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt @@ -1,25 +1,13 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Label creator › Label printing/exporting [% INCLUDE 'doc-head-close.inc' popup => 1 %] - - - + + -
-
- [% IF ( batches ) %] +
+ [% IF ( batches ) %]

Click on the following links to download the exported batch(es).

[% FOREACH batche IN batches %] @@ -107,4 +95,20 @@ [% END %]
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] + [% INCLUDE 'greybox.inc' %] + +[% END %] + [% INCLUDE 'popup-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt index c02a2170d3..6d130f7ea6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt @@ -1,56 +1,12 @@ [% USE Asset %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Barcodes and labels › Search results [% INCLUDE 'doc-head-close.inc' %] - - [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %] - + -
-
+

Search results

[% IF ( displayprev || displaynext ) %] @@ -106,7 +62,7 @@ Select [% CASE %] [% header_field.field_label %] -z [% END -%] + [% END -%] [% END %] @@ -151,4 +107,50 @@ z [% END -%] [% END %]
- [% INCLUDE 'popup-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt index d9d52357ad..d67a67cab8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt @@ -1,12 +1,11 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %]Koha › Labels [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] - - -
-
+ +

Search for items [% IF ( batch_id ) %] @@ -104,5 +103,5 @@ to add to Batch [% batch_id %]
Cancel

-
-[% INCLUDE 'popup-bottom.inc' %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt index e324db596c..f834a0f722 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt @@ -1,17 +1,20 @@ +[% USE Asset %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %]Koha › Tools › Quick spine label creator [% INCLUDE 'doc-head-close.inc' %] + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] -
- -
-
-
+
+
+
+
+

Quick spine label creator

@@ -23,11 +26,19 @@
-
-
-
- [% INCLUDE 'tools-menu.inc' %] -
-
+ +
+ +
+ +
+
+ +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") %] +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt index 4c71cfcc70..615c639e21 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt @@ -1,32 +1,23 @@ [% USE Asset %] +[% SET footerjs = 1 %] [% IF ( bidi ) %][% ELSE %][% END %] Koha › Tools › Spine labels [% Asset.css("css/spinelabel.css") %] - - -[% IF ( IntranetUserCSS ) %][% END %] -[% IF ( IntranetUserJS ) %] - [% Asset.js("lib/jquery/jquery-2.2.3.min.js") %] - [% Asset.js("lib/jquery/jquery-migrate-1.3.0.min.js") %] - -[% END %] + +[% IF ( IntranetUserCSS ) %][% END %] + [% IF ( BarcodeNotFound ) %]

The barcode [% Barcode |html %] was not found.

Return to spine label printer

- [% ELSE %] [% IF ( autoprint ) %] @@ -37,8 +28,16 @@ [% content %] - + - [% END %] - + +[% IF ( IntranetUserJS ) %] + [% Asset.js( "lib/jquery/jquery-2.2.3.min.js" ) %] + [% Asset.js( "lib/jquery/jquery-migrate-1.3.0.min.js" ) %] + +[% END %] + +[% INCLUDE 'popup-bottom.inc' %] -- 2.11.0