Bugzilla – Attachment 73253 Details for
Bug 19877
Move template JavaScript to the footer: UNIMARC editor plugins, part 6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19877: Move template JavaScript to the footer: UNIMARC editor plugins, part 6
Bug-19877-Move-template-JavaScript-to-the-footer-U.patch (text/plain), 14.50 KB, created by
Katrin Fischer
on 2018-03-25 18:48:10 UTC
(
hide
)
Description:
Bug 19877: Move template JavaScript to the footer: UNIMARC editor plugins, part 6
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-03-25 18:48:10 UTC
Size:
14.50 KB
patch
obsolete
>From b679835593ff4a46420d868b84a7a2eb7f5a2d56 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 22 Dec 2017 16:32:57 +0000 >Subject: [PATCH] Bug 19877: Move template JavaScript to the footer: UNIMARC > editor plugins, part 6 > >This patch updates more UNIMARC plugin templates than ever before, 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_128a.tt >- unimarc_field_128b.tt >- unimarc_field_128c.tt >- unimarc_field_130.tt >- unimarc_field_135a.tt >- unimarc_field_140.tt >- unimarc_field_141.tt > >Signed-off-by: delaye <stephane.delaye@biblibre.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../value_builder/unimarc_field_128a.tt | 28 +++++++++++--------- > .../value_builder/unimarc_field_128b.tt | 27 ++++++++++--------- > .../value_builder/unimarc_field_128c.tt | 24 +++++++++-------- > .../cataloguing/value_builder/unimarc_field_130.tt | 28 +++++++++++--------- > .../value_builder/unimarc_field_135a.tt | 22 +++++++++------- > .../cataloguing/value_builder/unimarc_field_140.tt | 28 +++++++++++--------- > .../cataloguing/value_builder/unimarc_field_141.tt | 30 ++++++++++++---------- > 7 files changed, 107 insertions(+), 80 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128a.tt >index 88d7f8c..bba00eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128a.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128a.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 128a builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_128a" class="cat" style="padding:1em;"> > <h3>UNIMARC field 128a builder</h3> > <form name="f_pop" action=""> >@@ -365,16 +367,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; >- var field = doc.getElementById("[% index %]"); >- field.value = document.f_pop.f1.value; >- window.close(); >- return false; >- } >-//]]> >-</script> > >-[% INCLUDE 'popup-bottom.inc' %] >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ field.value = document.f_pop.f1.value; >+ window.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% 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/unimarc_field_128b.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128b.tt >index 9f302ae..e92cbb6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128b.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128b.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 128b builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_128b" class="cat" style="padding:1em;"> > <h3>UNIMARC field 128b builder</h3> > <form name="f_pop" action=""> >@@ -461,17 +463,18 @@ > </table> > <fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="javascript"> >-//<![CDATA[ >- function report() { >- var doc = opener.document; >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ function report() { >+ var doc = opener.document; > var field = doc.getElementById("[% index %]"); >- >- field.value = document.f_pop.f1.value; >- self.close(); >- return false; >- } >-//]]> >-</script> >+ field.value = document.f_pop.f1.value; >+ window.close(); >+ return false; >+ } >+ </script> >+[% 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/unimarc_field_128c.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128c.tt >index 50a8be0..d5aa78d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128c.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_128c.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 128c builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_128c" class="cat" style="padding:1em;"> > <h3>UNIMARC field 128c builder</h3> > <form name="f_pop" action=""> >@@ -455,16 +457,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"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ function report() { >+ var doc = opener.document; > var field = doc.getElementById("[% index %]"); > field.value = document.f_pop.f1.value; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.close(); >+ return false; >+ } >+ </script> >+[% 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/unimarc_field_130.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_130.tt >index 6b07582..b486896 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_130.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_130.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 130 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_130" class="cat" style="padding:1em;"> > <h3>UNIMARC field 130 builder</h3> > <form name="f_pop" action=""> >@@ -325,18 +327,20 @@ value="[% f5 %]" /></td> > </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.f5.value=document.f_pop.f5.value+' '; >- document.f_pop.f5.value=document.f_pop.f5.value.substring(0,3); >- var doc = opener.document; >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ function report() { >+ document.f_pop.f5.value=document.f_pop.f5.value+' '; >+ document.f_pop.f5.value=document.f_pop.f5.value.substring(0,3); >+ 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 ; >- window.close(); >- return false; >- } >-//]]> >-</script> >+ window.close(); >+ return false; >+ } >+ </script> >+[% 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/unimarc_field_135a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_135a.tt >index 4483cf3..cd106f7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_135a.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_135a.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 135a builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_135a" class="cat" style="padding:1em;"> > <h3>UNIMARC field 135a builder</h3> > <form name="f_pop" action=""> >@@ -56,17 +58,19 @@ > </table> > <p><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></p> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >- function report() { >- var doc = opener.document; >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ function report() { >+ var doc = opener.document; > var field = doc.getElementById("[% index %]"); >- >+ > field.value = document.f_pop.f1.value; > window.close(); > return false; >- } >-//]]> >-</script> >+ } >+ </script> >+[% 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/unimarc_field_140.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_140.tt >index 585f1a0..c1eaf92 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_140.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_140.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 140 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_140" class="cat" style="padding:1em;"> > <h3>UNIMARC field 140 builder</h3> > <form name="f_pop" action=""> >@@ -1721,16 +1723,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; >- 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+document.f_pop.f12.value+document.f_pop.f13.value+document.f_pop.f14.value+document.f_pop.f15.value+document.f_pop.f16.value+document.f_pop.f17.value+document.f_pop.f18.value+document.f_pop.f19.value+document.f_pop.f20.value+document.f_pop.f21.value; >- self.close(); >- return false; >- } >-//]]> >-</script> > >-[% INCLUDE 'popup-bottom.inc' %] >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ 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+document.f_pop.f12.value+document.f_pop.f13.value+document.f_pop.f14.value+document.f_pop.f15.value+document.f_pop.f16.value+document.f_pop.f17.value+document.f_pop.f18.value+document.f_pop.f19.value+document.f_pop.f20.value+document.f_pop.f21.value; >+ self.close(); >+ return false; >+ } >+ </script> >+[% END %] >+ >+[% 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/unimarc_field_141.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_141.tt >index a7ffe28..6b1d6d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_141.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_141.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 141 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_141" class="cat" style="padding:1em;"> > <h3>UNIMARC field 141 builder</h3> > <form name="f_pop" action=""> >@@ -364,17 +366,19 @@ > </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; >- self.close(); >- return false; >- } >-//]]> >-</script> > >-[% INCLUDE 'popup-bottom.inc' %] >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ var dateformat = "[% Koha.Preference('dateformat') %]"; >+ 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> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >\ No newline at end of file >-- >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 19877
:
70134
|
72864
| 73253