[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/acqui.s... [rel_2_2]
From: |
Antoine Farnault |
Subject: |
[Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/acqui.s... [rel_2_2] |
Date: |
Wed, 27 Sep 2006 14:17:29 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: Antoine Farnault <toins> 06/09/27 14:17:29
Modified files:
koha-tmpl/intranet-tmpl/default/en/acqui.simple: addbiblio.tmpl
Log message:
fix bug in MARC editor, when you have hide_marc=ON and want to repeat a
subfield that is the only subfield of the field
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.33.2.32&r2=1.33.2.33
Patches:
Index: addbiblio.tmpl
===================================================================
RCS file:
/sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/acqui.simple/Attic/addbiblio.tmpl,v
retrieving revision 1.33.2.32
retrieving revision 1.33.2.33
diff -u -b -r1.33.2.32 -r1.33.2.33
--- addbiblio.tmpl 8 Sep 2006 09:07:45 -0000 1.33.2.32
+++ addbiblio.tmpl 27 Sep 2006 14:17:29 -0000 1.33.2.33
@@ -308,27 +308,31 @@
}
function cloneSubfield(index) {
- var original = document.getElementById(index);
+ var original = document.getElementById(index); //original <div>
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
- <!-- TMPL_IF name="hide_marc" -->
- var orginput = original.getElementsByTagName('input')[0];
- <!-- TMPL_ELSE -->
- var orginput = original.getElementsByTagName('input')[1];
- image = clone.getElementsByTagName('img')[0];
- image.setAttribute("onclick","upSubfield('" + index + index + "')");
- <!-- /TMPL_IF -->
- 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);
+
+ // set the attribute for the new 'div' subfields
+ clone.setAttribute('id',index + index);//set another id.
+ var NumTabIndex;
+ NumTabIndex = parseInt(original.getAttribute('tabindex'));
+ if(isNaN(NumTabIndex)) NumTabIndex = 0;
+ clone.setAttribute('tabindex',NumTabIndex+1);
+
+ var ButtonPlus;
+ var CloneButtonPlus;
+ try{
+ ButtonPlus = original.getElementsByTagName('a')[0]; // getting the
'<a href=...>+</a>
+ ButtonPlus.parentNode.removeChild(ButtonPlus); // removing the '+'
button
+
+ CloneButtonPlus = clone.getElementsByTagName('a')[0];
+ CloneButtonPlus.setAttribute('onclick',"cloneSubfield('" + index +
index + "')");
+ }
+ catch(e){
+ // do nothig if ButtonPlus & CloneButtonPlus don't exist.
+ }
+
+ // insert this line on the page
+ original.parentNode.insertBefore(clone,original.nextSibling);
}
function upSubfield(index) {