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