Owen Leonard
24cb4f71f4
For some reason, with the combination of jQuery 3.6.0 and jQueryUI 1.13.1, the way to access the current active tab's link has changed. Previously the tab activate event would provide information about the link as "ui.newTab.context." It appears that "context" is no longer available. This patch updates the two instances in Koha where this process is broken. To test, apply the patch and check out to a patron with holds on their account. - When the checkout page loads, confirm that each tab loads its contents correctly when clicked. - Check that the correct tab is activated when you append the tab link to the page url, e.g. /cgi-bin/koha/circ/circulation.pl?borrowernumber=XXX#reldebarments ...which should select the "Restrictions" tab for you. You may need to try this in a new tab or shift-reload to get the browser to look for the hash. - Perform the same tests on the patron details page. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
135 lines
4 KiB
JavaScript
135 lines
4 KiB
JavaScript
/* global flatpickr_dateformat_string flatpickr_timeformat_string */
|
|
$(document).ready(function() {
|
|
$("#CheckAllExports").on("click",function(){
|
|
$(".export:visible").prop("checked", true);
|
|
return false;
|
|
});
|
|
$("#UncheckAllExports").on("click",function(){
|
|
$(".export:visible").prop("checked", false);
|
|
return false;
|
|
});
|
|
|
|
$('#patronlists').tabs({
|
|
activate: function( event, ui ) {
|
|
$("a", ui.newTab ).click();
|
|
}
|
|
});
|
|
|
|
$("#borrower_messages .cancel").on("click",function(){
|
|
$("#add_message_form").hide();
|
|
$("#addmessage").show();
|
|
});
|
|
|
|
$("#addmessage").on("click",function(){
|
|
$(this).hide();
|
|
$("#add_message_form").show();
|
|
});
|
|
|
|
$("input.radio").on("click",function(){
|
|
radioCheckBox($(this));
|
|
});
|
|
|
|
$("#duedatespec").flatpickr({
|
|
enableTime: true,
|
|
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
|
|
onClose: function() {
|
|
$("#barcode").focus();
|
|
}
|
|
});
|
|
|
|
$("#newduedate, #newonholdduedate input").flatpickr({
|
|
enableTime: true,
|
|
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
|
|
});
|
|
|
|
$(".clear_date").on("click", function(){
|
|
$("#stickyduedate").prop( "checked", false );
|
|
});
|
|
|
|
$("#export_submit").on("click",function(){
|
|
export_checkouts($("#issues-table-output-format").val());
|
|
return false;
|
|
});
|
|
|
|
var circ_settings = $(".circ-settings");
|
|
var circ_settings_icon = $(".circ-settings-icon");
|
|
|
|
// If any checkboxes in the circ settings are selected, show the settings by default
|
|
if ( $(".circ-settings input:checked,#duedatespec[value!='']").length ) {
|
|
circ_settings.show();
|
|
circ_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
|
|
} else {
|
|
circ_settings.hide();
|
|
circ_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
|
|
}
|
|
|
|
$("#show-circ-settings a").on("click",function(){
|
|
if( circ_settings.is(":hidden")){
|
|
circ_settings.show();
|
|
circ_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
|
|
} else {
|
|
$("#barcode").focus();
|
|
circ_settings.hide();
|
|
circ_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
|
|
}
|
|
});
|
|
|
|
$(".circ_setting").on("click",function(){
|
|
$("#barcode").focus();
|
|
});
|
|
|
|
$("#itemSearchFallback").ready(function(){
|
|
$("#itemSearchFallback").modal("show");
|
|
});
|
|
|
|
// Debarments
|
|
$("div#reldebarments .remove_restriction").on("click",function(){
|
|
return confirm( __("Remove restriction?") );
|
|
});
|
|
var mrform = $("#manual_restriction_form");
|
|
var mrlink = $("#add_manual_restriction");
|
|
mrform.hide();
|
|
mrlink.on("click",function(e){
|
|
$(this).hide();
|
|
mrform.show();
|
|
e.preventDefault();
|
|
});
|
|
$("#cancel_manual_restriction").on("click",function(e){
|
|
mrlink.show();
|
|
mrform.hide();
|
|
e.preventDefault();
|
|
});
|
|
$(".clear-date").on("click",function(e){
|
|
e.preventDefault();
|
|
var fieldID = this.id.replace("clear-date-","");
|
|
$("#" + fieldID).val("");
|
|
});
|
|
|
|
|
|
});
|
|
|
|
function export_checkouts(format) {
|
|
if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
|
|
alert( __("You must select checkout(s) to export") );
|
|
return;
|
|
}
|
|
|
|
$("input:checkbox[name='biblionumbers']").each( function(){
|
|
var input_item = $(this).siblings("input:checkbox");
|
|
if ( $(this).is(":checked") ) {
|
|
$(input_item).prop("checked", true);
|
|
} else {
|
|
$(input_item).prop("checked", false);
|
|
}
|
|
} );
|
|
|
|
if (format == 'iso2709_995') {
|
|
format = 'iso2709';
|
|
$("#dont_export_item").val(0);
|
|
} else if (format == 'iso2709') {
|
|
$("#dont_export_item").val(1);
|
|
}
|
|
|
|
document.getElementById("output_format").value = format;
|
|
document.issues.submit();
|
|
}
|