From 253eb135eb399f90878de7a129efae48651db26c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 24 May 2016 09:18:37 -0400 Subject: [PATCH] [SIGNED-OFF]Bug 16576 [Revised] Remove the use of "onclick" from label templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch updates several label creator templates to remove the use of "onclick" in favor of defining click events in JavaScript. Also changed: - Replaced the non-existant element with - Removed the use of
and 'align="center"'; - In the item search results template: - The use of the checkboxes jQuery plugin has been replaced with straight jQuery for simplicity's sake. - Output of table headers has been modified so that translatable strings are in the template instead of having English strings passed from the script. - Moved the 'Add checked' and 'Done' buttons into a floating toolbar. To test, apply the patch and go to Tools -> Label creator. - Choose New -> Label batch - Click 'Add items' - Perform a search for items. - Confirm that 'select all' and 'clear all' links work. - Confirm that clicking an individual 'Add' button works. - Select multiple items and click the 'Add checked' button. Confirm that the selected items were added to your batch. - Click 'Add items' again to save the selected items to your batch. - Test that the 'Delete' and 'Export' buttons next to any item work correctly. - Choose Manage -> Label batches - Test that the 'Delete' button works correctly. - Select one or more batches and test that the 'Export selected' button works correctly. Revision: Removed changes to pagination in the item search results template since it didn't work. Followed test plan, works as expected. Signed-off-by: Marc VĂ©ron Signed-off-by: Hector Castro --- .../prog/en/modules/labels/label-edit-batch.tt | 37 ++++---- .../prog/en/modules/labels/label-manage.tt | 19 +++- .../prog/en/modules/labels/label-print.tt | 11 ++- .../intranet-tmpl/prog/en/modules/labels/result.tt | 92 +++++++++++++------- 4 files changed, 105 insertions(+), 54 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt index 4d8007b..62d5613 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt @@ -7,7 +7,6 @@ [% INCLUDE 'datatables.inc' %] @@ -218,12 +226,12 @@ [% IF ( table_loop ) %]
@@ -235,11 +243,11 @@ [% FOREACH header_field IN table_loo.header_fields %] [% SWITCH header_field.field_label -%] - [% CASE "Label Number" -%] + [% CASE "Label number" -%] Label number [% CASE "Summary" -%] Summary - [% CASE "Item Type" %] + [% CASE "Item type" %] Item type [% CASE "Barcode" %] Barcode @@ -256,8 +264,11 @@ [% FOREACH text_field IN table_loo.text_fields %] [% IF ( text_field.select_field ) %] - Delete Export -
+ + Delete + Export + + [% ELSE %] [% IF ( text_field.field_name == '_item_type_tbl' ) %] @@ -275,14 +286,10 @@
[% ELSE %] -
-
  1. There are no items in this batch yet

    Add items by using the text area above or leave empty to add via item search.

    -
-
[% END %] 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 0c527ba..938bc4b 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 @@ -16,7 +16,6 @@ [% INCLUDE 'greybox.inc' %] @@ -139,8 +147,11 @@ [% FOREACH text_field IN table_loo.text_fields %] [% IF ( text_field.select_field ) %] - Edit Delete - [% IF label_element == 'batch' %] [% END %] + + Edit + Delete + + [% IF label_element == 'batch' %] [% END %] [% ELSIF ( text_field.field_value ) %] [% text_field.field_value %] [% ELSE %] @@ -151,7 +162,7 @@ [% END %] [% END %] - [% IF ( print ) %][% END %] + [% IF ( print ) %][% END %] [% ELSE %] 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 0f517d9..0bb80b9 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 @@ -6,6 +6,11 @@ function Done() { window.location = "[% referer %]"; }; + $(document).ready(function(){ + $(".gb-close").on("click",function(){ + parent.parent.GB_hide(); + }); + }); //]]> @@ -46,7 +51,7 @@ [% END %]
- +
[% ELSE %] @@ -96,8 +101,8 @@
- - Cancel + + Cancel
[% END %] 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 65dc131..a2051b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt @@ -2,17 +2,28 @@ Koha › Barcodes and labels › Search results [% INCLUDE 'doc-head-close.inc' %] - +