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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-4 / +10 lines)
Lines 213-219 Link Here
213
    [% IF display_columns_selection %][%# Needs js/pages/batchMod.js %]
213
    [% IF display_columns_selection %][%# Needs js/pages/batchMod.js %]
214
        [% IF checkboxes_edit OR checkboxes_delete %]
214
        [% IF checkboxes_edit OR checkboxes_delete %]
215
            <div id="toolbar">
215
            <div id="toolbar">
216
                <a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a> | <a id="clearonloanbutton" href="#">Clear on loan</a>
216
                <a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a>
217
            </div>
217
            </div>
218
        [% END %]
218
        [% END %]
219
219
Lines 268-274 Link Here
268
                    <td>[% item.index + 1 | html %]</td>
268
                    <td>[% item.index + 1 | html %]</td>
269
                    [% IF checkboxes_edit %]
269
                    [% IF checkboxes_edit %]
270
                        [% UNLESS can_be_edited%]
270
                        [% UNLESS can_be_edited%]
271
                            <td class="error">Cannot edit</td>
271
                            <td class="error">
272
                                <i class="fa fa-times fa-lg" title="Cannot edit"></i>
273
                            </td>
272
                        [% ELSE %]
274
                        [% ELSE %]
273
                            <td>
275
                            <td>
274
                                <input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" data-is-onloan="[% item.is_checked_out | html %]" />
276
                                <input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" data-is-onloan="[% item.is_checked_out | html %]" />
Lines 276-282 Link Here
276
                        [% END %]
278
                        [% END %]
277
                    [% ELSIF checkboxes_delete %]
279
                    [% ELSIF checkboxes_delete %]
278
                        [% UNLESS can_be_edited %]
280
                        [% UNLESS can_be_edited %]
279
                            <td class="error">Cannot delete</td>
281
                            <td class="error">
282
                                <i class="fa fa-times fa-lg" title="Cannot edit"></i>
283
			    </td>
280
                        [% ELSE %]
284
                        [% ELSE %]
281
                            [% IF item.safe_to_delete %]
285
                            [% IF item.safe_to_delete %]
282
                                <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /></td>
286
                                <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /></td>
Lines 293-299 Link Here
293
                                    [% END %]
297
                                    [% END %]
294
                                [% END %]
298
                                [% END %]
295
299
296
                                <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" disabled="disabled" title="[% cannot_delete_reason | html %]"/></td>
300
                                <td class="error">
301
                                    <i class="fa fa-times fa-lg" title="[% cannot_delete_reason | html %]"></i>
302
                                </td>
297
                            [% END %]
303
                            [% END %]
298
304
299
                        [% END %]
305
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js (-7 / +3 lines)
Lines 127-132 $(document).ready(function () { Link Here
127
        ],
127
        ],
128
        "bPaginate": false,
128
        "bPaginate": false,
129
    }));
129
    }));
130
    // Highlight in yellow item rows that cannot be deleted
131
    $(".error").parents('tr').find('td').css('background-color', '#ffff99');
132
130
    $("#selectallbutton").click(function (e) {
133
    $("#selectallbutton").click(function (e) {
131
        e.preventDefault();
134
        e.preventDefault();
132
        $("#itemst input:checkbox").each(function () {
135
        $("#itemst input:checkbox").each(function () {
Lines 139-150 $(document).ready(function () { Link Here
139
            $(this).prop("checked", false);
142
            $(this).prop("checked", false);
140
        });
143
        });
141
    });
144
    });
142
    $("#clearonloanbutton").click(function () {
143
        $("#itemst input[name='itemnumber'][data-is-onloan='1']").each(function () {
144
            $(this).prop('checked', false);
145
        });
146
        return false;
147
    });
148
    $("#selections input").change(function (e) {
145
    $("#selections input").change(function (e) {
149
        var num = $(this).attr("id");
146
        var num = $(this).attr("id");
150
        if (num == 'showall') {
147
        if (num == 'showall') {
151
- 

Return to bug 31611