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

Return to bug 9294