From e22c413b30899fb22e1f44d2e667e697c226b5a8 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 4 Dec 2025 15:42:06 +0000 Subject: [PATCH] Bug 37140: Add vendor id automatically to 952 when creating items for serials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test plan: 1) If necessary, set 952 $e in the bibliographic framework to visible in the staff interface and the editor. 2) Navigate to the serials module 3) Create a subscription with a vendor and the setting “create an item record” and save it. 4) Nagivate to serial collection. 5) Set a serial issue from status “Expected” to “Arrived” 6) The vendor in subfield “e” (Source of acquisition) in the item form is empty 7) Apply the patch 8) Hard refresh the browser and the vendor should now be pre-populated with the vendor id Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) Signed-off-by: David Nind Signed-off-by: Christian Stelzenmüller --- .../prog/en/modules/serials/serials-edit.tt | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index b7e742623b..96fb82128e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -28,23 +28,25 @@ window.open("subscription-renew.pl?op=renew&subscriptionid=" + subscriptionid, "subscription_renewal", "width=700,height=400,toolbar=false,scrollbars=yes"); } + function presetItemFieldValue(index, fieldName, presetValue) { + item_div = $("fieldset#" + index + " div.cataloguing_additem_itemlist div.items"); + // Getting subfield with correct mapping + subfield_div = $(item_div) + .find("input[name='kohafield'][value='" + fieldName + "']") + .parent(); + // Setting text field if no saved default value + if (!$(subfield_div).children("input[type='text'][name='field_value']").val()) { + $(subfield_div).children("input[type='text'][name='field_value']").val(presetValue); + } + } function unHideItems(index, labelindex, serialId) { subfield = document.getElementById(index); subfield.style.display = "block"; label = document.getElementById(labelindex); label.style.display = "none"; - // Prefilling enumcron subfield with serial enumeration/issue number - // Getting item div - item_div = $("fieldset#" + index + " div.cataloguing_additem_itemlist div.items"); - // Getting subfield with enumcron mapping - subfield_div = $(item_div).find("input[name='kohafield'][value='items.enumchron']").parent(); - // Setting text field if no saved default value - if (!$(subfield_div).children("input[type='text'][name='field_value']").val()) { - $(subfield_div) - .children("input[type='text'][name='field_value']") - .val($("#serialseq" + serialId).val()); - } + presetItemFieldValue(index, "items.enumchron", $("#serialseq" + serialId).val()); + presetItemFieldValue(index, "items.booksellerid", $("input[type='hidden'][name='bookseller']").val()); } function HideItems(index, labelindex) { subfield = document.getElementById(index); @@ -172,6 +174,7 @@ + Issue -- 2.39.5