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