View | Details | Raw Unified | Return to bug 9294
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js (+139 lines)
Line 0 Link Here
1
$(document).ready(function() {
2
    $('#patronlists').tabs();
3
    var allcheckboxes = $(".checkboxed");
4
    $("#renew_all").on("click",function(){
5
        allcheckboxes.checkCheckboxes(":input[name*=items]");
6
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]");
7
    });
8
    $("#CheckAllitems").on("click",function(){
9
        allcheckboxes.checkCheckboxes(":input[name*=items]");
10
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
11
    });
12
    $("#CheckNoitems").on("click",function(){
13
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
14
    });
15
    $("#CheckAllreturns").on("click",function(){
16
        allcheckboxes.checkCheckboxes(":input[name*=barcodes]");
17
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
18
    });
19
    $("#CheckNoreturns" ).on("click",function(){
20
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
21
    });
22
23
    $("#CheckAllexports").on("click",function(){
24
        allcheckboxes.checkCheckboxes(":input[name*=biblionumbers]");
25
        allcheckboxes.unCheckCheckboxes(":input[name*=items]");
26
        return false;
27
    });
28
    $("#CheckNoexports").on("click",function(){
29
        allcheckboxes.unCheckCheckboxes(":input[name*=biblionumbers]");
30
        return false;
31
    });
32
33
    $("#relrenew_all").on("click",function(){
34
        allcheckboxes.checkCheckboxes(":input[name*=items]");
35
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]");
36
    });
37
    $("#relCheckAllitems").on("click",function(){
38
        allcheckboxes.checkCheckboxes(":input[name*=items]");
39
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
40
    });
41
    $("#relCheckNoitems").on("click",function(){
42
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
43
    });
44
    $("#relCheckAllreturns").on("click",function(){
45
        allcheckboxes.checkCheckboxes(":input[name*=barcodes]");
46
        allcheckboxes.unCheckCheckboxes(":input[name*=items]"); return false;
47
    });
48
    $("#relCheckNoreturns").on("click",function(){
49
        allcheckboxes.unCheckCheckboxes(":input[name*=barcodes]"); return false;
50
    });
51
    $("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+MSG_ADD_MESSAGE+"</a>");
52
    $("#borrower_messages .cancel").on("click",function(){
53
        $("#add_message_form").hide();
54
        $("#addmessage").show();
55
    });
56
    $("#addmessage").on("click",function(){
57
        $(this).hide();
58
        $("#add_message_form").show();
59
     });
60
61
    $("input.radio").on("click",function(){
62
        radioCheckBox($(this));
63
    });
64
65
    $("#newduedate").datetimepicker({
66
        minDate: 1, // require that renewal date is after today
67
        hour: 23,
68
        minute: 59
69
    });
70
    $("#duedatespec").datetimepicker({
71
        onClose: function(dateText, inst) { $("#barcode").focus(); },
72
        hour: 23,
73
        minute: 59
74
    });
75
    $("#export_submit").on("click",function(){
76
        var export_format = $("#export_formats").val();
77
        export_checkouts(export_format);
78
        return false;
79
    });
80
    // Clicking the table cell checks the checkbox inside it
81
    $("td").on("click",function(e){
82
        if(e.target.tagName.toLowerCase() == 'td'){
83
           $(this).find("input:checkbox:visible").each( function() {
84
                if($(this).attr("checked")){
85
                    $(this).removeAttr("checked");
86
                } else {
87
                    $(this).attr("checked","checked");
88
                    radioCheckBox($(this));
89
                }
90
           });
91
        }
92
    });
93
});
94
95
function export_checkouts(format) {
96
    if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
97
        alert(MSG_EXPORT_SELECT_CHECKOUTS);
98
        return;
99
    }
100
101
    $("input:checkbox[name='biblionumbers']").each( function(){
102
        var input_item = $(this).siblings("input:checkbox");
103
        if ( $(this).is(":checked") ) {
104
            $(input_item).attr("checked", "checked");
105
        } else {
106
            $(input_item).attr("checked", "");
107
        }
108
    } );
109
110
    if (format == 'iso2709_995') {
111
        format = 'iso2709';
112
        $("#dont_export_item").val(0);
113
    } else if (format == 'iso2709') {
114
        $("#dont_export_item").val(1);
115
    }
116
    document.issues.action="/cgi-bin/koha/tools/export.pl";
117
    document.getElementById("export_format").value = format;
118
    document.issues.submit();
119
120
    /* Reset form action to its initial value */
121
    document.issues.action="/cgi-bin/koha/reserve/renewscript.pl";
122
123
}
124
125
function validate1(date) {
126
    var today = new Date();
127
    if ( date < today ) {
128
        return true;
129
     } else {
130
        return false;
131
     }
132
}
133
134
// prevent adjacent checkboxes from being checked simultaneously
135
function radioCheckBox(box){
136
    if($(this).attr("checked")){
137
        $(this).removeAttr("checked");
138
    }
139
 }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-147 / +7 lines)
Lines 19-26 Link Here
19
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
19
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
22
<script type="text/javascript">
23
<script type="text/javascript">
23
//<![CDATA[
24
//<![CDATA[
25
var MSG_ADD_MESSAGE = _("Add a new message");
26
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
24
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
27
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
25
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
28
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
26
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
29
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
Lines 79-134 Link Here
79
            return printx_window('qslip'); }
82
            return printx_window('qslip'); }
80
        });[% END %]
83
        });[% END %]
81
84
82
83
var allcheckboxes = $(".checkboxed");
84
	$("#renew_all").click(function(){
85
		$(allcheckboxes).checkCheckboxes(":input[name*=items]"); 
86
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]");
87
	});
88
	$("#CheckAllitems").click(function(){
89
		$(allcheckboxes).checkCheckboxes(":input[name*=items]");
90
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
91
	});
92
    $("#CheckNoitems").click(function(){
93
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
94
	});
95
	$("#CheckAllreturns").click(function(){
96
		$(allcheckboxes).checkCheckboxes(":input[name*=barcodes]");
97
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
98
	});
99
    $("#CheckNoreturns" ).click(function(){
100
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
101
	});
102
103
    $("#CheckAllexports").click(function(){
104
        $(".checkboxed").checkCheckboxes(":input[name*=biblionumbers]");
105
        $(".checkboxed").unCheckCheckboxes(":input[name*=items]");
106
        return false;
107
    });
108
    $("#CheckNoexports").click(function(){
109
        $(".checkboxed").unCheckCheckboxes(":input[name*=biblionumbers]");
110
        return false;
111
    });
112
113
    $("#relrenew_all").click(function(){
114
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
115
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]");
116
    });
117
    $("#relCheckAllitems").click(function(){
118
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
119
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
120
    });
121
    $("#relCheckNoitems").click(function(){
122
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
123
    });
124
    $("#relCheckAllreturns").click(function(){
125
        $(allcheckboxes).checkCheckboxes(":input[name*=barcodes]");
126
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
127
    });
128
    $("#relCheckNoreturns").click(function(){
129
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
130
    });
131
132
    [% IF ( CAN_user_circulate_override_renewals ) %]
85
    [% IF ( CAN_user_circulate_override_renewals ) %]
133
    [% IF ( AllowRenewalLimitOverride ) %]
86
    [% IF ( AllowRenewalLimitOverride ) %]
134
    $( '#override_limit' ).click( function () {
87
    $( '#override_limit' ).click( function () {
Lines 140-241 var allcheckboxes = $(".checkboxed"); Link Here
140
    } ).attr( 'checked', false );
93
    } ).attr( 'checked', false );
141
    [% END %]
94
    [% END %]
142
    [% END %]
95
    [% END %]
143
    // Clicking the table cell checks the checkbox inside it
144
	$("td").click(function(e){
145
		if(e.target.tagName.toLowerCase() == 'td'){
146
           $(this).find("input:checkbox:visible").each( function() {
147
                if($(this).attr("checked")){
148
                    $(this).removeAttr("checked");
149
                } else {
150
                    $(this).attr("checked","checked");
151
                    radioCheckBox($(this));
152
                }
153
           });
154
        }
155
	});
156
    // prevent adjacent checkboxes from being checked simultaneously
157
    function radioCheckBox(box){
158
            box.parents("td").siblings().find("input:checkbox:visible").each(function(){
159
                if($(this).attr("checked")){
160
                    $(this).removeAttr("checked");
161
                }
162
             });
163
     }
164
165
	$("#messages ul").after("<a href=\"#\" id=\"addmessage\">"+_("Add a new message")+"</a>");
166
	$("#borrower_messages .cancel").click(function(){
167
		$("#add_message_form").hide();
168
        $("#addmessage").show();
169
	});
170
	$("#addmessage").click(function (){
171
        $(this).hide();
172
		$("#add_message_form").show();
173
	 });
174
175
    $("input.radio").click(function(){
176
        radioCheckBox($(this));
177
    });
178
179
    $("#newduedate").datetimepicker({
180
        minDate: 1, // require that renewal date is after today
181
        hour: 23,
182
        minute: 59
183
    });
184
    $("#duedatespec").datetimepicker({
185
        onClose: function(dateText, inst) { $("#barcode").focus(); },
186
        hour: 23,
187
        minute: 59
188
    });
189
    $("#export_submit").click(function(){
190
        var export_format = $("#export_formats").val();
191
        export_checkouts(export_format);
192
        return false;
193
    })
194
 });
96
 });
195
196
function export_checkouts(format) {
197
    if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
198
        alert(_("You must select a checkout to export"));
199
        return;
200
    }
201
202
    $("input:checkbox[name='biblionumbers']").each( function(){
203
        var input_item = $(this).siblings("input:checkbox");
204
        if ( $(this).is(":checked") ) {
205
            $(input_item).attr("checked", "checked");
206
        } else {
207
            $(input_item).attr("checked", "");
208
        }
209
    } );
210
211
    if (format == 'iso2709_995') {
212
        format = 'iso2709';
213
        $("#dont_export_item").val(0);
214
    } else if (format == 'iso2709') {
215
        $("#dont_export_item").val(1);
216
    } else {
217
        [% UNLESS ( export_with_csv_profile ) %]
218
            alert(_("You must define a csv profile for export (in tools>CSV export profiles) and fill the ExportWithCsvProfile system preference"));
219
            return false;
220
        [% END %]
221
    }
222
    document.issues.action="/cgi-bin/koha/tools/export.pl";
223
    document.getElementById("export_format").value = format;
224
    document.issues.submit();
225
226
    /* Reset form action to its initial value */
227
    document.issues.action="/cgi-bin/koha/reserve/renewscript.pl";
228
229
};
230
231
function validate1(date) {
232
    var today = new Date();
233
    if ( date < today ) {
234
        return true;
235
     } else {
236
        return false;
237
     }
238
};
239
//]]>
97
//]]>
240
</script>
98
</script>
241
</head>
99
</head>
Lines 1025-1031 No patron matched <span class="ex">[% message %]</span> Link Here
1025
            <select name="export_formats" id="export_formats">
883
            <select name="export_formats" id="export_formats">
1026
                <option value="iso2709_995">ISO2709 with items</option>
884
                <option value="iso2709_995">ISO2709 with items</option>
1027
                <option value="iso2709">ISO2709 without items</option>
885
                <option value="iso2709">ISO2709 without items</option>
1028
                <option value="csv">CSV</option>
886
                [% IF ( export_with_csv_profile ) %]
887
                    <option value="csv">CSV</option>
888
                [% END %]
889
1029
            </select>
890
            </select>
1030
           <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
891
           <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
1031
            <input type="hidden" name="op" value="export" />
892
            <input type="hidden" name="op" value="export" />
1032
- 

Return to bug 9294