1 $(document).ready(function() {
2 $("#CheckAllExports").on("click",function(){
3 $(".export:visible").prop("checked", true);
6 $("#UncheckAllExports").on("click",function(){
7 $(".export:visible").prop("checked", false);
11 $('#patronlists').tabs({
12 activate: function( event, ui ) {
13 $('#'+ui.newTab.context.id).click();
17 $("#borrower_messages .cancel").on("click",function(){
18 $("#add_message_form").hide();
19 $("#addmessage").show();
22 $("#addmessage").on("click",function(){
24 $("#add_message_form").show();
27 $("input.radio").on("click",function(){
28 radioCheckBox($(this));
31 $("#newduedate").datetimepicker({
32 minDate: 1, // require that renewal date is after today
36 $("#duedatespec").datetimepicker({
37 onClose: function(dateText, inst) { $("#barcode").focus(); },
41 $("#export_submit").on("click",function(){
42 var output_format = $("#output_format").val();
43 export_checkouts(output_format);
47 var checkout_settings = $(".checkout-settings");
48 var checkout_settings_icon = $(".checkout-settings-icon");
50 // If any checkboxes in the checkout settings are selected, show the settings by default
51 if ( $(".checkout-settings input:checked,#duedatespec[value!='']").length ) {
52 checkout_settings.show();
53 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
55 checkout_settings.hide();
56 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
59 $("#show-checkout-settings a").on("click",function(){
60 if( checkout_settings.is(":hidden")){
61 checkout_settings.show();
62 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
64 $("#barcode").focus();
65 checkout_settings.hide();
66 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
72 function export_checkouts(format) {
73 if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
74 alert(MSG_EXPORT_SELECT_CHECKOUTS);
78 $("input:checkbox[name='biblionumbers']").each( function(){
79 var input_item = $(this).siblings("input:checkbox");
80 if ( $(this).is(":checked") ) {
81 $(input_item).prop("checked", true);
83 $(input_item).prop("checked", false);
87 if (format == 'iso2709_995') {
89 $("#dont_export_item").val(0);
90 } else if (format == 'iso2709') {
91 $("#dont_export_item").val(1);
94 document.getElementById("output_format").value = format;
95 document.issues.submit();
98 function validate1(date) {
99 var today = new Date();
100 if ( date < today ) {