Bugzilla – Attachment 70069 Details for
Bug 19866
Move template JavaScript to the footer: UNIMARC editor plugins, part 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19866: Move template JavaScript to the footer: UNIMARC editor plugins, part 1
Bug-19866-Move-template-JavaScript-to-the-footer-U.patch (text/plain), 20.56 KB, created by
Owen Leonard
on 2017-12-21 17:24:43 UTC
(
hide
)
Description:
Bug 19866: Move template JavaScript to the footer: UNIMARC editor plugins, part 1
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-12-21 17:24:43 UTC
Size:
20.56 KB
patch
obsolete
>From da0f50604c0d8799e035cdaac5ea4e90b1ef440c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 21 Dec 2017 16:30:05 +0000 >Subject: [PATCH] Bug 19866: Move template JavaScript to the footer: UNIMARC > editor plugins, part 1 > >This patch updates several 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_100.tt >- unimarc_field_100_authorities.tt >- unimarc_field_105.tt >- unimarc_field_106.tt >- unimarc_field_110.tt >- unimarc_field_115a.tt >- unimarc_field_115b.tt >--- > .../cataloguing/value_builder/unimarc_field_100.tt | 95 +++++++--------------- > .../value_builder/unimarc_field_100_authorities.tt | 52 ++++++------ > .../cataloguing/value_builder/unimarc_field_105.tt | 29 ++++--- > .../cataloguing/value_builder/unimarc_field_106.tt | 27 +++--- > .../cataloguing/value_builder/unimarc_field_110.tt | 33 ++++---- > .../value_builder/unimarc_field_115a.tt | 37 +++++---- > .../value_builder/unimarc_field_115b.tt | 39 +++++---- > 7 files changed, 148 insertions(+), 164 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100.tt >index d434b63..12a394ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 100 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_100" class="cat" style="padding:1em;"> > <h3>UNIMARC field 100 builder</h3> > <form name="f_pop" action=""> >@@ -683,69 +685,34 @@ languages and obsolete typography)</option> > </table> > <p><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a> </p> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >-// GetPublicationDate(); // running directly. >-// >-// /** >-// * GetPublicationDate. >-// * This function get the publication date if it's written on 210d >-// */ >-// function GetPublicationDate() { >-// var PublicationDate = null; >-// >-// for (i=0 ; i<NbFields ; i++) { >-// if (doc.f.tag[i].value == '210' && doc.f.subfield[i].value == 'd') { >-// if (doc.f.field_value[i].value != ""){ >-// PublicationDate = doc.f.field_value[i].value; >-// document.getElementById('pubdate1').value = PublicationDate; >-// } >-// return; >-// } >-// } >-// } >-// >-// /** >-// * SetPublicationDate. >-// * This function set the publication date here >-// */ >-// function SetPublicationDate() { >-// var PublicationDate = document.getElementById('pubdate1').value; >-// if (PublicationDate == " " || !PublicationDate){ >-// return ; >-// } >-// for (i=0 ; i<NbFields ; i++) { >-// if (doc.f.tag[i].value == '210' && doc.f.subfield[i].value == 'd') { >-// doc.f.field_value[i].value = PublicationDate; >-// break; >-// } >-// } >-// } >- >- function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index %]"); >- >- document.f_pop.f1.value=document.f_pop.f1.value+' '; >- document.f_pop.f3.value=document.f_pop.f3.value+' '; >- document.f_pop.f4.value=document.f_pop.f4.value+' '; >- document.f_pop.f10.value=document.f_pop.f10.value+' '; >- document.f_pop.f14.value=document.f_pop.f14.value+' '; > >- document.f_pop.f1.value=document.f_pop.f1.value.substring(0,8); >- document.f_pop.f3.value=document.f_pop.f3.value.substring(0,4); >- document.f_pop.f4.value=document.f_pop.f4.value.substring(0,4); >- document.f_pop.f10.value=document.f_pop.f10.value.substring(0,3); >- document.f_pop.f14.value=document.f_pop.f14.value.substring(0,4); >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index %]"); >+ >+ document.f_pop.f1.value=document.f_pop.f1.value+' '; >+ document.f_pop.f3.value=document.f_pop.f3.value+' '; >+ document.f_pop.f4.value=document.f_pop.f4.value+' '; >+ document.f_pop.f10.value=document.f_pop.f10.value+' '; >+ document.f_pop.f14.value=document.f_pop.f14.value+' '; >+ >+ document.f_pop.f1.value=document.f_pop.f1.value.substring(0,8); >+ document.f_pop.f3.value=document.f_pop.f3.value.substring(0,4); >+ document.f_pop.f4.value=document.f_pop.f4.value.substring(0,4); >+ document.f_pop.f10.value=document.f_pop.f10.value.substring(0,3); >+ document.f_pop.f14.value=document.f_pop.f14.value.substring(0,4); >+ >+ 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; >+ >+ self.close(); >+ return false; >+ } >+ //]]> >+ </script> >+[% END %] > >- 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; >- >-// SetPublicationDate(); >- self.close(); >- return false; >- } >-//]]> >-</script> >-[% 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_100_authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100_authorities.tt >index e905585..a13ab33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100_authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_100_authorities.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 100 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_100" class="cat" style="padding:1em;"> > <h3>UNIMARC field 100 builder</h3> > <form name="f_pop" action=""> >@@ -348,27 +350,29 @@ languages and obsolete typography)</option> > </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; >- var field = doc.getElementById("[% index %]"); >- >- document.f_pop.f1.value=document.f_pop.f1.value+' '; >- document.f_pop.f3.value=document.f_pop.f3.value+' '; >- document.f_pop.f7.value=document.f_pop.f7.value+' '; >- >- document.f_pop.f1.value=document.f_pop.f1.value.substring(0,8); >- document.f_pop.f3.value=document.f_pop.f3.value.substring(0,3); >- document.f_pop.f7.value=document.f_pop.f7.value.substring(0,4); >- >- 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; >- >- 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 %]"); >+ >+ document.f_pop.f1.value=document.f_pop.f1.value+' '; >+ document.f_pop.f3.value=document.f_pop.f3.value+' '; >+ document.f_pop.f7.value=document.f_pop.f7.value+' '; >+ >+ document.f_pop.f1.value=document.f_pop.f1.value.substring(0,8); >+ document.f_pop.f3.value=document.f_pop.f3.value.substring(0,3); >+ document.f_pop.f7.value=document.f_pop.f7.value.substring(0,4); >+ >+ 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; >+ >+ 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_105.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_105.tt >index d6b163c..5511ef4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_105.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_105.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 105 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_105" class="cat" style="padding:1em;"> > <h3>UNIMARC field 105 builder</h3> > <form name="f_pop" action=""> >@@ -1133,17 +1135,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; >- window.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 +document.f_pop.f12.value +document.f_pop.f13.value; >+ window.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_106.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_106.tt >index 889d389..a418529 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_106.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_106.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 106 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_106" class="cat" style="padding:1em;"> > <h3>UNIMARC field 106 builder</h3> > <form name="f_pop" action=""> >@@ -83,19 +85,18 @@ supplement)</option> > </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; >- self.close(); >- return false; >- } > >-//]]> >-</script> >+[% 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> >+[% END %] > >-[% INCLUDE 'popup-bottom.inc' %] >\ No newline at end of file >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_110.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_110.tt >index 67682ba..a8ea826 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_110.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_110.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 110 builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_110" class="cat" style="padding:1em;"> > <h3>UNIMARC field 110 builder</h3> > <form name="f_pop" action=""> >@@ -591,18 +593,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() { >- 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; >- self.close(); >- return false; >- } >-//]]> >-</script> >- >-[% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ 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; >+ 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_115a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115a.tt >index 588f352..74fb33d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115a.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115a.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 115a builder</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -1189,20 +1190,22 @@ > </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.f2.value=document.f_pop.f2.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+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; >- self.close(); >- return false; >- } >-//]]> >-</script> >- >-[% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript"> >+ function report() { >+ document.f_pop.f2.value=document.f_pop.f2.value+' '; >+ document.f_pop.f2.value=document.f_pop.f2.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+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; >+ 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_115b.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115b.tt >index 64698d6..80c0105 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115b.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_115b.tt >@@ -1,7 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>UNIMARC field 115b builder</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >+ > <body id="cat_unimarc_field_115b" class="cat" style="padding:1em;"> > <h3>UNIMARC field 115b builder</h3> > <form name="f_pop" action=""> >@@ -635,21 +637,22 @@ > </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.f10.value=document.f_pop.f10.value+' '; >- document.f_pop.f10.value=document.f_pop.f10.value.substring(0,4); >- document.f_pop.f11.value=document.f_pop.f11.value+' '; >- document.f_pop.f11.value=document.f_pop.f11.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+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() { >+ document.f_pop.f10.value=document.f_pop.f10.value+' '; >+ document.f_pop.f10.value=document.f_pop.f10.value.substring(0,4); >+ document.f_pop.f11.value=document.f_pop.f11.value+' '; >+ document.f_pop.f11.value=document.f_pop.f11.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+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 %] >-- >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 19866
:
70069
|
72631
|
73248