4 [% PROCESS 'i18n.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Batch item deletion › Tools › Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
9 <style>#selections { display: none; }</style>
12 <body id="tools_batchMod-del" class="tools">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
25 <a href="#" aria-current="page">Batch item deletion</a>
30 <div class="main container-fluid">
32 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
33 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
34 [% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
35 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
36 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
38 [% UNLESS ( action ) %]
40 [% IF ( notfoundbarcodes.size ) %]
41 <div class="dialog alert">
42 [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
44 <table style="margin:auto;">
46 <tr><th>Barcodes not found</th></tr>
49 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
50 <tr><td>[% notfoundbarcode |html %]</td></td>
54 [% UNLESS ( too_many_items_display ) %]
55 [% IF ( item_loop ) %]
56 <h4>The following barcodes were found: </h4>
59 [% END %] <!-- /notfoundbarcodes -->
60 [% IF ( notfounditemnumbers.size ) %]
61 <div class="dialog alert">
62 [% IF ( itemresults ) %]<p>Warning, the following itemnumbers were not found:</p>[% ELSE %]<p>Warning: no itemnumbers were found</p>[% END %]
64 <table style="margin:auto;">
66 <tr><th>Itemnumbers not found</th></tr>
69 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
70 <tr><td>[% notfounditemnumber |html %]</td></td>
74 [% UNLESS ( too_many_items_display ) %]
75 [% IF ( item_loop ) %]
76 <h4>The following itemnumbers were found: </h4>
79 [% END %] <!-- /notfounditemnumbers -->
84 <form name="f" action="batchMod.pl" method="post">
85 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
86 <input type="hidden" name="op" value="[% op | html %]" />
87 <input type="hidden" name="searchid" value="[% searchid | html %]" />
88 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
89 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
90 <input type="hidden" name="src" id="src" value="[% src | html %]" />
92 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
95 [% IF ( item_loop ) %]
96 [% IF ( show ) %]<div id="toolbar"><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></div>[% END %]
97 <div id="cataloguing_additem_itemlist">
99 <p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
100 [% FOREACH item_header_loo IN item_header_loop %]
101 <span class="selected"><input id="checkheader[% loop.count | html %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count | html %]">[% item_header_loo.header_value | html %]</label> </span>
108 [% IF ( show ) %]<th> </th>[% END %]
109 <th class="anti-the">Title</th>
110 <th class="holds_count" title="Item holds / Total holds">Holds</th>
111 [% FOREACH item_header_loo IN item_header_loop %]
112 <th> [% item_header_loo.header_value | html %] </th>
117 [% FOREACH item_loo IN item_loop %]
120 [% IF item_loo.nomod %]
121 <td class="error">Cannot delete</td>
123 [% SET can_be_deleted = item_loo.item.safe_to_delete %]
124 [% IF can_be_deleted == 1 %]
125 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td>
127 [% SWITCH can_be_deleted %]
128 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
129 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
130 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
131 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
132 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
133 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ can_be_deleted _ ')' %]
136 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" disabled="disabled" title="[% cannot_delete_reason | html %]"/></td>
143 <label for="row[% item_loo.itemnumber | html %]">
144 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">
145 [% item_loo.title | html %]
147 [% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]
150 <td class="holds_count">
151 [% IF item_loo.holds %]
152 [% IF item_loo.item_holds %]
153 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this item: [% item_loo.item_holds | html %] / Total holds on this record: [% item_loo.holds | html -%]" >
155 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this item / Total holds on this record: [% item_loo.holds | html -%]" >
158 [% IF item_loo.holds %]
159 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this record: [% item_loo.holds | html -%]" >
161 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this record" >
164 [% IF item_loo.holds %]
165 [% item_loo.item_holds | html %]/[% item_loo.holds | html %]
167 [% item_loo.holds | html %]
171 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field | html %]</td>
179 [% IF ( simple_items_display ) %]
181 [% FOREACH simple_items_displa IN simple_items_display %]
183 <a href="[% simple_items_displa.itemnumber | url %]">[% simple_items_displa.barcode | html %]</a>
192 [% IF ( too_many_items_display ) %]
193 <p>Too many items ([% too_many_items_display | html %]) to display individually.</p>
194 [% FOREACH itemnumber IN itemnumbers_array %]
195 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
199 [% IF ( itemresults ) %]
200 <div id="cataloguing_additem_newitem">
201 <input type="hidden" name="op" value="[% op | html %]" />
202 <p>This will delete [% IF ( too_many_items_display ) %]all the[% ELSE %]the selected[% END %] items.</p>
203 <input type="hidden" name="del" value="1" />
204 <fieldset class="action">
205 <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
206 [% IF too_many_items_display %]
207 <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
209 <input type="submit" name="mainformsubmit" value="Delete selected items" />
212 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
216 <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
223 [% IF deletion_failed %]
224 <div class="dialog alert">
225 At least one item blocked the deletion. The operation rolled back and nothing happened!
228 <div class="dialog message">
229 <p>[% deleted_items | html %] item(s) deleted.</p>
230 [% IF delete_records %] <p>[% deleted_records | html %] record(s) deleted.</p> [% END %]
231 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
232 [% IF biblio_deleted %]
234 <div id="previous_search_link"></div>
236 <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Return to the cataloging module</a>
239 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]">Return to the record</a>
241 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
245 <a href="[% src | url %]">Return to where you were</a>
247 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
251 [% IF ( not_deleted_items ) %]
252 <div style="width:55%;margin:auto;">
253 <p>[% not_deleted_items | html %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber | html %][% END %]</p>
254 [% IF ( not_deleted_loop ) %]
264 [% FOREACH not_deleted_loo IN not_deleted_loop %]
266 <td>[% not_deleted_loo.itemnumber | html %]</td>
267 <td>[% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% not_deleted_loo.biblionumber | uri %]&itemnumber=[% not_deleted_loo.itemnumber | uri %]">[% not_deleted_loo.barcode | html %]</a>[% ELSE %][% not_deleted_loo.barcode | html %][% END %]</td>
269 [% SWITCH not_deleted_loo.reason %]
270 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
271 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
272 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
273 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
274 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
275 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ can_be_deleted _ ')' %]
277 [% cannot_delete_reason | html %]
288 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
289 [% IF biblio_deleted %]
290 <a class="btn btn-default" href="/cgi-bin/koha/cataloguing/addbooks.pl"><i class="fa fa-check-square-o"></i> Return to the cataloging module</a>
292 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
294 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
297 <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
299 <a class="btn btn-default" href="/cgi-bin/koha/tools/batchMod.pl?del=1"><i class="fa fa-check-square-o"></i> Return to batch item deletion</a>
305 [% MACRO jsinclude BLOCK %]
306 [% Asset.js("js/tools-menu.js") | $raw %]
307 [% INCLUDE 'datatables.inc' %]
308 [% Asset.js("js/pages/batchMod.js") | $raw %]
309 [% Asset.js("js/browser.js") | $raw %]
311 // Prepare array of all column headers, incrementing each index by
312 // two to accommodate control and title columns
313 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
314 for( x=0; x<allColumns.length; x++ ){
315 allColumns[x] = Number(allColumns[x]) + 2;
317 $(document).ready(function(){
318 $("#mainformsubmit").on("click",function(){
319 return submitBackgroundJob(this.form);
324 browser = KOHA.browser('[% searchid | html %]');
325 browser.show_back_link();
330 [% INCLUDE 'intranet-bottom.inc' %]