From 79c2c91b07c1ca83292fbd263c41cb8fb79a3c7d Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 24 Sep 2009 10:13:28 +0200 Subject: [PATCH] MT 1970 : Automatically add issue number when receiving serial --- .../prog/en/modules/serials/serials-edit.tmpl | 22 ++++++++++++++----- 1 file changed, 16 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 a65284ae80..e4815cc1c0 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,21 @@ 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'; + console.log(index, labelindex); + + // 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 +201,7 @@ function CloneSubfield(index){ " /> " /> " /> - Issue " size="20" maxlength="100" /> + Issue " value="" size="20" maxlength="100" /> " size="10" maxlength="15" /> @@ -205,7 +215,7 @@ function CloneSubfield(index){ " onchange="if (this.value==2){unHideItems('items'++,'label')} else { HideItems('items'++,'label')}" > + " > @@ -254,7 +264,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