1 [% PROCESS 'authorities-search-results.inc' %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Batch record deletion</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8 <script type="text/javascript">
10 var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
11 $(document).ready(function() {
12 $("#selectall").click(function(e){
14 $(".records").checkCheckboxes();
16 $("#clearall").click(function(e){
18 $(".records").unCheckCheckboxes();
20 $("#selectwithoutitems").click(function(e){
22 $("#biblios").checkCheckboxes(":input[data-items='0']:not(:disabled)");
24 $("#selectnotreserved").click(function(e){
26 $("#biblios").checkCheckboxes(":input[data-reserves='0']:not(:disabled)");
29 $("#clearlinkedtobiblio").click(function(e){
31 $("#authorities").unCheckCheckboxes(":not(input[data-usage='0'])");
33 $("#selectall").click();
35 [% IF recordtype == 'biblio' %]
36 $(".records input:checkbox[data-issues!='0']").each(function(){
37 $(this).attr('title', MSG_CANNOT_BE_DELETED)
38 $(this).prop('disabled', true);
39 $(this).prop('checked', false);
40 $(this).parents('tr').find('td').css('background-color', '#ffff99');
44 $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
46 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
47 { "aTargets": [ 3, 4 ], "sType": "num-html" }
54 $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
56 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
57 { "aTargets": [ 3 ], "sType": "num-html" }
64 $("#selectrecords").on("submit",function(){
65 var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size();
67 alert(_("No records have been selected."));
72 $("#selectauths").on("submit",function(){
73 var checked = $("#selectauths").find("input[type='checkbox'][name='record_id']:checked").size();
75 alert(_("No authorities have been selected."));
83 <body id="tools_batch_delete_records" class="tools">
84 [% INCLUDE 'header.inc' %]
85 [% INCLUDE 'cat-search.inc' %]
87 <div id="breadcrumbs">
88 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
89 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
90 <a href="/cgi-bin/koha/tools/batch_delete_records.pl">Batch record deletion</a>
93 <div id="doc3" class="yui-t2">
97 <h1>Batch record deletion</h1>
98 [% FOREACH message IN messages %]
99 [% IF message.type == 'success' %]
100 <div class="dialog message">
101 [% ELSIF message.type == 'warning' %]
102 <div class="dialog alert">
103 [% ELSIF message.type == 'error' %]
104 <div class="dialog error" style="margin:auto;">
106 [% IF message.code == 'biblio_not_exists' %]
107 The biblionumber [% message.biblionumber %] does not exist in the database.
108 [% ELSIF message.code == 'authority_not_exists' %]
109 The authority id [% message.authid %] does not exist in the database.
110 [% ELSIF message.code == 'item_issued' %]
111 At least one item is checked out on bibliographic record [% message.biblionumber %].
112 [% ELSIF message.code == 'reserve_not_cancelled' %]
113 Bibliographic record [% message.biblionumber %] was not deleted. A hold could not be canceled (reserve_id [% message.reserve_id %]).
114 [% ELSIF message.code == 'item_not_deleted' %]
115 The bibliographic record [% message.biblionumber %] was not deleted. An error was encountered when deleting an item (itemnumber [% message.itemnumber %]).
116 [% ELSIF message.code == 'biblio_not_deleted' %]
117 Bibliographic record [% message.biblionumber %] was not deleted. An error occurred.
118 [% ELSIF message.code == 'authority_not_deleted' %]
119 Authority record [% message.authid %] was not deleted. An error occurred.
120 [% ELSIF message.code == 'biblio_deleted' %]
121 Bibliographic record [% message.biblionumber %] has been deleted successfully.
122 [% ELSIF message.code == 'authority_deleted' %]
123 Authority [% message.authid %] has been deleted successfully.
125 [% IF message.error %]
126 (The error was: [% message.error%], see the Koha log file for more information).
130 [% IF op == 'form' %]
131 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_delete_records.pl">
132 <fieldset class="rows">
133 <legend>Record type</legend>
135 <li><label for="biblio_type">Bibliographic: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
136 <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
139 <fieldset class="rows">
140 <legend>Use a file</legend>
142 <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
145 <fieldset class="rows">
146 <legend>Or enter a list of record numbers</legend>
149 <label for="recordnumber_list">Record number list (one per line): </label>
150 <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
154 <fieldset class="action">
155 <input type="hidden" name="op" value="list" />
156 <input type="submit" value="Continue" class="button" />
157 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
160 [% ELSIF op == 'list' %]
162 [% IF recordtype == 'biblio' %]
164 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
165 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
166 | <a id="selectwithoutitems" href="#">Select without items</a>
167 | <a id="selectnotreserved" href="#">Select without holds</a>
169 <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectrecords">
170 <table id="biblios" class="records">
174 <th>Biblionumber</th>
182 [% FOR biblio IN records %]
184 <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber %]" value="[% biblio.biblionumber %]" data-items="[% biblio.itemnumbers.size %]" data-issues="[% biblio.issues_count %]" data-reserves="[% biblio.reserves.size %]" /></td>
185 <td><label for="record_id_[% biblio.biblionumber %]">[% biblio.biblionumber %]</label></td>
186 <td>[% INCLUDE 'biblio-default-view.inc' biblionumber=biblio.biblionumber %][% biblio.title %][% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle %] [% subtitle.subfield |html %][% END %][% END %]</a></td>
187 <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.itemnumbers.size %]</a></td>
188 <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.reserves.size %]</a></td>
189 <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.issues_count %]</a></td>
194 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will delete all selected bibliographic records, attached subscriptions, existing holds, and attached items!</div>
197 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
198 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
199 | <a id="clearlinkedtobiblio" href="#">Clear used authorities</a>
201 <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectauths">
202 <table id="authorities" class="records">
212 [% FOR authority IN records %]
214 <td><input type="checkbox" name="record_id" value="[% authority.authid %]" data-usage="[% authority.count_usage %]" /></td>
215 <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid %]">[% authority.authid %]</a></td>
216 <td>[% PROCESS authresult summary=authority.summary %]</td>
217 <td><a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&idx=an,phr&q=[% authority.authid %]">[% authority.count_usage %] record(s)</a></td>
222 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will delete all selected authorities!</div>
224 <fieldset class="action">
225 <input type="hidden" name="op" value="delete" />
226 <input type="hidden" name="recordtype" value="[% recordtype %]" />
227 <input type="submit" value="Delete selected records" class="button" />
228 <a class="cancel" href="/cgi-bin/koha/tools/batch_delete_records.pl">Cancel</a>
232 There are no record ids defined.
234 [% ELSIF op == 'report' %]
235 [% IF report.total_records == report.total_success %]
236 All records have been deleted successfully!
237 [% ELSIF report.total_success == 0 %]
238 No record has been deleted. An error occurred.
240 [% report.total_success %] / [% report.total_records %] records have been deleted successfully but some errors occurred.
242 <p><a href="/cgi-bin/koha/tools/batch_delete_records.pl" title="New batch record deletion">New batch record deletion</a></p>
244 No action defined for the template.
249 [% INCLUDE 'tools-menu.inc' %]
252 [% INCLUDE 'intranet-bottom.inc' %]