Bug 15643 - Every datepicker on serials expected date column updates top issue

delete 'expected' and 'supexpected' ids that don't seem useful anymore.
Same thing for changeDate2 function

Test plan :
1) Search a serial subscription from the Serials Home page
2)Go to serial collection page and make sure it has a mimimal bunch of
already received  or missing issues
3)Check some received issues to be sure to get extra issues (not only
the extected one) in the serial edition page
4) Click on Edit serials button
5) Try to modify whatever date in 'Expected on' column (excepted first
one) using datepicker :
You can see that the top date of the column is updated instead of the
choosen one.
6) Apply patch and redo 1 to 5 steps :
now the right date is updated.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Lyon3 Team 2016-01-26 12:40:11 +01:00 committed by Brendan Gallagher
parent d6dc21bc3c
commit 4c6214f5c9

View file

@ -41,11 +41,7 @@ function setStatus(serialid){
$("#status"+serialid).val("2").attr("selected","selected");
}
function changeDate(elem, adate) {
$(elem).closest('tr').find('#expecteddate').val(adate);
}
function changeDate2(adate) {
var elem = document.getElementById("supexpecteddate");
elem.value = adate;
$(elem).closest('tr').find('[name=planneddate]').val(adate);
}
$(document).ready(function() {
@ -139,7 +135,7 @@ $(document).ready(function() {
<input type="text" name="publisheddatetext" value="[% serialslis.publisheddatetext %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" id="expecteddate" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" class="datepicker" />
<input type="text" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
[% IF ( serialslis.editdisable ) %]
@ -296,10 +292,10 @@ $(document).ready(function() {
<input type="text" name="publisheddatetext" value="[% newserialloo.publisheddatetext %]" size="10" maxlength="100" />
</td>
<td>
<input type="text" name="planneddate" id="supexpecteddate" value="[% newserialloo.planneddate %]" size="10" maxlength="15" class="datepicker" />
<input type="text" name="planneddate" value="[% newserialloo.planneddate %]" size="10" maxlength="15" class="datepicker" />
</td>
<td>
<select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate2('[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate('[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate2('[% serialslis.planneddate %]')}" >
<select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate(this, '[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate(this, '[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate(this, '[% serialslis.planneddate %]')}" >
<option value="">----</option>
[% IF ( newserialloo.status1 ) %]