Bug 10860 - Change "in-house use" to "on-site checkout"
[koha.git] / 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         activate: function( event, ui ) {
13             $('#'+ui.newTab.context.id).click();
14         }
15     });
16
17     $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
18
19     $("#borrower_messages .cancel").on("click",function(){
20         $("#add_message_form").hide();
21         $("#addmessage").show();
22     });
23
24     $("#addmessage").on("click",function(){
25         $(this).hide();
26         $("#add_message_form").show();
27      });
28
29     $("input.radio").on("click",function(){
30         radioCheckBox($(this));
31     });
32
33     $("#newduedate").datetimepicker({
34         minDate: 1, // require that renewal date is after today
35         hour: 23,
36         minute: 59
37     });
38     $("#duedatespec").datetimepicker({
39         onClose: function(dateText, inst) { $("#barcode").focus(); },
40         hour: 23,
41         minute: 59
42     });
43     $("#export_submit").on("click",function(){
44         var export_format = $("#export_formats").val();
45         export_checkouts(export_format);
46         return false;
47     });
48
49     toggle_onsite_checkout();
50     $("#onsite_checkout").click(function(){
51         toggle_onsite_checkout();
52     });
53 });
54
55 function export_checkouts(format) {
56     if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
57         alert(MSG_EXPORT_SELECT_CHECKOUTS);
58         return;
59     }
60
61     $("input:checkbox[name='biblionumbers']").each( function(){
62         var input_item = $(this).siblings("input:checkbox");
63         if ( $(this).is(":checked") ) {
64             $(input_item).attr("checked", "checked");
65         } else {
66             $(input_item).attr("checked", "");
67         }
68     } );
69
70     if (format == 'iso2709_995') {
71         format = 'iso2709';
72         $("#dont_export_item").val(0);
73     } else if (format == 'iso2709') {
74         $("#dont_export_item").val(1);
75     }
76
77     document.getElementById("export_format").value = format;
78     document.issues.submit();
79 }
80
81 function validate1(date) {
82     var today = new Date();
83     if ( date < today ) {
84         return true;
85      } else {
86         return false;
87      }
88 }