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