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

Return to bug 9294