4 [% PROCESS 'i18n.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Tools › Batch item deletion</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 <div id="breadcrumbs">
17 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
18 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
19 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
22 <div class="main container-fluid">
24 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
25 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
26 [% 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 %]
27 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
28 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
30 [% UNLESS ( action ) %]
32 [% IF ( notfoundbarcodes.size ) %]
33 <div class="dialog alert">
34 [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
36 <table style="margin:auto;">
38 <tr><th>Barcodes not found</th></tr>
41 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
42 <tr><td>[% notfoundbarcode |html %]</td></td>
46 [% UNLESS ( too_many_items_display ) %]
47 [% IF ( item_loop ) %]
48 <h4>The following barcodes were found: </h4>
51 [% END %] <!-- /notfoundbarcodes -->
52 [% IF ( notfounditemnumbers.size ) %]
53 <div class="dialog alert">
54 [% IF ( itemresults ) %]<p>Warning, the following itemnumbers were not found:</p>[% ELSE %]<p>Warning: no itemnumbers were found</p>[% END %]
56 <table style="margin:auto;">
58 <tr><th>Itemnumbers not found</th></tr>
61 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
62 <tr><td>[% notfounditemnumber |html %]</td></td>
66 [% UNLESS ( too_many_items_display ) %]
67 [% IF ( item_loop ) %]
68 <h4>The following itemnumbers were found: </h4>
71 [% END %] <!-- /notfounditemnumbers -->
76 <form name="f" action="batchMod.pl" method="post">
77 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
78 <input type="hidden" name="op" value="[% op | html %]" />
79 <input type="hidden" name="searchid" value="[% searchid | html %]" />
80 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
81 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
82 <input type="hidden" name="src" id="src" value="[% src | html %]" />
84 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
87 [% IF ( item_loop ) %]
88 [% 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 %]
89 <div id="cataloguing_additem_itemlist">
91 <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>
92 [% FOREACH item_header_loo IN item_header_loop %]
93 <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>
100 [% IF ( show ) %]<th> </th>[% END %]
101 <th class="anti-the">Title</th>
102 <th class="holds_count" title="Item holds / Total holds">Holds</th>
103 [% FOREACH item_header_loo IN item_header_loop %]
104 <th> [% item_header_loo.header_value | html %] </th>
109 [% FOREACH item_loo IN item_loop %]
112 [% IF item_loo.nomod %]
113 <td class="error">Cannot delete</td>
115 [% SET can_be_deleted = item_loo.item.safe_to_delete %]
116 [% IF can_be_deleted == 1 %]
117 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td>
119 [% SWITCH can_be_deleted %]
120 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
121 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belongs to your library") %]
122 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
123 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
124 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record wich biblio-level hold on it") %]
125 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ can_be_deleted _ ')' %]
128 <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>
135 <label for="row[% item_loo.itemnumber | html %]">
136 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">
137 [% item_loo.title | html %]
139 [% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]
142 <td class="holds_count">
143 [% IF item_loo.holds %]
144 [% IF item_loo.item_holds %]
145 <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 -%]" >
147 <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 -%]" >
150 [% IF item_loo.holds %]
151 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this record: [% item_loo.holds | html -%]" >
153 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this record" >
156 [% IF item_loo.holds %]
157 [% item_loo.item_holds | html %]/[% item_loo.holds | html %]
159 [% item_loo.holds | html %]
163 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field | html %]</td>
171 [% IF ( simple_items_display ) %]
173 [% FOREACH simple_items_displa IN simple_items_display %]
175 <a href="[% simple_items_displa.itemnumber | url %]">[% simple_items_displa.barcode | html %]</a>
184 [% IF ( too_many_items_display ) %]
185 <p>Too many items ([% too_many_items_display | html %]) to display individually.</p>
186 [% FOREACH itemnumber IN itemnumbers_array %]
187 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
191 [% IF ( itemresults ) %]
192 <div id="cataloguing_additem_newitem">
193 <input type="hidden" name="op" value="[% op | html %]" />
194 <p>This will delete [% IF ( too_many_items_display ) %]all the[% ELSE %]the selected[% END %] items.</p>
195 <input type="hidden" name="del" value="1" />
196 <fieldset class="action">
197 <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
198 [% IF too_many_items_display %]
199 <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
201 <input type="submit" name="mainformsubmit" value="Delete selected items" />
204 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
208 <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
215 [% IF deletion_failed %]
216 <div class="dialog alert">
217 At least one item blocked the deletion. The operation rolled back and nothing happened!
220 <div class="dialog message">
221 <p>[% deleted_items | html %] item(s) deleted.</p>
222 [% IF delete_records %] <p>[% deleted_records | html %] record(s) deleted.</p> [% END %]
223 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
224 [% IF biblio_deleted %]
226 <div id="previous_search_link"></div>
228 <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Return to the cataloging module</a>
231 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]">Return to the record</a>
233 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
237 <a href="[% src | url %]">Return to where you were</a>
239 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
243 [% IF ( not_deleted_items ) %]
244 <div style="width:55%;margin:auto;">
245 <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>
246 [% IF ( not_deleted_loop ) %]
256 [% FOREACH not_deleted_loo IN not_deleted_loop %]
258 <td>[% not_deleted_loo.itemnumber | html %]</td>
259 <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>
261 [% SWITCH not_deleted_loo.reason %]
262 [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
263 [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belongs to your library") %]
264 [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
265 [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
266 [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record wich biblio-level hold on it") %]
267 [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ can_be_deleted _ ')' %]
269 [% cannot_delete_reason | html %]
280 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
281 [% IF biblio_deleted %]
282 <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>
284 <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>
286 <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>
289 <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
291 <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>
297 [% MACRO jsinclude BLOCK %]
298 [% Asset.js("js/tools-menu.js") | $raw %]
299 [% INCLUDE 'datatables.inc' %]
300 [% Asset.js("js/pages/batchMod.js") | $raw %]
301 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
302 [% Asset.js("js/browser.js") | $raw %]
303 <script type="text/javascript">
304 // Prepare array of all column headers, incrementing each index by
305 // two to accommodate control and title columns
306 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
307 for( x=0; x<allColumns.length; x++ ){
308 allColumns[x] = Number(allColumns[x]) + 2;
310 $(document).ready(function(){
311 $("#mainformsubmit").on("click",function(){
312 return submitBackgroundJob(this.form);
317 browser = KOHA.browser('[% searchid | html %]');
318 browser.show_back_link();
323 [% INCLUDE 'intranet-bottom.inc' %]