Lines 933-950
Link Here
|
933 |
<h2>Existing holds</h2> |
933 |
<h2>Existing holds</h2> |
934 |
<div id="toolbar" class="btn-toolbar"> |
934 |
<div id="toolbar" class="btn-toolbar"> |
935 |
<input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button> |
935 |
<input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button> |
936 |
<fieldset id="cancellation-reason-fieldset" class="action"> |
|
|
937 |
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] |
938 |
[% IF hold_cancellation %] |
939 |
<label for="cancellation-reason">Cancellation reason: </label> |
940 |
<select class="cancellation-reason" name="cancellation-reason" id="cancellation-reason"> |
941 |
<option value="">No reason given</option> |
942 |
[% FOREACH reason IN hold_cancellation %] |
943 |
<option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> |
944 |
[% END %] |
945 |
</select> |
946 |
[% END %] |
947 |
</fieldset> |
948 |
</div> |
936 |
</div> |
949 |
|
937 |
|
950 |
[% FOREACH biblioloo IN biblioloop %] |
938 |
[% FOREACH biblioloo IN biblioloop %] |
Lines 1181-1194
Link Here
|
1181 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1169 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1182 |
|
1170 |
|
1183 |
$(document).ready(function() { |
1171 |
$(document).ready(function() { |
1184 |
$('#cancellation-reason-fieldset').hide(); |
|
|
1185 |
$('.rank-request').on('change', function() { |
1186 |
if ( $(".rank-request option:selected[value='del']").length ) { |
1187 |
$('#cancellation-reason-fieldset').show(); |
1188 |
} else { |
1189 |
$('#cancellation-reason-fieldset').hide(); |
1190 |
} |
1191 |
}); |
1192 |
|
1172 |
|
1193 |
[% SET active = clubs ? 1 : 0 %] |
1173 |
[% SET active = clubs ? 1 : 0 %] |
1194 |
$('#circ_holds_select').tabs({ |
1174 |
$('#circ_holds_select').tabs({ |
Lines 1450-1462
Link Here
|
1450 |
} |
1430 |
} |
1451 |
}); |
1431 |
}); |
1452 |
var prev_rank_request; |
1432 |
var prev_rank_request; |
1453 |
$("select[name=rank-request]").on("focus", function() { |
1433 |
$("input[name=rank-request]").change(function() { |
1454 |
prev_rank_request = $(this).val(); |
1434 |
prev_rank_request = $(this).data('current_value'); |
1455 |
var row = $(this).parents("tr:first"); |
|
|
1456 |
}).change(function() { |
1457 |
var row = $(this).parents("tr:first"); |
1435 |
var row = $(this).parents("tr:first"); |
1458 |
var value = parseInt($(this).val()); |
1436 |
var value = parseInt($(this).val()); |
1459 |
var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found |
1437 |
var found_holds = $("input[name='rank-request'].found").length ; //Count how many are found |
|
|
1438 |
console.log( found_holds); |
1460 |
if( !isNaN(value) ) { //If moved to 'del' |
1439 |
if( !isNaN(value) ) { //If moved to 'del' |
1461 |
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) |
1440 |
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) |
1462 |
if (prev_rank_request > value) { |
1441 |
if (prev_rank_request > value) { |
Lines 1467-1475
Link Here
|
1467 |
} |
1446 |
} |
1468 |
|
1447 |
|
1469 |
var next_priority = 1; |
1448 |
var next_priority = 1; |
1470 |
$("select[name=rank-request]").each(function () { |
1449 |
$("input[name=rank-request]").each(function () { |
1471 |
if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds |
1450 |
if( isNaN( $(this).val() ) || $(this).val() == 0 ){ return true; } //Don't reset found or del holds |
1472 |
$(this).val(next_priority); |
1451 |
$(this).val(next_priority).data('current_value',next_priority); |
1473 |
next_priority++; |
1452 |
next_priority++; |
1474 |
}); |
1453 |
}); |
1475 |
}); |
1454 |
}); |
1476 |
- |
|
|