489403f10ae99623a178f9de29a0c8fbad67b270
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / js / pages / circulation.js
1 $(document).ready(function() {
2     $("#CheckAllExports").on("click",function(){
3         $(".export:visible").attr("checked", "checked" );
4         return false;
5     });
6     $("#UncheckAllExports").on("click",function(){
7         $(".export:visible").removeAttr("checked");
8         return false;
9     });
10
11     $('#patronlists').tabs();
12
13     $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
14
15     $("#borrower_messages .cancel").on("click",function(){
16         $("#add_message_form").hide();
17         $("#addmessage").show();
18     });
19
20     $("#addmessage").on("click",function(){
21         $(this).hide();
22         $("#add_message_form").show();
23      });
24
25     $("input.radio").on("click",function(){
26         radioCheckBox($(this));
27     });
28
29     $("#newduedate").datetimepicker({
30         minDate: 1, // require that renewal date is after today
31         hour: 23,
32         minute: 59
33     });
34     $("#duedatespec").datetimepicker({
35         onClose: function(dateText, inst) { $("#barcode").focus(); },
36         hour: 23,
37         minute: 59
38     });
39     $("#export_submit").on("click",function(){
40         var export_format = $("#export_formats").val();
41         export_checkouts(export_format);
42         return false;
43     });
44
45 });
46
47 function export_checkouts(format) {
48     if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
49         alert(MSG_EXPORT_SELECT_CHECKOUTS);
50         return;
51     }
52
53     $("input:checkbox[name='biblionumbers']").each( function(){
54         var input_item = $(this).siblings("input:checkbox");
55         if ( $(this).is(":checked") ) {
56             $(input_item).attr("checked", "checked");
57         } else {
58             $(input_item).attr("checked", "");
59         }
60     } );
61
62     if (format == 'iso2709_995') {
63         format = 'iso2709';
64         $("#dont_export_item").val(0);
65     } else if (format == 'iso2709') {
66         $("#dont_export_item").val(1);
67     }
68
69     document.getElementById("export_format").value = format;
70     document.issues.submit();
71 }
72
73 function validate1(date) {
74     var today = new Date();
75     if ( date < today ) {
76         return true;
77      } else {
78         return false;
79      }
80 }