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

Signed-off-by: Anne-Claire Bernaudin <anne-claire.bernaudin@univ-rennes1.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Owen Leonard 2017-12-21 18:20:12 +00:00 committed by Jonathan Druart
parent 0844092693
commit fbfbcae838
6 changed files with 86 additions and 76 deletions

View file

@ -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 %]

View file

@ -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 %]

View file

@ -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>
[% INCLUDE 'popup-bottom.inc' %]
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>
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]

View file

@ -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>
[% INCLUDE 'popup-bottom.inc' %]
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>
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]

View file

@ -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>
[% INCLUDE 'popup-bottom.inc' %]
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>
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]

View file

@ -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 %]