|
Lines 244-298
Link Here
|
| 244 |
}); |
244 |
}); |
| 245 |
</script> |
245 |
</script> |
| 246 |
<script> |
246 |
<script> |
| 247 |
function enableCheckboxActions(){ |
247 |
function enableCheckboxActions() { |
| 248 |
// Enable/disable controls if checkboxes are checked |
248 |
// Enable/disable controls if checkboxes are checked |
| 249 |
var checkedBoxes = $("input.cb:checked"); |
249 |
var checkedBoxes = $("input.cb:checked"); |
| 250 |
if ($(checkedBoxes).size()) { |
250 |
if ($(checkedBoxes).size()) { |
| 251 |
$("#payselected, #writeoff-selected").prop("disabled",false); |
251 |
$("#payselected, #writeoff-selected").prop("disabled", false); |
| 252 |
} else { |
252 |
} else { |
| 253 |
$("#payselected, #writeoff-selected").prop("disabled",true); |
253 |
$("#payselected, #writeoff-selected").prop("disabled", true); |
| 254 |
} |
254 |
} |
| 255 |
} |
255 |
} |
| 256 |
$(document).ready(function(){ |
256 |
$(document).ready(function () { |
| 257 |
if (payment_id && prefs.FinePaymentAutoPopup){ |
257 |
if (payment_id && prefs.FinePaymentAutoPopup) { |
| 258 |
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, '_blank'); |
258 |
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, "_blank"); |
| 259 |
} |
259 |
} |
| 260 |
|
260 |
|
| 261 |
$('#pay-fines-form').preventDoubleFormSubmit(); |
261 |
$("#pay-fines-form").preventDoubleFormSubmit(); |
| 262 |
$("#woall").click(function(event){ |
262 |
$("#woall").click(function (event) { |
| 263 |
var msg = _("Are you sure you want to write off %s in outstanding charges? This cannot be undone!").format(total); |
263 |
var msg = _("Are you sure you want to write off %s in outstanding charges? This cannot be undone!").format(total); |
| 264 |
var answer = confirm(msg); |
264 |
var answer = confirm(msg); |
| 265 |
if (!answer){ |
265 |
if (!answer) { |
| 266 |
event.preventDefault(); |
266 |
event.preventDefault(); |
| 267 |
} |
267 |
} |
| 268 |
}); |
268 |
}); |
| 269 |
$('#CheckAll').click(function(e){ |
269 |
$("#CheckAll").click(function (e) { |
| 270 |
e.preventDefault(); |
270 |
e.preventDefault(); |
| 271 |
$(".cb").each(function(){ |
271 |
$(".cb").each(function () { |
| 272 |
$(this).prop("checked", true ); |
272 |
$(this).prop("checked", true); |
| 273 |
}); |
273 |
}); |
| 274 |
enableCheckboxActions(); |
274 |
enableCheckboxActions(); |
| 275 |
}); |
275 |
}); |
| 276 |
$('#CheckNone').click(function(e){ |
276 |
$("#CheckNone").click(function (e) { |
| 277 |
e.preventDefault(); |
277 |
e.preventDefault(); |
| 278 |
$(".cb").each(function(){ |
278 |
$(".cb").each(function () { |
| 279 |
$(this).prop("checked", false ); |
279 |
$(this).prop("checked", false); |
| 280 |
}); |
280 |
}); |
| 281 |
enableCheckboxActions(); |
281 |
enableCheckboxActions(); |
| 282 |
}); |
282 |
}); |
| 283 |
$(".cb").change(function(){ |
283 |
$(".cb").change(function () { |
| 284 |
enableCheckboxActions(); |
284 |
enableCheckboxActions(); |
| 285 |
}); |
285 |
}); |
| 286 |
enableCheckboxActions(); |
286 |
enableCheckboxActions(); |
| 287 |
$(".add-note").on("click", function(e){ |
287 |
$(".add-note").on("click", function (e) { |
| 288 |
e.preventDefault(); |
288 |
e.preventDefault(); |
| 289 |
$(this).hide(); |
289 |
$(this).hide(); |
| 290 |
var accountlines_id = $(this).data("accountlines_id"); |
290 |
var accountlines_id = $(this).data("accountlines_id"); |
| 291 |
$("#payment_note_" + accountlines_id ).show().find("input").focus(); |
291 |
$("#payment_note_" + accountlines_id) |
|
|
292 |
.show() |
| 293 |
.find("input") |
| 294 |
.focus(); |
| 292 |
}); |
295 |
}); |
| 293 |
$(".cancel-note").on("click", function(e){ |
296 |
$(".cancel-note").on("click", function (e) { |
| 294 |
e.preventDefault(); |
297 |
e.preventDefault(); |
| 295 |
this_td = $(this).closest('td.actions'); |
298 |
this_td = $(this).closest("td.actions"); |
| 296 |
this_td.find(".payment_note").hide().find("input").val(""); |
299 |
this_td.find(".payment_note").hide().find("input").val(""); |
| 297 |
this_td.find(".add-note").show(); |
300 |
this_td.find(".add-note").show(); |
| 298 |
}); |
301 |
}); |
| 299 |
- |
|
|