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 onClose: function(dateText, inst) {
35 validate_date(dateText, inst);
37 minDate: 1, // require that renewal date is after today
41 $("#duedatespec").datetimepicker({
42 onClose: function(dateText, inst) {
43 if ( validate_date(dateText, inst) ) {
44 $("#barcode").focus();
50 $("#export_submit").on("click",function(){
51 var output_format = $("#output_format").val();
52 export_checkouts(output_format);
56 var checkout_settings = $(".checkout-settings");
57 var checkout_settings_icon = $(".checkout-settings-icon");
59 // If any checkboxes in the checkout settings are selected, show the settings by default
60 if ( $(".checkout-settings input:checked,#duedatespec[value!='']").length ) {
61 checkout_settings.show();
62 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
64 checkout_settings.hide();
65 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
68 $("#show-checkout-settings a").on("click",function(){
69 if( checkout_settings.is(":hidden")){
70 checkout_settings.show();
71 checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
73 $("#barcode").focus();
74 checkout_settings.hide();
75 checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
81 function export_checkouts(format) {
82 if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
83 alert(MSG_EXPORT_SELECT_CHECKOUTS);
87 $("input:checkbox[name='biblionumbers']").each( function(){
88 var input_item = $(this).siblings("input:checkbox");
89 if ( $(this).is(":checked") ) {
90 $(input_item).prop("checked", true);
92 $(input_item).prop("checked", false);
96 if (format == 'iso2709_995') {
98 $("#dont_export_item").val(0);
99 } else if (format == 'iso2709') {
100 $("#dont_export_item").val(1);
103 document.getElementById("output_format").value = format;
104 document.issues.submit();
107 function validate1(date) {
108 var today = new Date();
109 if ( date < today ) {