From 1bd23cd4a99aebec0b61350f1b7dba55adfda006 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Tue, 9 Aug 2011 16:22:24 -0400 Subject: [PATCH] Corrects a problem with the wrong date being updated in serials-edit.pl If multiple issues are in the list, changing the status of any issue in the table would always change the "Expected on" date of the first issue. Modified the javascript so the date is modified on the correct row. --- .../prog/en/modules/serials/serials-edit.tmpl | 9 ++++----- 1 files changed, 4 insertions(+), 5 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 c2b724b..f8a996f 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 @@ -84,9 +84,8 @@ function HideItems(index,labelindex) { function setStatus(serialid){ $("#status"+serialid).val("2").attr("selected","selected"); } -function changeDate(adate) { - var elem = document.getElementById("expecteddate"); - elem.value = adate; +function changeDate(elem,adate) { + $(elem).closest('tr').find('#expecteddate').val(adate); } function changeDate2(adate) { var elem = document.getElementById("supexpecteddate"); @@ -231,9 +230,9 @@ function CloneSubfield(index){ " onchange="if (this.value==2){unHideItems('items'+,'label',''); changeDate('')} else if (this.value==7){changeDate('')} else { HideItems('items'++,'label'); changeDate('')}" > + " onchange="if (this.value==2 || this.value==7){changeDate('')} else {changeDate('')}" > +