Fix for Bug 6446, batch item deletion interface problems
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / batchMod-edit.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Batch item modification</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 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
25 </head>
26 <body>
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">Batch item modification</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 modification</h1>[% ELSE %]<h1>Batch item modification 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     [% IF ( notfoundbarcodes ) %]
46       <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
47       <table style="margin:auto;">
48     <thead>
49         <tr><th>Barcodes not found</th></tr>
50     </thead>
51     <tbody>
52         [% FOREACH notfoundbarcode IN notfoundbarcodes %]
53       <tr><td>[% notfoundbarcode.barcode %]</td></td>
54         [% END %]
55     </tbody>
56       </table>
57       [% UNLESS ( too_many_items ) %]
58       <h4>The following barcodes were found: </h4>
59       [% END %]
60   [% END %] <!-- /notfoundbarcodes -->
61
62 <form name="f" action="batchMod.pl" method="post">
63      <input type="hidden" name="op" value="[% op %]" />
64      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
65      <input type="hidden" name="runinbackground" id="runinbackground" value="" />
66      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
67
68 [% IF ( item_loop ) %]
69   [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% ELSE %][% END %]
70 <div id="cataloguing_additem_itemlist">
71
72 <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> 
73         [% FOREACH item_header_loo IN item_header_loop %]
74         <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>
75         [% END %]
76 </p>
77         <table id="itemst">
78       <thead>
79     <tr>
80         <th>&nbsp;</th>
81         <th>Title</th>
82         [% FOREACH item_header_loo IN item_header_loop %]
83         <th> [% item_header_loo.header_value %] </th>
84         [% END %] 
85     </tr>
86       </thead>
87       <tbody>
88             [% 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 %][% ELSE %]<td>&nbsp;</td>[% END %]
89                 <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>
90                 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
91         [% END %] </tr>
92             [% END %]
93       </tbody>
94         </table>
95 </div>
96 [% END %]<!-- /item_loop -->
97
98 [% IF ( simple_items_display ) %]
99     <p>The following items were modified:</p>
100     <ul>
101     [% FOREACH simple_items_displa IN simple_items_display %]
102   <li>
103       [% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% simple_items_displa.biblionumber %]&amp;itemnumber=[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>[% ELSE %][% simple_items_displa.barcode %][% END %]
104   </li>
105     [% END %]
106     </ul>
107 [% END %]<!-- /simple_items_display -->
108
109 [% IF ( show ) %]
110
111 [% IF ( too_many_items ) %]
112     <p>Too many items ([% too_many_items %]): not displaying each one individually.</p>
113     [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
114   <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
115     [% END %]
116 [% END %]<!-- /too_many_items -->
117
118 <div id="cataloguing_additem_newitem">
119         <h2>Edit Items</h2>
120   <fieldset class="rows">
121   <ol>
122         [% FOREACH ite IN item %]
123                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
124                <label>[% ite.subfield %] - 
125           [% IF ( ite.mandatory ) %]<b>[% END %]
126           [% ite.marc_lib %]
127           [% IF ( ite.mandatory ) %] *</b>[% END %]
128          </label>
129                 [% ite.marc_value %]
130                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
131                 <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
132                 <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
133                 [% IF ( ite.repeatable ) %]
134                     <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
135                 [% END %]
136    
137             </div></li>
138         [% END %]
139     </ol>
140     </fieldset>
141     <fieldset class="action">    
142    <div id="jobpanel">
143        <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
144        <div id="jobfailed"></div>
145    </div>
146    <input type="submit" name="mainformsubmit" value="Save" onclick="return submitBackgroundJob(this.form);" />
147          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
148     </fieldset>
149 </div>
150 [% ELSE %] <!-- // show -->
151 <fieldset class="action">
152   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
153 </fieldset>
154          
155 [% END %]
156 </div>
157     </div>
158 [% INCLUDE 'intranet-bottom.inc' %]