Line 0
Link Here
|
|
|
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="[% themelang %]/css/datatables.css" /> |
6 |
[% INCLUDE 'datatables.inc' %] |
7 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
8 |
<script type="text/javascript"> |
9 |
//<![CDATA[ |
10 |
var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently issued"); |
11 |
$(document).ready(function() { |
12 |
$("#selectall").click(function(e){ |
13 |
e.preventDefault(); |
14 |
$(".records").checkCheckboxes(); |
15 |
}); |
16 |
$("#clearall").click(function(e){ |
17 |
e.preventDefault(); |
18 |
$(".records").unCheckCheckboxes(); |
19 |
}); |
20 |
$("#selectwithoutitems").click(function(e){ |
21 |
e.preventDefault(); |
22 |
$("#biblios").checkCheckboxes(":input[data-items='0']"); |
23 |
}); |
24 |
$("#selectnotreserved").click(function(e){ |
25 |
e.preventDefault(); |
26 |
$("#biblios").checkCheckboxes(":input[data-reserves='0']"); |
27 |
|
28 |
}); |
29 |
$("#clearlinkedtobiblio").click(function(e){ |
30 |
e.preventDefault(); |
31 |
$("#authorities").unCheckCheckboxes(":not(input[data-usage='0'])"); |
32 |
}); |
33 |
$("#selectall").click(); |
34 |
|
35 |
[% IF recordtype == 'biblio' %] |
36 |
$(".records input:checkbox[data-issues!='0']").each(function(){ |
37 |
$(this).attr('title', MSG_CANNOT_BE_DELETED) |
38 |
$(this).attr('disabled', true); |
39 |
$(this).attr('checked', false); |
40 |
$(this).parents('tr').find('td').css('background-color', 'red'); |
41 |
}); |
42 |
[% END %] |
43 |
|
44 |
$("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, { |
45 |
"aoColumnDefs": [ |
46 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
47 |
{ "aTargets": [ 3, 4 ], "sType": "num-html" } |
48 |
], |
49 |
"sDom": 't', |
50 |
"aaSorting": [], |
51 |
"bPaginate": false |
52 |
})); |
53 |
|
54 |
$("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, { |
55 |
"aoColumnDefs": [ |
56 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
57 |
{ "aTargets": [ 3 ], "sType": "num-html" } |
58 |
], |
59 |
"sDom": 't', |
60 |
"aaSorting": [], |
61 |
"bPaginate": false |
62 |
})); |
63 |
}); |
64 |
//]]> |
65 |
</script> |
66 |
</head> |
67 |
<body id="tools_batch_delete_records" class="tools"> |
68 |
[% INCLUDE 'header.inc' %] |
69 |
[% INCLUDE 'cat-search.inc' %] |
70 |
|
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> |
75 |
</div> |
76 |
|
77 |
<div id="doc3" class="yui-t2"> |
78 |
<div id="bd"> |
79 |
<div id="yui-main"> |
80 |
<div class="yui-b"> |
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;"> |
89 |
[% END %] |
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 issued for the biblio [% message.biblionumber %]. |
96 |
[% ELSIF message.code == 'reserve_not_cancelled' %] |
97 |
The biblio [% message.biblionumber %] has not been deleted. A reserve (reserve_id [% message.reserve_id %]) caused an error on cancel. |
98 |
[% ELSIF message.code == 'item_not_deleted' %] |
99 |
The biblio [% message.biblionumber %] has not been deleted. An item (itemnumber [% message.itemnumber %]) caused an error on delete. |
100 |
[% ELSIF message.code == 'biblio_not_deleted' %] |
101 |
The biblio [% message.biblionumber %] has not been deleted. An error occurred on deleting it. |
102 |
[% ELSIF message.code == 'authority_not_deleted' %] |
103 |
The authority [% message.authid %] has not been deleted. An error occurred on deleting it. |
104 |
[% ELSIF message.code == 'biblio_deleted' %] |
105 |
The biblio [% message.biblionumber %] has successfully been deleted. |
106 |
[% ELSIF message.code == 'authority_deleted' %] |
107 |
The authority [% message.authid %] has successfully been deleted. |
108 |
[% END %] |
109 |
[% IF message.error %] |
110 |
(The error was: [% message.error%], see the Koha logfile for more information). |
111 |
[% END %] |
112 |
</div> |
113 |
[% END %] |
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> |
118 |
<ol> |
119 |
<li><label for="biblio_type">Biblios: </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> |
121 |
</ol> |
122 |
</fieldset> |
123 |
<fieldset class="rows"> |
124 |
<legend>Use a file</legend> |
125 |
<ol> |
126 |
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li> |
127 |
</ol> |
128 |
</fieldset> |
129 |
<fieldset class="rows"> |
130 |
<legend>Or enter a list of record numbers</legend> |
131 |
<ol> |
132 |
<li> |
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> |
135 |
</li> |
136 |
</ol> |
137 |
</fieldset> |
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> |
142 |
</fieldset> |
143 |
</form> |
144 |
[% ELSIF op == 'list' %] |
145 |
[% IF records %] |
146 |
[% IF recordtype == 'biblio' %] |
147 |
<div id="toolbar"> |
148 |
<a id="selectall" href="#">Select All</a> |
149 |
| <a id="clearall" href="#">Clear All</a> |
150 |
| <a id="selectwithoutitems" href="#">Select without items</a> |
151 |
| <a id="selectnotreserved" href="#">Select not reserved</a> |
152 |
</div> |
153 |
<form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post"> |
154 |
<table id="biblios" class="records"> |
155 |
<thead> |
156 |
<tr> |
157 |
<th></th> |
158 |
<th>Biblionumber</th> |
159 |
<th>Title</th> |
160 |
<th>Items</th> |
161 |
<th>Reserves</th> |
162 |
<th>Issues</th> |
163 |
</tr> |
164 |
</thead> |
165 |
<tbody> |
166 |
[% FOR biblio IN records %] |
167 |
<tr> |
168 |
<td><input type="checkbox" name="record_id" value="[% biblio.biblionumber %]" data-items="[% biblio.itemnumbers.size %]" data-issues="[% biblio.issues_count %]" data-reserves="[% biblio.reserves.size %]" /></td> |
169 |
<td>[% biblio.biblionumber %]</td> |
170 |
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</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> |
174 |
</tr> |
175 |
[% END %] |
176 |
</tbody> |
177 |
</table> |
178 |
<div class="note">Reminder: this action will delete all selected biblios, attached subscriptions, existing holds and items!</div> |
179 |
[% ELSE %] |
180 |
<div id="toolbar"> |
181 |
<a id="selectall" href="#">Select All</a> |
182 |
| <a id="clearall" href="#">Clear All</a> |
183 |
| <a id="clearlinkedtobiblio" href="#">Clear linked to biblio </a> |
184 |
</div> |
185 |
<form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post"> |
186 |
<table id="authorities" class="records"> |
187 |
<thead> |
188 |
<tr> |
189 |
<th></th> |
190 |
<th>Authid</th> |
191 |
<th>Summary</th> |
192 |
<th>Used in</th> |
193 |
</tr> |
194 |
</thead> |
195 |
<tbody> |
196 |
[% FOR authority IN records %] |
197 |
<tr> |
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 %] biblio(s)</a></td> |
202 |
</tr> |
203 |
[% END %] |
204 |
</tbody> |
205 |
</table> |
206 |
<div class="note">Reminder: this action will delete all selected authorities!</div> |
207 |
[% END %] |
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> |
213 |
</fieldset> |
214 |
</form> |
215 |
[% ELSE %] |
216 |
There is no record ids defined. |
217 |
[% END %] |
218 |
[% ELSIF op == 'report' %] |
219 |
[% IF report.total_records == report.total_success %] |
220 |
All records have successfully been deleted! |
221 |
[% ELSE %] |
222 |
[% report.total_success %] / [% report.total_records %] records have successfully been deleted. |
223 |
Some errors occurred. |
224 |
[% END %] |
225 |
<p><a href="/cgi-bin/koha/tools/batch_delete_records.pl" title="New batch record deletion">New batch record deletion</a></p> |
226 |
[% ELSE %] |
227 |
No action defined for the template. |
228 |
[% END %] |
229 |
</div> |
230 |
</div> |
231 |
<div class="yui-b"> |
232 |
[% INCLUDE 'tools-menu.inc' %] |
233 |
</div> |
234 |
</div> |
235 |
[% INCLUDE 'intranet-bottom.inc' %] |