|
Lines 169-174
function checkMultiHold() {
Link Here
|
| 169 |
}).change(function() { |
169 |
}).change(function() { |
| 170 |
var row = $(this).parents("tr:first"); |
170 |
var row = $(this).parents("tr:first"); |
| 171 |
var value = parseInt($(this).val()); |
171 |
var value = parseInt($(this).val()); |
|
|
172 |
var rowsCount = row.parent().children('tr').length - 1; |
| 173 |
value = value > rowsCount ? rowsCount : value; |
| 172 |
var after = row.parent().find("tr:nth-child("+(value+1)+")"); |
174 |
var after = row.parent().find("tr:nth-child("+(value+1)+")"); |
| 173 |
|
175 |
|
| 174 |
if (prev_rank_request > value) { |
176 |
if (prev_rank_request > value) { |
|
Lines 178-184
function checkMultiHold() {
Link Here
|
| 178 |
} |
180 |
} |
| 179 |
|
181 |
|
| 180 |
var next_priority = 1; |
182 |
var next_priority = 1; |
| 181 |
$("select[name=rank-request]").each(function () { |
183 |
row.parent().find("select[name=rank-request]").each(function () { |
| 182 |
$(this).val(next_priority); |
184 |
$(this).val(next_priority); |
| 183 |
next_priority++; |
185 |
next_priority++; |
| 184 |
}); |
186 |
}); |
|
Lines 759-772
function checkMultiHold() {
Link Here
|
| 759 |
[% SET itemtypes = [] %] |
761 |
[% SET itemtypes = [] %] |
| 760 |
|
762 |
|
| 761 |
[% FOREACH h IN biblioloo.reserveloop %] |
763 |
[% FOREACH h IN biblioloo.reserveloop %] |
| 762 |
[% itemtypes.push( h.itemtype ) %] |
764 |
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %] |
|
|
765 |
[% itemtypes_all.push( hold_itemtype ) %] |
| 763 |
[% END %] |
766 |
[% END %] |
| 764 |
[% itemtypes = itemtypes.unique %] |
767 |
[% itemtypes = itemtypes.unique %] |
| 765 |
|
768 |
|
| 766 |
[% FOREACH i IN itemtypes.sort %] |
769 |
[% FOREACH i IN itemtypes.sort %] |
| 767 |
[% SET holds_by_itemtype = [] %] |
770 |
[% SET holds_by_itemtype = [] %] |
| 768 |
[% FOREACH h IN biblioloo.reserveloop %] |
771 |
[% FOREACH h IN biblioloo.reserveloop %] |
| 769 |
[% IF h.itemtype == i %] |
772 |
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %] |
|
|
773 |
[% IF hold_itemtype == i %] |
| 770 |
[% holds_by_itemtype.push( h ) %] |
774 |
[% holds_by_itemtype.push( h ) %] |
| 771 |
[% END %] |
775 |
[% END %] |
| 772 |
[% END %] |
776 |
[% END %] |
|
Lines 800-806
function checkMultiHold() {
Link Here
|
| 800 |
|
804 |
|
| 801 |
[% SET itemtypes = [] %] |
805 |
[% SET itemtypes = [] %] |
| 802 |
[% FOREACH h IN holds_by_branch %] |
806 |
[% FOREACH h IN holds_by_branch %] |
| 803 |
[% itemtypes.push( h.itemtype ) %] |
807 |
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %] |
|
|
808 |
[% itemtypes.push( hold_itemtype ) %] |
| 804 |
[% END %] |
809 |
[% END %] |
| 805 |
[% itemtypes = itemtypes.unique %] |
810 |
[% itemtypes = itemtypes.unique %] |
| 806 |
|
811 |
|
|
Lines 814-820
function checkMultiHold() {
Link Here
|
| 814 |
|
819 |
|
| 815 |
[% SET holds_by_itemtype = [] %] |
820 |
[% SET holds_by_itemtype = [] %] |
| 816 |
[% FOREACH h IN holds_by_branch %] |
821 |
[% FOREACH h IN holds_by_branch %] |
| 817 |
[% IF h.itemtype == i %] |
822 |
[% SET hold_itemtype = h.object.item.effective_itemtype || h.itemtype %] |
|
|
823 |
[% IF hold_itemtype == i %] |
| 818 |
[% holds_by_itemtype.push( h ) %] |
824 |
[% holds_by_itemtype.push( h ) %] |
| 819 |
[% END %] |
825 |
[% END %] |
| 820 |
[% END %] |
826 |
[% END %] |