@@ -, +, @@ revert --- C4/Reserves.pm | 5 ++++ .../intranet-tmpl/prog/en/includes/holds_table.inc | 6 ++--- .../prog/en/modules/reserve/request.tt | 27 ++++++++++------------ 3 files changed, 20 insertions(+), 18 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -1425,6 +1425,11 @@ sub _FixPriority { my $sth = $dbh->prepare($query); $sth->execute( $reserve_id ); } + elsif ( $hold && $hold->found() && $rank > 0 ) { + $hold->found(undef); + $hold->store(); + } + my @priority; # get whats left --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -26,10 +26,10 @@ - [% IF Koha.Preference('HoldsSplitQueue') == "nothing" %] + [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] + + [% END %] [% END # IF SuspendHoldsIntranet %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -798,29 +798,26 @@ } }); var prev_rank_request; - var priorities; $("select[name=rank-request]").on("focus", function() { prev_rank_request = $(this).val(); var row = $(this).parents("tr:first"); - priorities = row.parent().find("select[name=rank-request]").map( function() { - return $(this).val(); - }).get(); }).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) { - row.insertBefore(after); - } else { - row.insertAfter(after); + var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found + if( !isNaN(value) ) { //If moved to 'del' + var after = row.parent().find("tr:nth-child("+(value+1+found_holds )+")"); //Go to the row 1 after the new value (and skip found holds) + if (prev_rank_request > value) { + row.insertBefore(after); + } else { + row.insertAfter(after); + } } - var next_priority = 0; - row.parent().find("select[name=rank-request]").each(function () { - $(this).val(priorities[next_priority]); + var next_priority = 1; + $("select[name=rank-request]").each(function () { + if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds + $(this).val(next_priority); next_priority++; }); }); --