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

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

Return to bug 9294