Lines 1185-1232
$(document).ready(function() {
Link Here
|
1185 |
} |
1185 |
} |
1186 |
}); |
1186 |
}); |
1187 |
|
1187 |
|
1188 |
// Handle return claim resolution |
|
|
1189 |
$('body').on('click', '.return-claim-tools-resolve', function() { |
1190 |
let id = $(this).data('return-claim-id'); |
1191 |
let current_lost_status = $(this).data('current-lost-status'); |
1192 |
|
1193 |
$('#claims-returned-resolved-modal-id').val(id); |
1194 |
$("#new_lost_status").val(current_lost_status); |
1195 |
let selected_option = $("#new_lost_status option:selected"); |
1196 |
$(selected_option).text(_("%s (current status)").format($(selected_option).text())); |
1197 |
$('#claims-returned-resolved-modal').modal() |
1198 |
}); |
1199 |
|
1200 |
$(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e) { |
1201 |
let resolution = $('#claims-returned-resolved-modal-resolved-code').val(); |
1202 |
let new_lost_status = $('#new_lost_status').val(); |
1203 |
let id = $('#claims-returned-resolved-modal-id').val(); |
1204 |
|
1205 |
$('#claims-returned-resolved-modal-btn-submit-spinner').show(); |
1206 |
$('#claims-returned-resolved-modal-btn-submit-icon').hide(); |
1207 |
|
1208 |
params = { |
1209 |
resolution: resolution, |
1210 |
resolved_by: logged_in_user_borrowernumber, |
1211 |
new_lost_status: new_lost_status |
1212 |
}; |
1213 |
|
1214 |
$.ajax({ |
1215 |
url: '/api/v1/return_claims/' + id + '/resolve', |
1216 |
type: 'PUT', |
1217 |
data: JSON.stringify(params), |
1218 |
success: function( data ) { |
1219 |
$('#claims-returned-resolved-modal-btn-submit-spinner').hide(); |
1220 |
$('#claims-returned-resolved-modal-btn-submit-icon').show(); |
1221 |
$('#claims-returned-resolved-modal').modal('hide') |
1222 |
|
1223 |
refreshReturnClaimsTable(); |
1224 |
}, |
1225 |
contentType: "json" |
1226 |
}); |
1227 |
|
1228 |
}); |
1229 |
|
1230 |
$("#show_all_claims").on("click", function(e){ |
1188 |
$("#show_all_claims").on("click", function(e){ |
1231 |
e.preventDefault(); |
1189 |
e.preventDefault(); |
1232 |
$(".ctrl_link").removeClass("disabled"); |
1190 |
$(".ctrl_link").removeClass("disabled"); |