Bug 19469: (QA follow-up) Use hold item's itemtype if available, fix priority changing

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2018-04-17 14:29:27 +00:00 committed by Nick Clemens
parent fac3944aa1
commit 765c28c8e3
2 changed files with 12 additions and 5 deletions

View File

@ -551,14 +551,16 @@
[% SET itemtypes = [] %]
[% FOREACH h IN biblioloo.reserveloop %]
[% itemtypes.push( h.itemtype ) %]
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
[% itemtypes_all.push( hold_itemtype ) %]
[% END %]
[% itemtypes = itemtypes.unique %]
[% FOREACH i IN itemtypes.sort %]
[% SET holds_by_itemtype = [] %]
[% FOREACH h IN biblioloo.reserveloop %]
[% IF h.itemtype == i %]
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
[% IF hold_itemtype == i %]
[% holds_by_itemtype.push( h ) %]
[% END %]
[% END %]
@ -592,7 +594,8 @@
[% SET itemtypes = [] %]
[% FOREACH h IN holds_by_branch %]
[% itemtypes.push( h.itemtype ) %]
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
[% itemtypes.push( hold_itemtype ) %]
[% END %]
[% itemtypes = itemtypes.unique %]
@ -606,7 +609,8 @@
[% SET holds_by_itemtype = [] %]
[% FOREACH h IN holds_by_branch %]
[% IF h.itemtype == i %]
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %]
[% IF hold_itemtype == i %]
[% holds_by_itemtype.push( h ) %]
[% END %]
[% END %]
@ -797,6 +801,8 @@
}).change(function() {
var row = $(this).parents("tr:first");
var value = parseInt($(this).val());
var rowsCount = row.parent().children('tr').length - 1;
value = value > rowsCount ? rowsCount : value;
var after = row.parent().find("tr:nth-child("+(value+1)+")");
if (prev_rank_request > value) {
@ -806,7 +812,7 @@
}
var next_priority = 1;
$("select[name=rank-request]").each(function () {
row.parent().find("select[name=rank-request]").each(function () {
$(this).val(next_priority);
next_priority++;
});

View File

@ -590,6 +590,7 @@ foreach my $biblionumber (@biblionumbers) {
$reserve{'reserve_id'} = $res->reserve_id();
$reserve{itemtype} = $res->itemtype();
$reserve{branchcode} = $res->branchcode();
$reserve{object} = $res;
push( @reserveloop, \%reserve );
}