@@ -, +, @@ select priority to last (3). Do not touch other priorities. priority to last (3). Do not touch other priorities. interface. --- .../intranet-tmpl/prog/en/modules/reserve/request.tt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -161,6 +161,26 @@ function checkMultiHold() { $("#requestany").prop("checked",true); } }); + var prev_rank_request; + $("select[name=rank-request]").on("focus", function() { + prev_rank_request = $(this).val(); + }).change(function() { + var row = $(this).parents("tr:first"); + var value = parseInt($(this).val()); + var after = row.parent().find("tr:nth-child("+(value+1)+")"); + + if (prev_rank_request > value) { + row.insertBefore(after); + } else { + row.insertAfter(after); + } + + var next_priority = 1; + $("select[name=rank-request]").each(function () { + $(this).val(next_priority); + next_priority++; + }); + }); $(".clear-date").on("click",function(e){ e.preventDefault(); --