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