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 a[data-toggle='tab']").on("shown.bs.tab", function(e){
15 $("#borrower_messages .cancel").on("click",function(){
16 $("#add_message_form").hide();
17 $("#addmessage").show();
20 $("#addmessage").on("click",function(){
22 $("#add_message_form").show();
25 $("input.radio").on("click",function(){
26 radioCheckBox($(this));
29 $(".clear_date").on("click", function(){
30 $("#stickyduedate").prop( "checked", false );
33 $("#export_submit").on("click",function(){
34 export_checkouts($("#issues-table-output-format").val());
38 var circ_settings = $(".circ-settings");
39 var circ_settings_icon = $(".circ-settings-icon");
41 // If any checkboxes in the circ settings are selected, show the settings by default
42 if ( $(".circ-settings input:checked,#duedatespec[value!='']").length ) {
44 circ_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
47 circ_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
50 $("#show-circ-settings a").on("click",function(){
51 if( circ_settings.is(":hidden")){
53 circ_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
55 $("#barcode").focus();
57 circ_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
61 $(".circ_setting").on("click",function(){
62 $("#barcode").focus();
65 $("#itemSearchFallback").ready(function(){
66 $("#itemSearchFallback").modal("show");
70 $("div#reldebarments .remove_restriction").on("click",function(){
71 return confirm( __("Remove restriction?") );
73 var mrform = $("#manual_restriction_form");
74 var mrlink = $("#add_manual_restriction");
76 mrlink.on("click",function(e){
81 $("#cancel_manual_restriction").on("click",function(e){
86 $(".clear-date").on("click",function(e){
88 var fieldID = this.id.replace("clear-date-","");
89 $("#" + fieldID).val("");
92 /* Preselect Bootstrap tab based on location hash */
93 var hash = window.location.hash.substring(1);
95 var activeTab = $('a[href="#' + hash + '"]');
96 activeTab && activeTab.tab('show');
101 function export_checkouts(format) {
102 if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
103 alert( __("You must select checkout(s) to export") );
107 $("input:checkbox[name='biblionumbers']").each( function(){
108 var input_item = $(this).siblings("input:checkbox");
109 if ( $(this).is(":checked") ) {
110 $(input_item).prop("checked", true);
112 $(input_item).prop("checked", false);
116 if (format == 'iso2709_995') {
118 $("#dont_export_item").val(0);
119 } else if (format == 'iso2709') {
120 $("#dont_export_item").val(1);
123 document.getElementById("output_format").value = format;
124 document.issues.submit();