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