Bugzilla – Attachment 70080 Details for
Bug 19869
Move template JavaScript to the footer: UNIMARC editor plugins, part 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19869: Move template JavaScript to the footer: UNIMARC editor plugins, part 3
Bug-19869-Move-template-JavaScript-to-the-footer-U.patch (text/plain), 11.87 KB, created by
Owen Leonard
on 2017-12-21 19:15:14 UTC
(
hide
)
Description:
Bug 19869: Move template JavaScript to the footer: UNIMARC editor plugins, part 3
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-12-21 19:15:14 UTC
Size:
11.87 KB
patch
obsolete
>From 014db4990822adfbd7f8b55317c87164f8f644c5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 21 Dec 2017 18:20:12 +0000 >Subject: [PATCH] Bug 19869: Move template JavaScript to the footer: UNIMARC > editor plugins, part 3 > >This patch updates even 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_123a.tt >- unimarc_field_123d.tt >- unimarc_field_123e.tt >- unimarc_field_123f.tt > - This template has been modified, but doesn't appear to be used. The > unimarc_field_1234.pl script uses unimarc_field_123g.tt as its > template. >- unimarc_field_123g.tt >- unimarc_field_123i_j.tt >--- > .../value_builder/unimarc_field_123a.tt | 23 ++++++------- > .../value_builder/unimarc_field_123d.tt | 23 ++++++------- > .../value_builder/unimarc_field_123e.tt | 24 +++++++------- > .../value_builder/unimarc_field_123f.tt | 24 +++++++------- > .../value_builder/unimarc_field_123g.tt | 24 +++++++------- > .../value_builder/unimarc_field_123i_j.tt | 38 ++++++++++++---------- > 6 files changed, 83 insertions(+), 73 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123a.tt >index 10c8408..b48869e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123a.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123a.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123a builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -30,17 +31,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; >+ >+[% 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; >- 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_123d.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123d.tt >index 90cdd6a..54cb77f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123d.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123d.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123d builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -46,9 +47,10 @@ > </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() { >+ >+[% 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+' '; >@@ -56,14 +58,13 @@ > 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); > >- var doc = opener.document; >+ 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; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.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_123e.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123e.tt >index 7fc52dd..ea2cf43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123e.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123e.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123e builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -46,9 +47,10 @@ > </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() { >+ >+[% 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+' '; >@@ -56,14 +58,14 @@ > 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); > >- var doc = opener.document; >+ 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; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.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_123f.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123f.tt >index 8a87afa..bb0d414 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123f.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123f.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123f builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -46,9 +47,10 @@ > </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() { >+ >+[% 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+' '; >@@ -56,14 +58,14 @@ > 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); > >- var doc = opener.document; >+ 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; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.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_123g.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123g.tt >index 0eb1cf9..d256865 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123g.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123g.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123g builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -46,9 +47,10 @@ > </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() { >+ >+[% 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+' '; >@@ -56,14 +58,14 @@ > 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); > >- var doc = opener.document; >+ 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; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.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_123i_j.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt >index 898953d..41381a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 123i/j builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -36,22 +37,23 @@ > </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 f2= "000" + document.f_pop.f2.value; >- f2 = f2.substring(f2.length-3); >- var f3= "00" + document.f_pop.f3.value; >- f3 = f3.substring(f3.length-2); >- var f4= "00" + document.f_pop.f4.value; >- f4 = f4.substring(f4.length-2); >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value+ f2 + f3 + f4; >- window.close(); >- return false; >- } >-//]]> >-</script> > >-[% INCLUDE 'popup-bottom.inc' %] >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var f2= "000" + document.f_pop.f2.value; >+ f2 = f2.substring(f2.length-3); >+ var f3= "00" + document.f_pop.f3.value; >+ f3 = f3.substring(f3.length-2); >+ var f4= "00" + document.f_pop.f4.value; >+ f4 = f4.substring(f4.length-2); >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value+ f2 + f3 + f4; >+ window.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% 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 19869
:
70080
|
72994
|
73250