Bug 5917 / Bug 6085 : Fixing not being able to change language
[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 [% INCLUDE 'background-job.inc' %]
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 src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
8 <script type="text/javascript" src="[% themelang %]/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 accomodate 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 //]]>
19 </script>
20 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
21 <!--[if IE]>
22 <style type="text/css">#selections { display: none; }</style>
23 <![endif]-->
24 </head>
25 <body>
26 [% INCLUDE 'header.inc' %]
27 [% INCLUDE 'cat-search.inc' %]
28
29 <div id="breadcrumbs">
30         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
31         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
32         <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
33 </div>
34
35 <div id="doc3" class="yui-t7">
36     <div id="bd">
37         <div id="yui-main">
38                 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
39             [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
40             [% 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 %]
41             [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
42             [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
43
44     [% UNLESS ( action ) %]
45
46     [% IF ( notfoundbarcodes ) %]
47             <div class="dialog alert">
48             [% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
49                 </div>
50             <table style="margin:auto;">
51                 <thead>
52                     <tr>
53                         <th>Barcode</th>
54                     </tr>
55                 </thead>
56                 <tbody>
57                     [% FOREACH notfoundbarcode IN notfoundbarcodes %]
58                         <tr><td>[% notfoundbarcode.barcode %]</td></tr>
59                     [% END %]
60                 </tbody>
61             </table>
62             [% UNLESS ( too_many_items ) %]
63             [% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
64             [% END %]
65         [% END %]
66
67
68 <form name="f" action="batchMod.pl" method="post">
69      <input type="hidden" name="op" value="[% op %]" />
70      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
71      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
72
73 [% IF ( item_loop ) %]
74         [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% END %]
75         <div id="cataloguing_additem_itemlist">
76
77         <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>
78                 [% FOREACH item_header_loo IN item_header_loop %]
79                 <span class="selected"><input id="checkheader[% item_header_loo.__counter %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
80                 [% END %]
81         </p>
82
83                 <table id="itemst">
84                     <thead>
85                         <tr>
86                             [% IF ( show ) %]<th>&nbsp;</th>[% END %]
87                         <th>Title</th>
88                             [% FOREACH item_header_loo IN item_header_loop %]
89                             <th> [% item_header_loo.header_value %] </th>
90                             [% END %]
91                         </tr>
92                     </thead>
93                     <tbody>
94                     [% FOREACH item_loo IN item_loop %] <tr> [% IF ( item_loo.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 %]
95                     <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>
96                         [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
97                                         [% END %] </tr>
98                     [% END %]
99                     </tbody>
100                 </table>
101         </div>
102 [% END %]
103
104 [% IF ( simple_items_display ) %]
105     <ul>
106     [% FOREACH simple_items_displa IN simple_items_display %]
107         <li>
108             <a href="[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>
109         </li>
110     [% END %]
111     </ul>
112 [% END %]
113
114
115 [% IF ( show ) %]
116
117 [% IF ( too_many_items ) %]
118     <p>Too many items ([% too_many_items %]) to display individually.</p>
119     [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
120   <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
121     [% END %]
122 [% END %]   
123
124 [% IF ( itemresults ) %]
125                 <div id="cataloguing_additem_newitem">
126              <input type="hidden" name="op" value="[% op %]" />
127              <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
128              <input type="hidden" name="del" value="1" />
129              <fieldset class="action">    
130                 <div id="jobpanel">
131                     <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
132                     <div id="jobfailed"></div>
133                 </div>
134                 [% IF ( too_many_items ) %]<input type="submit" name="mainformsubmit" value="Delete ALL submitted items" onclick="return submitBackgroundJob(this.form);" />[% ELSE %]
135                 <input type="submit" name="mainformsubmit" value="Delete selected items" onclick="return submitBackgroundJob(this.form);" />[% END %]
136
137                 <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
138             </fieldset>
139         </div>
140         [% ELSE %]
141         <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
142         [% END %]
143         [% END %]
144         </form>
145     [% END %]
146
147 [% IF ( action ) %]
148         <div class="dialog message"><p>[% deleted_items %] item(s) deleted.</p></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 ( not_deleted_loo.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><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
176 [% END %]
177     </div>
178     </div>
179 [% INCLUDE 'intranet-bottom.inc' %]