From 0e8880d56271987adadfa8656529c4158f5ac184 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 13 Nov 2009 13:43:48 +0100 Subject: [PATCH] (MT 1970) fix javascript This fix javascript to add a supplemental issue that was broken. --- .../prog/en/modules/serials/serials-edit.tmpl | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl index 90bc9fa659..886d17baaa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl @@ -60,11 +60,20 @@ function Check(f) { alert(alertString2); } } -function unHideItems(index,labelindex) { +function unHideItems(index,labelindex, serialId) { subfield = document.getElementById(index); subfield.style.display = 'block'; label = document.getElementById(labelindex); label.style.display='none'; + + // Prefilling 995$v with issue number + // Getting item id + itemid = $("fieldset#" + index + " div.cataloguing_additem_itemlist div.items").attr("id"); + // Getting subfield id + subfieldid = "subfield" + itemid.substr(4) + "v"; + // Setting text field + $("#" + subfieldid + " input[type='text']").val($("#serialseq" + serialId).val()); + } function HideItems(index,labelindex) { subfield = document.getElementById(index); @@ -191,7 +200,7 @@ function CloneSubfield(index){ " /> " /> " /> - Issue " size="20" maxlength="100" /> + Issue " value="" size="20" maxlength="100" /> " size="10" maxlength="15" /> @@ -205,7 +214,7 @@ function CloneSubfield(index){ " onchange="if (this.value==2){unHideItems('items'++,'label')} else { HideItems('items'++,'label')}" > + " > @@ -254,7 +263,7 @@ function CloneSubfield(index){ - " style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items','label')"> + " style="color: grey; font-size: 80%; cursor: pointer;" onclick="unHideItems('items','label', '')"> Click to add item