Bug 16602 - Remove the use of "onclick" from several templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / batchMod-del.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/batchMod.js"></script>
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11
12 // Prepare array of all column headers, incrementing each index by
13 // two to accommodate control and title columns
14 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
15 for( x=0; x<allColumns.length; x++ ){
16   allColumns[x] = Number(allColumns[x]) + 2;
17 }
18 $(document).ready(function(){
19     $("#mainformsubmit").on("click",function(){
20         return submitBackgroundJob(this.form);
21     });
22 });
23 //]]>
24 </script>
25 <!--[if IE]>
26 <style type="text/css">#selections { display: none; }</style>
27 <![endif]-->
28 </head>
29 <body id="tools_batchMod-del" class="tools">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'cat-search.inc' %]
32
33 <div id="breadcrumbs">
34         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
35         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
36         <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
37 </div>
38
39 <div id="doc3" class="yui-t7">
40     <div id="bd">
41         <div id="yui-main">
42                 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
43             [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
44             [% 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 %]
45             [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
46             [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
47
48     [% UNLESS ( action ) %]
49
50     [% IF ( notfoundbarcodes ) %]
51             <div class="dialog alert">
52             [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
53                 </div>
54             <table style="margin:auto;">
55                 <thead>
56                     <tr>
57                         <th>Barcode</th>
58                     </tr>
59                 </thead>
60                 <tbody>
61                     [% FOREACH notfoundbarcode IN notfoundbarcodes %]
62                         <tr><td>[% notfoundbarcode.barcode %]</td></tr>
63                     [% END %]
64                 </tbody>
65             </table>
66             [% UNLESS ( too_many_items ) %]
67             [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
68             [% END %]
69         [% END %]
70
71
72 <form name="f" action="batchMod.pl" method="post">
73      <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
74      <input type="hidden" name="op" value="[% op %]" />
75      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
76      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
77      <input type="hidden" name="src" id="src" value="[% src %]" />
78      [% IF biblionumber %]
79         <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
80      [% END %]
81
82 [% IF ( item_loop ) %]
83     [% 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 %]
84         <div id="cataloguing_additem_itemlist">
85
86         <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>
87                 [% FOREACH item_header_loo IN item_header_loop %]
88                 <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
89                 [% END %]
90         </p>
91
92                 <table id="itemst">
93                     <thead>
94                         <tr>
95                             [% IF ( show ) %]<th>&nbsp;</th>[% END %]
96                 <th class="anti-the">Title</th>
97                             [% FOREACH item_header_loo IN item_header_loop %]
98                             <th> [% item_header_loo.header_value %] </th>
99                             [% END %]
100                         </tr>
101                     </thead>
102                     <tbody>
103             [% 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 %]
104                     <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>
105                         [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
106                                         [% END %] </tr>
107                     [% END %]
108                     </tbody>
109                 </table>
110         </div>
111 [% END %]
112
113 [% IF ( simple_items_display ) %]
114     <ul>
115     [% FOREACH simple_items_displa IN simple_items_display %]
116         <li>
117             <a href="[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>
118         </li>
119     [% END %]
120     </ul>
121 [% END %]
122
123
124 [% IF ( show ) %]
125
126 [% IF ( too_many_items ) %]
127     <p>Too many items ([% too_many_items %]) to display individually.</p>
128     [% FOREACH itemnumber IN itemnumbers_array %]
129         <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
130     [% END %]
131 [% END %]   
132
133 [% IF ( itemresults ) %]
134                 <div id="cataloguing_additem_newitem">
135              <input type="hidden" name="op" value="[% op %]" />
136              <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
137              <input type="hidden" name="del" value="1" />
138              <fieldset class="action">    
139                 <div id="jobpanel">
140                     <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
141                     <div id="jobfailed"></div>
142                 </div>
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" id="mainformsubmit" name="mainformsubmit" value="Delete ALL submitted items" />
146         [% ELSE %]
147             <input type="submit" id="mainformsubmit" 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 %] item(s) deleted.</p>
163             [% IF delete_records %] <p>[% deleted_records %] 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 %]">Return to the record</a>
166             [% ELSIF src %]
167                 <a href="[% src %]">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 %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% 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 %]</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 %]&amp;itemnumber=[% not_deleted_loo.itemnumber %]">[% not_deleted_loo.barcode %]</a>[% ELSE %][% not_deleted_loo.barcode %][% 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" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
201         [% ELSIF src %]
202            <a class="btn" href="[% src %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
203         [% ELSE %]
204            <a class="btn" 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     </div>
210 [% INCLUDE 'intranet-bottom.inc' %]