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" }
67 <body id="tools_batch_delete_records" class="tools">
68 [% INCLUDE 'header.inc' %]
69 [% INCLUDE 'cat-search.inc' %]
71 <div id="breadcrumbs">
72 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
73 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
74 <a href="/cgi-bin/koha/tools/batch_delete_records.pl">Batch record deletion</a>
77 <div id="doc3" class="yui-t2">
81 <h1>Batch record deletion</h1>
82 [% FOREACH message IN messages %]
83 [% IF message.type == 'success' %]
84 <div class="dialog message">
85 [% ELSIF message.type == 'warning' %]
86 <div class="dialog alert">
87 [% ELSIF message.type == 'error' %]
88 <div class="dialog error" style="margin:auto;">
90 [% IF message.code == 'biblio_not_exists' %]
91 The biblionumber [% message.biblionumber %] does not exist in the database.
92 [% ELSIF message.code == 'authority_not_exists' %]
93 The authority id [% message.authid %] does not exist in the database.
94 [% ELSIF message.code == 'item_issued' %]
95 At least one item is checked out on bibliographic record [% message.biblionumber %].
96 [% ELSIF message.code == 'reserve_not_cancelled' %]
97 Bibliographic record [% message.biblionumber %] was not deleted. A hold could not be canceled (reserve_id [% message.reserve_id %]).
98 [% ELSIF message.code == 'item_not_deleted' %]
99 The bibliographic record [% message.biblionumber %] was not deleted. An error was encountered when deleting an item (itemnumber [% message.itemnumber %]).
100 [% ELSIF message.code == 'biblio_not_deleted' %]
101 Bibliographic record [% message.biblionumber %] was not deleted. An error occurred.
102 [% ELSIF message.code == 'authority_not_deleted' %]
103 Authority record [% message.authid %] was not deleted. An error occurred.
104 [% ELSIF message.code == 'biblio_deleted' %]
105 Bibliographic record [% message.biblionumber %] has been deleted successfully.
106 [% ELSIF message.code == 'authority_deleted' %]
107 Authority [% message.authid %] has been deleted successfully.
109 [% IF message.error %]
110 (The error was: [% message.error%], see the Koha log file for more information).
114 [% IF op == 'form' %]
115 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_delete_records.pl">
116 <fieldset class="rows">
117 <legend>Record type</legend>
119 <li><label for="biblio_type">Bibliographic: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
120 <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
123 <fieldset class="rows">
124 <legend>Use a file</legend>
126 <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
129 <fieldset class="rows">
130 <legend>Or enter a list of record numbers</legend>
133 <label for="recordnumber_list">Record number list (one per line): </label>
134 <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
138 <fieldset class="action">
139 <input type="hidden" name="op" value="list" />
140 <input type="submit" value="Continue" class="button" />
141 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
144 [% ELSIF op == 'list' %]
146 [% IF recordtype == 'biblio' %]
148 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
149 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
150 | <a id="selectwithoutitems" href="#">Select without items</a>
151 | <a id="selectnotreserved" href="#">Select without holds</a>
153 <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post">
154 <table id="biblios" class="records">
158 <th>Biblionumber</th>
166 [% FOR biblio IN records %]
168 <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>
169 <td><label for="record_id_[% biblio.biblionumber %]">[% biblio.biblionumber %]</label></td>
170 <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>
171 <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.itemnumbers.size %]</a></td>
172 <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.reserves.size %]</a></td>
173 <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.issues_count %]</a></td>
178 <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>
181 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
182 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
183 | <a id="clearlinkedtobiblio" href="#">Clear used authorities</a>
185 <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post">
186 <table id="authorities" class="records">
196 [% FOR authority IN records %]
198 <td><input type="checkbox" name="record_id" value="[% authority.authid %]" data-usage="[% authority.count_usage %]" /></td>
199 <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid %]">[% authority.authid %]</a></td>
200 <td>[% PROCESS authresult summary=authority.summary %]</td>
201 <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>
206 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will delete all selected authorities!</div>
208 <fieldset class="action">
209 <input type="hidden" name="op" value="delete" />
210 <input type="hidden" name="recordtype" value="[% recordtype %]" />
211 <input type="submit" value="Delete selected records" class="button" />
212 <a class="cancel" href="/cgi-bin/koha/tools/batch_delete_records.pl">Cancel</a>
216 There are no record ids defined.
218 [% ELSIF op == 'report' %]
219 [% IF report.total_records == report.total_success %]
220 All records have been deleted successfully!
221 [% ELSIF report.total_success == 0 %]
222 No record has been deleted. An error occurred.
224 [% report.total_success %] / [% report.total_records %] records have been deleted successfully but some errors occurred.
226 <p><a href="/cgi-bin/koha/tools/batch_delete_records.pl" title="New batch record deletion">New batch record deletion</a></p>
228 No action defined for the template.
233 [% INCLUDE 'tools-menu.inc' %]
236 [% INCLUDE 'intranet-bottom.inc' %]