Bugzilla – Attachment 70078 Details for
Bug 19868
Move template JavaScript to the footer: UNIMARC editor plugins, part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19868: Move template JavaScript to the footer: UNIMARC editor plugins, part 2
Bug-19868-Move-template-JavaScript-to-the-footer-U.patch (text/plain), 13.75 KB, created by
Owen Leonard
on 2017-12-21 18:39:48 UTC
(
hide
)
Description:
Bug 19868: Move template JavaScript to the footer: UNIMARC editor plugins, part 2
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-12-21 18:39:48 UTC
Size:
13.75 KB
patch
obsolete
>From 8efba60224bde7d1e7e51c6544ae35287d892e7d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 21 Dec 2017 17:45:09 +0000 >Subject: [PATCH] Bug 19868: Move template JavaScript to the footer: UNIMARC > editor plugins, part 2 > >This patch updates several more UNIMARC plugin templates so that >JavaScript is included in the footer following the same pattern as other >templates which have been modified to fix Bug 17858. > >To test you do not need a UNIMARC system. > >Apply the patch and for each plugin, configure a MARC subfield (e.g. >100$a) to use that plugin. > >From the MARC edit page, trigger the plugin and confirm that changes >made in the popup window are saved to the corresponding field in the >editor. > >- unimarc_field_116.tt >- unimarc_field_117.tt >- unimarc_field_120.tt >- unimarc_field_121a.tt >- unimarc_field_121b.tt >- unimarc_field_122.tt >--- > .../cataloguing/value_builder/unimarc_field_116.tt | 29 +++++++------- > .../cataloguing/value_builder/unimarc_field_117.tt | 27 +++++++------ > .../cataloguing/value_builder/unimarc_field_120.tt | 29 +++++++------- > .../value_builder/unimarc_field_121a.tt | 24 ++++++------ > .../value_builder/unimarc_field_121b.tt | 34 ++++++++-------- > .../cataloguing/value_builder/unimarc_field_122.tt | 45 ++++++++++++---------- > 6 files changed, 100 insertions(+), 88 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_116.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_116.tt >index 13761de..9ddc3f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_116.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_116.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 116 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_116" class="cat" style="padding:1em;"> > <h3>UNIMARC field 116 builder</h3> > <form name="f_pop" action=""> >@@ -1586,16 +1588,17 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value +document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value+document.f_pop.f5.value+document.f_pop.f6.value+document.f_pop.f7.value+document.f_pop.f8.value+document.f_pop.f9.value+document.f_pop.f10.value+document.f_pop.f11.value; >- self.close(); >- return false; >- } >-//]]> >-</script> >- >-[% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value +document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value+document.f_pop.f5.value+document.f_pop.f6.value+document.f_pop.f7.value+document.f_pop.f8.value+document.f_pop.f9.value+document.f_pop.f10.value+document.f_pop.f11.value; >+ self.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_117.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_117.tt >index 6f32924..7acceaf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_117.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_117.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 117 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_117" class="cat" style="padding:1em;"> > <h3>UNIMARC field 117 builder</h3> > <form name="f_pop" action=""> >@@ -809,16 +811,17 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value +document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value+document.f_pop.f5.value; >- self.close(); >- return false; >- } >-//]]> >-</script> > >-[% INCLUDE 'popup-bottom.inc' %] >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value +document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value+document.f_pop.f5.value; >+ self.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt >index 0afa7b5..98be444 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 120 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_120" class="cat" style="padding:1em;"> > <h3>UNIMARC field 120 builder</h3> > <form name="f_pop" action=""> >@@ -1122,16 +1124,17 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value +document.f_pop.f6.value +document.f_pop.f7.value +document.f_pop.f8.value +document.f_pop.f9.value +document.f_pop.f10.value; >- self.close(); >- return false; >- } >-//]]> >-</script> >- >-[% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value +document.f_pop.f6.value +document.f_pop.f7.value +document.f_pop.f8.value +document.f_pop.f9.value +document.f_pop.f10.value; >+ self.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt >index bbd5ca0..0514923 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 121a builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_121a" class="cat" style="padding:1em;"> > <h3>UNIMARC field 121a builder</h3> > <form name="f_pop" action=""> >@@ -335,18 +337,18 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { > >- var doc = opener.document; >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var doc = opener.document; > var field = doc.getElementById("[% index %]"); >- >+ > field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value +document.f_pop.f6.value +document.f_pop.f7.value +document.f_pop.f8.value; >- self.close(); >- return false; >- } >-//]]> >-</script> >+ self.close(); >+ return false; >+ } >+ </script> >+[% 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/unimarc_field_121b.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121b.tt >index 19a579c..cdeaea5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121b.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121b.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 121b builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_121b" class="cat" style="padding:1em;"> > <h3>UNIMARC field 121b builder</h3> > <form name="f_pop" action=""> >@@ -244,24 +246,20 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- >-document.f_pop.f3.value=document.f_pop.f3.value+' '; >- >- >- >-document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2); > >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ document.f_pop.f3.value=document.f_pop.f3.value+' '; > >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value +document.f_pop.f6.value +document.f_pop.f7.value; >- self.close(); >- return false; >- } >-//]]> >-</script> >+ document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2); >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value +document.f_pop.f6.value +document.f_pop.f7.value; >+ self.close(); >+ return false; >+ } >+ </script> >+[% 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/unimarc_field_122.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_122.tt >index 298f3be..6e61d04 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_122.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_122.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 122 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_122" class="cat" style="padding:1em;"> > <h3>UNIMARC field 122 builder</h3> > <form name="f_pop" action=""> >@@ -39,26 +41,27 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- document.f_pop.f2.value=document.f_pop.f2.value+' '; >- document.f_pop.f3.value=document.f_pop.f3.value+' '; >- document.f_pop.f4.value=document.f_pop.f4.value+' '; >- document.f_pop.f5.value=document.f_pop.f5.value+' '; >- document.f_pop.f2.value=document.f_pop.f2.value.substring(0,4); >- document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2); >- document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2); >- document.f_pop.f5.value=document.f_pop.f5.value.substring(0,2); > >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- >- field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value ; >- window.close(); >- return false; >-} >-//]]> >-</script> >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ document.f_pop.f2.value=document.f_pop.f2.value+' '; >+ document.f_pop.f3.value=document.f_pop.f3.value+' '; >+ document.f_pop.f4.value=document.f_pop.f4.value+' '; >+ document.f_pop.f5.value=document.f_pop.f5.value+' '; >+ document.f_pop.f2.value=document.f_pop.f2.value.substring(0,4); >+ document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2); >+ document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2); >+ document.f_pop.f5.value=document.f_pop.f5.value.substring(0,2); >+ >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ >+ field.value = document.f_pop.f1.value + document.f_pop.f2.value +document.f_pop.f3.value +document.f_pop.f4.value +document.f_pop.f5.value ; >+ window.close(); >+ return false; >+ } >+ </script> >+[% END %] > >-[% INCLUDE 'popup-bottom.inc' %] >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19868
:
70078
|
72636
|
73249