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 onClose: function(dateText, inst) {
33 validate_date(dateText, inst);
35 minDate: 1, // require that renewal date is after today
38 }).on("change", function(e) {
39 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
41 $("#duedatespec").datetimepicker({
42 onClose: function(dateText, inst) {
43 if ( validate_date(dateText, inst) ) {
44 $("#barcode").focus();
49 }).on("change", function(e, value) {
50 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
52 $("#export_submit").on("click",function(){
53 var output_format = $("#output_format").val();
54 export_checkouts(output_format);
58 var checkout_settings = $(".checkout-settings");
59 var checkout_settings_icon = $(".checkout-settings-icon");
61 // If any checkboxes in the checkout settings are selected, show the settings by default
62 if ( $(".checkout-settings input:checked,#duedatespec[value!='']").length ) {
63 checkout_settings.show();
64 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
66 checkout_settings.hide();
67 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
70 $("#show-checkout-settings a").on("click",function(){
71 if( checkout_settings.is(":hidden")){
72 checkout_settings.show();
73 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
75 $("#barcode").focus();
76 checkout_settings.hide();
77 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
83 function export_checkouts(format) {
84 if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
85 alert(MSG_EXPORT_SELECT_CHECKOUTS);
89 $("input:checkbox[name='biblionumbers']").each( function(){
90 var input_item = $(this).siblings("input:checkbox");
91 if ( $(this).is(":checked") ) {
92 $(input_item).prop("checked", true);
94 $(input_item).prop("checked", false);
98 if (format == 'iso2709_995') {
100 $("#dont_export_item").val(0);
101 } else if (format == 'iso2709') {
102 $("#dont_export_item").val(1);
105 document.getElementById("output_format").value = format;
106 document.issues.submit();
109 function validate1(date) {
110 var today = new Date();
111 if ( date < today ) {