Bug 21413: (QA follow-up) Rename new option
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / batchMod-del.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.css("css/datatables.css") | $raw %]
8 <!--[if IE]>
9 <style type="text/css">#selections { display: none; }</style>
10 <![endif]-->
11 </head>
12 <body id="tools_batchMod-del" class="tools">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
15
16 <div id="breadcrumbs">
17     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
18     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
19     <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
20 </div>
21
22 <div class="main container-fluid">
23
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 %]
29
30     [% UNLESS ( action ) %]
31
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 %]
35         </div>
36         <table style="margin:auto;">
37             <thead>
38                 <tr><th>Barcodes not found</th></tr>
39             </thead>
40             <tbody>
41                 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
42                     <tr><td>[% notfoundbarcode |html %]</td></td>
43                 [% END %]
44             </tbody>
45         </table>
46         [% IF ( item_loop ) %]
47             [% UNLESS ( too_many_items ) %]
48                 <h4>The following barcodes were found: </h4>
49             [% END %]
50         [% END %]
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 %]
55         </div>
56         <table style="margin:auto;">
57             <thead>
58                 <tr><th>Itemnumbers not found</th></tr>
59             </thead>
60             <tbody>
61                 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
62                     <tr><td>[% notfounditemnumber |html %]</td></td>
63                 [% END %]
64             </tbody>
65         </table>
66         [% IF ( item_loop ) %]
67             [% UNLESS ( too_many_items ) %]
68                 <h4>The following itemnumbers were found: </h4>
69             [% END %]
70         [% END %]
71     [% END %] <!-- /notfounditemnumbers -->
72
73
74
75
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="uploadedfileid" id="uploadedfileid" value="" />
80      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
81      <input type="hidden" name="src" id="src" value="[% src | html %]" />
82      [% IF biblionumber %]
83         <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
84      [% END %]
85
86 [% IF ( item_loop ) %]
87     [% 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 %]
88     <div id="cataloguing_additem_itemlist">
89
90     <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>
91         [% FOREACH item_header_loo IN item_header_loop %]
92         <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>
93         [% END %]
94     </p>
95
96         <table id="itemst">
97             <thead>
98             <tr>
99                 [% IF ( show ) %]<th>&nbsp;</th>[% END %]
100                 <th class="anti-the">Title</th>
101                 [% FOREACH item_header_loo IN item_header_loop %]
102                 <th> [% item_header_loo.header_value | html %] </th>
103                 [% END %]
104             </tr>
105             </thead>
106             <tbody>
107             [% FOREACH item_loo IN item_loop %] <tr> [% IF ( show ) %][% IF ( item_loo.nomod ) %] <td class="error">Cannot edit</td>[% ELSE %]<td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td>[% END %][% END %]
108             <td><label for="row[% item_loo.itemnumber | html %]"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">[% item_loo.title | html %]</a>[% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]</label></td>
109             [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field | html %]</td>
110                     [% END %] </tr>
111             [% END %]
112             </tbody>
113         </table>
114     </div>
115 [% END %]
116
117 [% IF ( simple_items_display ) %]
118     <ul>
119     [% FOREACH simple_items_displa IN simple_items_display %]
120         <li>
121             <a href="[% simple_items_displa.itemnumber | uri %]">[% simple_items_displa.barcode | html %]</a>
122         </li>
123     [% END %]
124     </ul>
125 [% END %]
126
127
128 [% IF ( show ) %]
129
130 [% IF ( too_many_items ) %]
131     <p>Too many items ([% too_many_items | html %]) to display individually.</p>
132     [% FOREACH itemnumber IN itemnumbers_array %]
133         <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
134     [% END %]
135 [% END %]
136
137 [% IF ( itemresults ) %]
138         <div id="cataloguing_additem_newitem">
139          <input type="hidden" name="op" value="[% op | html %]" />
140          <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
141          <input type="hidden" name="del" value="1" />
142          <fieldset class="action">
143         <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
144         [% IF too_many_items %]
145             <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
146         [% ELSE %]
147             <input type="submit" name="mainformsubmit" value="Delete selected items" />
148         [% END %]
149
150         <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
151         </fieldset>
152     </div>
153     [% ELSE %]
154     <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
155     [% END %]
156     [% END %]
157     </form>
158     [% END %]
159
160 [% IF ( action ) %]
161     <div class="dialog message">
162             <p>[% deleted_items | html %] item(s) deleted.</p>
163             [% IF delete_records %] <p>[% deleted_records | html %] record(s) deleted.</p> [% END %]
164             [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
165                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
166             [% ELSIF src %]
167                 <a href="[% src | uri %]">Return to where you were</a>
168             [% ELSE %]
169                 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
170             [% END %]
171         </div>
172     [% IF ( not_deleted_items ) %]
173     <div style="width:55%;margin:auto;">
174         <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>
175     [% IF ( not_deleted_loop ) %]
176     <table id="itemst">
177         <thead>
178             <tr>
179             <th>Itemnumber</th>
180             <th>Barcode</th>
181             <th>Reason</th>
182             </tr>
183         </thead>
184         <tbody>
185             [% FOREACH not_deleted_loo IN not_deleted_loop %]
186             <tr>
187                 <td>[% not_deleted_loo.itemnumber | html %]</td>
188                 <td>[% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% not_deleted_loo.biblionumber | uri %]&amp;itemnumber=[% not_deleted_loo.itemnumber | uri %]">[% not_deleted_loo.barcode | html %]</a>[% ELSE %][% not_deleted_loo.barcode | html %][% END %]</td>
189                 <td>[% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]</td>
190             </tr>
191             [% END %]
192         </tbody>
193         </table>
194     [% END %]
195     </div>
196     [% END %]
197
198     <p>
199         [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
200            <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | html %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
201         [% ELSIF src %]
202            <a class="btn btn-default" href="[% src | html %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
203         [% ELSE %]
204            <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>
205         [% END %]
206     </p>
207 [% END %]
208     </div>
209
210 [% MACRO jsinclude BLOCK %]
211     [% Asset.js("js/tools-menu.js") | $raw %]
212     [% INCLUDE 'datatables.inc' %]
213     [% Asset.js("js/pages/batchMod.js") | $raw %]
214     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
215     <script type="text/javascript">
216         // Prepare array of all column headers, incrementing each index by
217         // two to accommodate control and title columns
218         var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
219         for( x=0; x<allColumns.length; x++ ){
220           allColumns[x] = Number(allColumns[x]) + 2;
221         }
222         $(document).ready(function(){
223             $("#mainformsubmit").on("click",function(){
224                 return submitBackgroundJob(this.form);
225             });
226         });
227     </script>
228 [% END %]
229
230 [% INCLUDE 'intranet-bottom.inc' %]