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