Merge branch 'bug_8641' into 3.12-master
[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="[% themelang %]/js/background-job-progressbar.js"></script>
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8 <script type="text/javascript">
9 //<![CDATA[
10
11 // Prepare array of all column headers, incrementing each index by
12 // two to accomodate control and title columns
13 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
14 for( x=0; x<allColumns.length; x++ ){
15   allColumns[x] = Number(allColumns[x]) + 2;
16 }
17 //]]>
18 </script>
19 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
20 <!--[if IE]>
21 <style type="text/css">#selections { display: none; }</style>
22 <![endif]-->
23 </head>
24 <body id="tools_batchMod-del" class="tools">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'cat-search.inc' %]
27
28 <div id="breadcrumbs">
29         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
30         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
31         <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
32 </div>
33
34 <div id="doc3" class="yui-t7">
35     <div id="bd">
36         <div id="yui-main">
37                 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
38             [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
39             [% 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 %]
40             [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
41             [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
42
43     [% UNLESS ( action ) %]
44
45     [% IF ( notfoundbarcodes ) %]
46             <div class="dialog alert">
47             [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
48                 </div>
49             <table style="margin:auto;">
50                 <thead>
51                     <tr>
52                         <th>Barcode</th>
53                     </tr>
54                 </thead>
55                 <tbody>
56                     [% FOREACH notfoundbarcode IN notfoundbarcodes %]
57                         <tr><td>[% notfoundbarcode.barcode %]</td></tr>
58                     [% END %]
59                 </tbody>
60             </table>
61             [% UNLESS ( too_many_items ) %]
62             [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
63             [% END %]
64         [% END %]
65
66
67 <form name="f" action="batchMod.pl" method="post">
68      <input type="hidden" name="src" id="src" value="[% src %]" />
69      <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
70      <input type="hidden" name="op" value="[% op %]" />
71      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
72      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
73
74 [% IF ( item_loop ) %]
75         [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% END %]
76         <div id="cataloguing_additem_itemlist">
77
78         <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>
79                 [% FOREACH item_header_loo IN item_header_loop %]
80                 <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
81                 [% END %]
82         </p>
83
84                 <table id="itemst">
85                     <thead>
86                         <tr>
87                             [% IF ( show ) %]<th>&nbsp;</th>[% END %]
88                         <th>Title</th>
89                             [% FOREACH item_header_loo IN item_header_loop %]
90                             <th> [% item_header_loo.header_value %] </th>
91                             [% END %]
92                         </tr>
93                     </thead>
94                     <tbody>
95                     [% 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 %]
96                     <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>
97                         [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
98                                         [% END %] </tr>
99                     [% END %]
100                     </tbody>
101                 </table>
102         </div>
103 [% END %]
104
105 [% IF ( simple_items_display ) %]
106     <ul>
107     [% FOREACH simple_items_displa IN simple_items_display %]
108         <li>
109             <a href="[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>
110         </li>
111     [% END %]
112     </ul>
113 [% END %]
114
115
116 [% IF ( show ) %]
117
118 [% IF ( too_many_items ) %]
119     <p>Too many items ([% too_many_items %]) to display individually.</p>
120     [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
121   <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
122     [% END %]
123 [% END %]   
124
125 [% IF ( itemresults ) %]
126                 <div id="cataloguing_additem_newitem">
127              <input type="hidden" name="op" value="[% op %]" />
128              <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
129              <input type="hidden" name="del" value="1" />
130              <fieldset class="action">    
131                 <div id="jobpanel">
132                     <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
133                     <div id="jobfailed"></div>
134                 </div>
135                 [% IF ( too_many_items ) %]<input type="submit" name="mainformsubmit" value="Delete ALL submitted items" onclick="return submitBackgroundJob(this.form);" />[% ELSE %]
136                 <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label><p>
137                 <input type="submit" name="mainformsubmit" value="Delete selected items" onclick="return submitBackgroundJob(this.form);" />[% END %]
138
139                 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
140             </fieldset>
141         </div>
142         [% ELSE %]
143         <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
144         [% END %]
145         [% END %]
146         </form>
147     [% END %]
148
149 [% IF ( action ) %]
150         <div class="dialog message">
151             <p>[% deleted_items %] item(s) deleted.</p>
152             [% IF delete_records %] <p>[% deleted_records %] record(s) deleted.</p> [% END %]
153         </div>
154         [% IF ( not_deleted_items ) %]
155         <div style="width:55%;margin:auto;">
156             <p>[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]</p>
157         [% IF ( not_deleted_loop ) %]
158         <table id="itemst">
159                 <thead>
160                     <tr>
161                         <th>Itemnumber</th>
162                         <th>Barcode</th>
163                         <th>Reason</th>
164                     </tr>
165                 </thead>
166                 <tbody>
167                     [% FOREACH not_deleted_loo IN not_deleted_loop %]
168                         <tr>
169                             <td>[% not_deleted_loo.itemnumber %]</td>
170                             <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>
171                             <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>
172                         </tr>
173                     [% END %]
174                 </tbody>
175             </table>
176         [% END %]
177         </div>
178         [% END %]
179
180     <p>
181         [% IF ( src == 'CATALOGUING') %]
182            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
183         [% ELSE %]
184            <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
185         [% END %]
186     </p>
187 [% END %]
188     </div>
189     </div>
190 [% INCLUDE 'intranet-bottom.inc' %]