From d3cc2a1a9dbb63d080d121c7c2c6f882d03084e8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 12 Dec 2017 14:38:01 +0000 Subject: [PATCH] Bug 19654: Move tools templates JavaScript to the footer: Batch MARC tools This patch modifies the staff client patron lists 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. Revised: My original patch included changes to batchMod-edit.tt but didn't take into account the MARC plugins which are loaded in the item edit form. I have discarded those changes for now. Tools -> Batch record modification - Page highlighting in the sidebar - Patron autocomplete in the "Check out" tab - Submit records for deletion - Page highlighting in the sidebar - Checkbox selection links - Warning when no records selected - Patron autocomplete in the "Check out" tab Tools -> Batch item modification - Page highlighting in the sidebar - Patron autocomplete in the "Check out" tab Tools -> Batch item deletion - Page highlighting in the sidebar - Patron autocomplete in the "Check out" tab - Submit items for deletion - Patron autocomplete in the "Check out" tab - Checkbox selection links - Column-hiding checkboxes - Datatables Tools -> Batch record modification - Page highlighting in the sidebar - Patron autocomplete in the "Check out" tab - Submit records for modification - Page highlighting in the sidebar - Patron autocomplete in the "Check out" tab - Checkbox selection links - Datatables - MARC preview - Warning when no records selected - Progress bar after submitting items for modification Signed-off-by: Claire Gravely Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/batchMod-del.tt | 217 +++++++++--------- .../prog/en/modules/tools/batchMod.tt | 30 ++- .../en/modules/tools/batch_delete_records.tt | 157 +++++++------ .../tools/batch_record_modification.tt | 149 ++++++------ 4 files changed, 286 insertions(+), 267 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt index 5ad619579c..7987756874 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt @@ -1,26 +1,8 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Batch item deletion [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - - - @@ -30,42 +12,42 @@ $(document).ready(function(){ [% INCLUDE 'cat-search.inc' %]
[% IF ( show ) %]

Batch item deletion

[% ELSE %]

Batch item deletion results

[% END %] - [% IF ( barcode_not_unique ) %]
Error saving item: Barcode must be unique.
[% END %] - [% IF ( no_next_barcode ) %]
Error saving items: Unable to automatically determine values for barcodes. No item has been inserted.
[% END %] + [% IF ( barcode_not_unique ) %]
Error saving item: Barcode must be unique.
[% END %] + [% IF ( no_next_barcode ) %]
Error saving items: Unable to automatically determine values for barcodes. No item has been inserted.
[% END %] [% IF ( book_on_loan ) %]
Cannot delete: item is checked out.
[% END %] [% IF ( book_reserved ) %]
Cannot delete: item has a waiting hold.
[% END %] [% UNLESS ( action ) %] [% IF ( notfoundbarcodes ) %] -
- [% IF ( itemresults ) %]

Warning, the following barcodes were not found:

[% ELSE %]

Warning: no barcodes were found

[% END %] -
- - - - - - - - [% FOREACH notfoundbarcode IN notfoundbarcodes %] +
+ [% IF ( itemresults ) %]

Warning, the following barcodes were not found:

[% ELSE %]

Warning: no barcodes were found

[% END %] +
+
Barcode
+ + + + + + + [% FOREACH notfoundbarcode IN notfoundbarcodes %] - [% END %] - -
Barcode
[% notfoundbarcode.barcode |html %]
- [% UNLESS ( too_many_items ) %] - [% IF ( item_loop ) %]

The following barcodes were found:

[% END %] - [% END %] - [% END %] + [% END %] + + + [% UNLESS ( too_many_items ) %] + [% IF ( item_loop ) %]

The following barcodes were found:

[% END %] + [% END %] + [% END %]
@@ -80,33 +62,33 @@ $(document).ready(function(){ [% IF ( item_loop ) %] [% IF ( show ) %][% END %] -
- -

Show/hide columns: - [% FOREACH item_header_loo IN item_header_loop %] - - [% END %] -

- - - - - [% IF ( show ) %][% END %] +
+ +

Show/hide columns: + [% FOREACH item_header_loo IN item_header_loop %] + + [% END %] +

+ +
 
+ + + [% IF ( show ) %][% END %] - [% FOREACH item_header_loo IN item_header_loop %] - - [% END %] - - - + [% FOREACH item_header_loo IN item_header_loop %] + + [% END %] + + + [% FOREACH item_loo IN item_loop %] [% IF ( show ) %][% IF ( item_loo.nomod ) %] [% ELSE %][% END %][% END %] - - [% FOREACH item_valu IN item_loo.item_value %] - [% END %] - [% END %] - -
 Title [% item_header_loo.header_value %]
[% item_header_loo.header_value %]
Cannot edit[% item_valu.field |html %]
-
+ + [% FOREACH item_valu IN item_loo.item_value %] [% item_valu.field |html %] + [% END %] + [% END %] + + +
[% END %] [% IF ( simple_items_display ) %] @@ -127,14 +109,14 @@ $(document).ready(function(){ [% FOREACH itemnumber IN itemnumbers_array %] [% END %] -[% END %] +[% END %] [% IF ( itemresults ) %] -
- -

This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.

- -
+
+ +

This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.

+ +
[% IF too_many_items %] @@ -142,18 +124,18 @@ $(document).ready(function(){ [% END %] - Cancel -
-
- [% ELSE %] -

Return to batch item deletion

- [% END %] - [% END %] - + Cancel +
+
+ [% ELSE %] +

Return to batch item deletion

+ [% END %] + [% END %] + [% END %] [% IF ( action ) %] -
+

[% deleted_items %] item(s) deleted.

[% IF delete_records %]

[% deleted_records %] record(s) deleted.

[% END %] [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%] @@ -164,31 +146,31 @@ $(document).ready(function(){ Return to batch item deletion [% END %]
- [% IF ( not_deleted_items ) %] -
-

[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]

- [% IF ( not_deleted_loop ) %] - - - - - - - - - - [% FOREACH not_deleted_loo IN not_deleted_loop %] - - - - - - [% END %] - -
ItemnumberBarcodeReason
[% not_deleted_loo.itemnumber %][% IF ( CAN_user_editcatalogue_edit_items ) %][% not_deleted_loo.barcode %][% ELSE %][% not_deleted_loo.barcode %][% END %][% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]
- [% END %] -
- [% END %] + [% IF ( not_deleted_items ) %] +
+

[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]

+ [% IF ( not_deleted_loop ) %] + + + + + + + + + + [% FOREACH not_deleted_loo IN not_deleted_loop %] + + + + + + [% END %] + +
ItemnumberBarcodeReason
[% not_deleted_loo.itemnumber %][% IF ( CAN_user_editcatalogue_edit_items ) %][% not_deleted_loo.barcode %][% ELSE %][% not_deleted_loo.barcode %][% END %][% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]
+ [% END %] +
+ [% END %]

[% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%] @@ -202,4 +184,25 @@ $(document).ready(function(){ [% END %]

+ +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt index 115e4eae1a..fef86dd710 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -7,13 +8,13 @@ [% INCLUDE 'cat-search.inc' %]
@@ -24,12 +25,12 @@
Use a file -
    -
  1. +
      +
    1. -
    2. +
@@ -61,14 +62,19 @@ [% IF ( del ) %][% END %]
- Cancel + Cancel
-
+
[% INCLUDE 'tools-menu.inc' %]
+ +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt index 06805e3263..aee52e1480 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt @@ -1,85 +1,11 @@ +[% SET footerjs = 1 %] [% PROCESS 'authorities-search-results.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Batch record deletion [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -249,4 +175,83 @@ $(document).ready(function() { [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index 4a6ad6a7fb..d6432fa3e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -1,81 +1,11 @@ +[% SET footerjs = 1 %] [% PROCESS 'authorities-search-results.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Batch record modification [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -303,4 +233,79 @@ $(document).ready(function() { [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5