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 [% END %] <!-- /notfoundbarcodes -->
55 [% IF ( notfounditemnumbers.size ) %]
56 <div class="dialog alert">
57 [% IF ( itemresults ) %]<p>Warning, the following itemnumbers were not found:</p>[% ELSE %]<p>Warning: no itemnumbers were found</p>[% END %]
59 <table style="margin:auto;">
61 <tr><th>Itemnumbers not found</th></tr>
64 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
65 <tr><td>[% notfounditemnumber |html %]</td></td>
69 [% END %] <!-- /notfounditemnumbers -->
71 [% IF cannot_be_deleted.size %]
72 <div class="dialog alert">
73 <p>Warning, the following items cannot be deleted: </p>
75 <table style="margin:auto;">
77 <tr><th>Cannot be deleted</th></tr>
80 [% FOREACH barcode IN cannot_be_deleted %]
81 <tr><td>[% barcode | html %]</td></td>
87 [% IF ( notfoundbarcodes.size || notfounditemnumbers.size || cannot_be_deleted.size ) && !too_many_items_display && item_loop %]
88 <h4>The following barcodes were found: </h4>
92 <form name="f" action="batchMod.pl" method="post">
93 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
94 <input type="hidden" name="op" value="[% op | html %]" />
95 <input type="hidden" name="searchid" value="[% searchid | html %]" />
96 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
97 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
98 <input type="hidden" name="src" id="src" value="[% src | html %]" />
100 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
103 [% IF ( item_loop ) %]
104 [% 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 %]
105 <div id="cataloguing_additem_itemlist">
107 <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>
108 [% FOREACH item_header_loo IN item_header_loop %]
109 <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>
116 [% IF ( show ) %]<th> </th>[% END %]
117 <th class="anti-the">Title</th>
118 <th class="holds_count" title="Item holds / Total holds">Holds</th>
119 [% FOREACH item_header_loo IN item_header_loop %]
120 <th> [% item_header_loo.header_value | html %] </th>
125 [% FOREACH item_loo IN item_loop %]
128 [% IF item_loo.nomod %]
129 <td class="error">Cannot delete</td>
131 [% IF item_loo.safe_to_delete == 1 %]
132 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td>
134 [% SWITCH item_loo.safe_to_delete%]
135 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
136 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
137 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
138 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
139 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
140 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ item_loo.safe_to_delete _ ')' %]
143 <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>
150 <label for="row[% item_loo.itemnumber | html %]">
151 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">
152 [% item_loo.title | html %]
154 [% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]
157 <td class="holds_count">
158 [% IF item_loo.holds %]
159 [% IF item_loo.item_holds %]
160 <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 -%]" >
162 <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 -%]" >
165 [% IF item_loo.holds %]
166 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this record: [% item_loo.holds | html -%]" >
168 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this record" >
171 [% IF item_loo.holds %]
172 [% item_loo.item_holds | html %]/[% item_loo.holds | html %]
174 [% item_loo.holds | html %]
178 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field | html %]</td>
186 [% IF ( simple_items_display ) %]
188 [% FOREACH simple_items_displa IN simple_items_display %]
190 <a href="[% simple_items_displa.itemnumber | url %]">[% simple_items_displa.barcode | html %]</a>
199 [% IF ( too_many_items_display ) %]
200 <p>Too many items ([% too_many_items_display | html %]) to display individually.</p>
201 [% FOREACH itemnumber IN itemnumbers_array %]
202 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
206 [% IF ( itemresults ) %]
207 <div id="cataloguing_additem_newitem">
208 <input type="hidden" name="op" value="[% op | html %]" />
209 <p>This will delete [% IF ( too_many_items_display ) %]all the[% ELSE %]the selected[% END %] items.</p>
210 <input type="hidden" name="del" value="1" />
211 <fieldset class="action">
212 <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
213 [% IF too_many_items_display %]
214 <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
216 <input type="submit" name="mainformsubmit" value="Delete selected items" />
219 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
223 <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
230 [% IF deletion_failed %]
231 <div class="dialog alert">
232 At least one item blocked the deletion. The operation rolled back and nothing happened!
235 <div class="dialog message">
236 <p>[% deleted_items | html %] item(s) deleted.</p>
237 [% IF delete_records %] <p>[% deleted_records | html %] record(s) deleted.</p> [% END %]
238 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
239 [% IF biblio_deleted %]
241 <div id="previous_search_link"></div>
243 <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Return to the cataloging module</a>
246 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]">Return to the record</a>
248 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
252 <a href="[% src | url %]">Return to where you were</a>
254 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
258 [% IF ( not_deleted_items ) %]
259 <div style="width:55%;margin:auto;">
260 <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>
261 [% IF ( not_deleted_loop ) %]
271 [% FOREACH not_deleted_loo IN not_deleted_loop %]
273 <td>[% not_deleted_loo.itemnumber | html %]</td>
274 <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>
276 [% SWITCH not_deleted_loo.reason %]
277 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
278 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
279 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
280 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
281 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
282 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ can_be_deleted _ ')' %]
284 [% cannot_delete_reason | html %]
295 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
296 [% IF biblio_deleted %]
297 <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>
299 <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>
301 <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>
304 <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
306 <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>
312 [% MACRO jsinclude BLOCK %]
313 [% Asset.js("js/tools-menu.js") | $raw %]
314 [% INCLUDE 'datatables.inc' %]
315 [% Asset.js("js/pages/batchMod.js") | $raw %]
316 [% Asset.js("js/browser.js") | $raw %]
318 // Prepare array of all column headers, incrementing each index by
319 // two to accommodate control and title columns
320 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
321 for( x=0; x<allColumns.length; x++ ){
322 allColumns[x] = Number(allColumns[x]) + 2;
324 $(document).ready(function(){
325 $("#mainformsubmit").on("click",function(){
326 return submitBackgroundJob(this.form);
331 browser = KOHA.browser('[% searchid | html %]');
332 browser.show_back_link();
337 [% INCLUDE 'intranet-bottom.inc' %]