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 $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
19 $("#borrower_messages .cancel").on("click",function(){
20 $("#add_message_form").hide();
21 $("#addmessage").show();
24 $("#addmessage").on("click",function(){
26 $("#add_message_form").show();
29 $("input.radio").on("click",function(){
30 radioCheckBox($(this));
33 $("#newduedate").datetimepicker({
34 minDate: 1, // require that renewal date is after today
38 $("#duedatespec").datetimepicker({
39 onClose: function(dateText, inst) { $("#barcode").focus(); },
43 $("#export_submit").on("click",function(){
44 var output_format = $("#output_format").val();
45 export_checkouts(output_format);
49 var checkout_settings = $(".checkout-settings");
50 var checkout_settings_icon = $(".checkout-settings-icon");
52 // If any checkboxes in the checkout settings are selected, show the settings by default
53 if ( $(".checkout-settings input:checked,#duedatespec[value!='']").length ) {
54 checkout_settings.show();
55 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
57 checkout_settings.hide();
58 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
61 $("#show-checkout-settings a").on("click",function(){
62 if( checkout_settings.is(":hidden")){
63 checkout_settings.show();
64 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
66 $("#barcode").focus();
67 checkout_settings.hide();
68 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
74 function export_checkouts(format) {
75 if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
76 alert(MSG_EXPORT_SELECT_CHECKOUTS);
80 $("input:checkbox[name='biblionumbers']").each( function(){
81 var input_item = $(this).siblings("input:checkbox");
82 if ( $(this).is(":checked") ) {
83 $(input_item).prop("checked", true);
85 $(input_item).prop("checked", false);
89 if (format == 'iso2709_995') {
91 $("#dont_export_item").val(0);
92 } else if (format == 'iso2709') {
93 $("#dont_export_item").val(1);
96 document.getElementById("output_format").value = format;
97 document.issues.submit();
100 function validate1(date) {
101 var today = new Date();
102 if ( date < today ) {