From 3348f691233de536bff77377d6f262c32462004a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 15 Dec 2017 15:27:31 +0000 Subject: [PATCH] Bug 19823: Move template JavaScript to the footer: MARC21 editor plugins This patch modifies the templates for MARC21 editor plugins so that JavaScript is included in the footer. To test, you must link the plugins to their corresponding tag + subfield (if they aren't already): In a bibliographic framework: 000 -> marc21_leader.pl 006 -> marc21_field_006.pl 007 -> marc21_field_007.pl 008 -> marc21_field_008.pl 773$t -> marc21_linking_section.tt In an authorities framework: 000 -> marc21_leader_authorities.tt 008 -> marc21_field_008_authorities.tt -> marc21_field_008_classifications.tt For each field, trigger the plugin by clicking the plugin link. Test JavaScript-driven functionality in each plugin window and confirm that your selections are correctly saved to the editor. Signed-off-by: Claire Gravely --- .../cataloguing/value_builder/marc21_field_006.tt | 89 +- .../cataloguing/value_builder/marc21_field_007.tt | 18912 ++++++++++--------- .../cataloguing/value_builder/marc21_field_008.tt | 91 +- .../value_builder/marc21_field_008_authorities.tt | 69 +- .../marc21_field_008_classifications.tt | 44 +- .../cataloguing/value_builder/marc21_leader.tt | 51 +- .../value_builder/marc21_leader_authorities.tt | 43 +- .../value_builder/marc21_linking_section.tt | 220 +- 8 files changed, 9766 insertions(+), 9753 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt index 2124634..dddc855 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt @@ -1,41 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › 006 builder [% INCLUDE 'doc-head-close.inc' %] - - - - +

006 Fixed-length data elements--Additional material characteristics--General information

@@ -61,15 +29,46 @@
Cancel
- -[% INCLUDE 'popup-bottom.inc' %] +[% MACRO jsinclude BLOCK %] + + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt index 76a4070..2d2675a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt @@ -1,7 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › 007 builder [% INCLUDE 'doc-head-close.inc' %] +

007 Physical description fixed field--General information

@@ -90,9506 +92,9506 @@
Cancel
+ +[% MACRO jsinclude BLOCK %] +[% END %] -[% INCLUDE 'popup-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt index 172549f..a33cfce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt @@ -1,42 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › 008 builder [% INCLUDE 'doc-head-close.inc' %] - - - - +

008 Fixed-length data elements--Additional material characteristics--General information

@@ -63,16 +30,48 @@ - +[% MACRO jsinclude BLOCK %] + + +[% END %] -[% INCLUDE 'popup-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_authorities.tt index 8700457..e80c679 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_authorities.tt @@ -1,7 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Authorities › 008 builder [% INCLUDE 'doc-head-close.inc' %] +

008 Fixed-length data elements

@@ -712,39 +714,42 @@
Cancel
- + document.f_pop.f38.value + + document.f_pop.f39.value; + self.close(); + return false; + } + + +[% END %] -[% INCLUDE 'popup-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_classifications.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_classifications.tt index 3072f36..e65f2aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_classifications.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_classifications.tt @@ -1,7 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Classifications › 008 builder [% INCLUDE 'doc-head-close.inc' %] +

008 Fixed-length data elements

@@ -196,24 +198,26 @@
Cancel
- -[% INCLUDE 'popup-bottom.inc' %] +[% MACRO jsinclude BLOCK %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt index a02a93e..9d1404f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt @@ -1,7 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › 000 - Leader builder [% INCLUDE 'doc-head-close.inc' %] +
@@ -316,27 +318,28 @@
Cancel
- -[% INCLUDE 'popup-bottom.inc' %] + +[% MACRO jsinclude BLOCK %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_authorities.tt index abcf570..682720f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_authorities.tt @@ -1,7 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Authorities › Leader builder [% INCLUDE 'doc-head-close.inc' %] +

000 - Leader

@@ -118,25 +120,26 @@
Cancel
- + field.value = + ' '+ + document.f_pop.f5.value + + document.f_pop.f6.value + + ' '+ + document.f_pop.f9.value + + '22 '+ + document.f_pop.f17.value + + ' '+ + '4500'; + self.close(); + return false; + } + +[% END %] -[% INCLUDE 'popup-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt index ccd01f9..0b498d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt @@ -1,113 +1,15 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloguing › plugin for links [% INCLUDE 'doc-head-close.inc' %] [% IF ( fillinput ) %] - + -

MARC21 Plugin to build links between records

[% ELSE %] - - - + +

Plugin to build links between records

[% IF ( Search ) %] @@ -219,17 +121,113 @@ [% END %]

+ [% END %] + +[% END %] - +[% MACRO jsinclude BLOCK %] + [% IF ( fillinput ) %] + + [% ELSE %] + + [% END %] + [% END %] -[% INCLUDE 'popup-bottom.inc' %] + +[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] -- 2.1.4