From a569743e7c6aaa55d07c8d016001441afbb0b3a9 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 4 Apr 2006 14:02:50 +0000 Subject: [PATCH] * porting npl improvements to default theme * NEW IMPROVEMENT : tag repeat can be done with javascript only (no server call). Look/search "CloneTag" --- .../default/en/acqui.simple/addbiblio.tmpl | 856 +++++++++++------- 1 file changed, 529 insertions(+), 327 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl index 54ebd37f04..7dc58e84f6 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -60,413 +60,590 @@ - - -

- "> + +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
- -

- "> +

"> + +

+ "> + + "> + "> - + + "> + + + ')">+ +

+ + + + " onclick="unHideSubfield('subfield','label')"> + + + +

+ +

- - -

- - - "> - " size="2" maxlength="1"> - "> - "> - "> + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> + "/>

- - +
+ +
+ +
@@ -628,23 +805,48 @@ function AddField(field) { document.f.submit(); } +function cloneSubfield(index) { + var original = document.getElementById(index); + var clone = original.cloneNode(true); + clone.setAttribute("id", index + index); +// orginput : the value of the original field (in [0] if hide_marc=1, otherwise in [1] +// image : the up button. don't exist is hide_marc=1 + + var orginput = original.getElementsByTagName('input')[0]; + + var orginput = original.getElementsByTagName('input')[1]; + image = clone.getElementsByTagName('img')[0]; + image.setAttribute("onclick","upSubfield('" + index + index + "')"); + + trigger = original.getElementsByTagName('a')[0]; + if (trigger) { + trigger.parentNode.removeChild(trigger); + } + clonetrigger = clone.getElementsByTagName('a')[0]; + clonetrigger.setAttribute("onclick","cloneSubfield('" + index + index + "')"); + clone.setAttribute("tabindex","1"); + orginput.value = ''; + original.parentNode.insertBefore( clone, original.nextSibling); +} + +function cloneTag(index) { + var original = document.getElementById(index); + var clone = original.cloneNode(true); + clone.setAttribute("id", index + index); + original.parentNode.insertBefore( clone, original.nextSibling); +} + function upSubfield(index) { -// alert("UP "+index); - temp = document.forms['f'].field_value[index-1].value; - document.forms['f'].field_value[index-1].value=document.forms['f'].field_value[index].value; - document.forms['f'].field_value[index].value= temp; - temp = document.forms['f'].subfield[index-1].value; - document.forms['f'].subfield[index-1].value=document.forms['f'].subfield[index].value; - document.forms['f'].subfield[index].value = temp; - temp = document.forms['f'].mandatory[index-1].value; - document.forms['f'].mandatory[index-1].value=document.forms['f'].mandatory[index].value; - document.forms['f'].mandatory[index].value = temp; - temp = document.forms['f'].kohafield[index-1].value; - document.forms['f'].kohafield[index-1].value=document.forms['f'].kohafield[index].value; - document.forms['f'].kohafield[index].value = temp; -// temp = document.getElementById('error'+index).value = "XXX"; -// document.forms['f'].kohafield[index-1].value=document.forms['f'].kohafield[index].value; -// document.forms['f'].kohafield[index].value = temp; +var original = document.getElementById(index); +var previous = original.previousSibling; +original.parentNode.insertBefore( original, previous ); +} + +function unHideSubfield(index,labelindex) { + subfield = document.getElementById(index); + subfield.style.display = 'block'; + label = document.getElementById(labelindex); + label.style.display='none'; } -- 2.39.5