Merge remote-tracking branch 'jcamins/bug_8281_qa'
[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 <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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7 <script type="text/javascript" src="[% themelang %]/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 accomodate 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 $("#itemst").tablesorter({ widgets : ['zebra'], headers: {0:{sorter: false}} });
18 $("#selectallbutton").click(function() {
19     $("#itemst").find("input:checkbox").each(function() {
20  $(this).attr("checked", "checked");
21     });
22 });
23 $("#clearallbutton").click(function() {
24     $("#itemst").find("input:checkbox").each(function() {
25  $(this).removeAttr("checked");
26     });
27 });
28 $("input[name='disable_input']").click(function() {
29     if ($(this).is(":checked")){
30  $(this).val($(this).siblings("[name='subfield']").val());
31  $(this).siblings().attr('disabled',true);
32     }
33     else {
34  $(this).siblings().removeAttr('disabled');
35     }
36 });
37
38 //]]>
39 </script>
40 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
41 <!--[if IE]>
42 <style type="text/css">#selections { display: none; }</style>
43 <![endif]-->
44 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
45 </head>
46 <body id="tools_batchMod-edit" class="tools">
47 [% INCLUDE 'header.inc' %]
48 [% INCLUDE 'cat-search.inc' %]
49
50 <div id="breadcrumbs">
51   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
52   <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
53   <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
54 </div>
55
56 <div id="doc3" class="yui-t7">
57     <div id="bd">
58         <div id="yui-main">
59             [% IF ( show ) %]<h1>Batch item modification</h1>[% ELSE %]<h1>Batch item modification results</h1>[% END %]
60 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
61 [% 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 %]
62 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
63 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
64
65     [% IF ( notfoundbarcodes ) %]
66       <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
67       <table style="margin:auto;">
68     <thead>
69         <tr><th>Barcodes not found</th></tr>
70     </thead>
71     <tbody>
72         [% FOREACH notfoundbarcode IN notfoundbarcodes %]
73       <tr><td>[% notfoundbarcode.barcode %]</td></td>
74         [% END %]
75     </tbody>
76       </table>
77       [% UNLESS ( too_many_items ) %]
78       <h4>The following barcodes were found: </h4>
79       [% END %]
80   [% END %] <!-- /notfoundbarcodes -->
81
82 <form name="f" action="batchMod.pl" method="post">
83      <input type="hidden" name="op" value="[% op %]" />
84      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
85      <input type="hidden" name="runinbackground" id="runinbackground" value="" />
86      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
87      <input type="hidden" name="src" id="src" value="[% src %]" />
88
89 [% IF ( item_loop ) %]
90   [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% ELSE %][% END %]
91 <div id="cataloguing_additem_itemlist">
92
93 <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> 
94         [% FOREACH item_header_loo IN item_header_loop %]
95         <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
96         [% END %]
97 </p>
98         <table id="itemst">
99       <thead>
100     <tr>
101         <th>&nbsp;</th>
102         <th>Title</th>
103         [% FOREACH item_header_loo IN item_header_loop %]
104         <th> [% item_header_loo.header_value %] </th>
105         [% END %] 
106     </tr>
107       </thead>
108       <tbody>
109             [% 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 %]
110                 <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>
111                 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
112         [% END %] </tr>
113             [% END %]
114       </tbody>
115         </table>
116 </div>
117 [% END %]<!-- /item_loop -->
118
119 [% IF ( simple_items_display ) %]
120     <p>The following items were modified:</p>
121     <ul>
122     [% FOREACH simple_items_displa IN simple_items_display %]
123   <li>
124       [% 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 %]
125   </li>
126     [% END %]
127     </ul>
128 [% END %]<!-- /simple_items_display -->
129
130 [% IF ( show ) %]
131
132 [% IF ( too_many_items ) %]
133     <p>Too many items ([% too_many_items %]): not displaying each one individually.</p>
134     [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
135   <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
136     [% END %]
137 [% END %]<!-- /too_many_items -->
138
139 <div id="cataloguing_additem_newitem">
140         <h2>Edit Items</h2>
141         <div class="hint">Checking the box right next the subfield label will disable the entry and delete the values of that subfield on all selected items</div>
142   <fieldset class="rows">
143   <ol>
144         [% FOREACH ite IN item %]
145                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
146                <label>[% ite.subfield %] - 
147           [% IF ( ite.mandatory ) %]<b>[% END %]
148           [% ite.marc_lib %]
149           [% IF ( ite.mandatory ) %] *</b>[% END %]
150          </label>
151                 <input type="checkbox" title="check to delete subfield [% ite.subfield %]" name="disable_input" value="[% ite.subfield %]" />
152                 [% ite.marc_value %]
153                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
154                 <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
155                 <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
156                 [% IF ( ite.repeatable ) %]
157                     <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
158                 [% END %]
159    
160             </div></li>
161         [% END %]
162     </ol>
163     </fieldset>
164     <fieldset class="action">    
165    <div id="jobpanel">
166        <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
167        <div id="jobfailed"></div>
168    </div>
169    <input type="submit" name="mainformsubmit" value="Save" onclick="return submitBackgroundJob(this.form);" />
170          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
171     </fieldset>
172 </div>
173 [% ELSE %] <!-- // show -->
174 <fieldset class="action">
175 [% IF ( src == 'CATALOGUING') %]
176    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">Done</a>
177 [% ELSE %]
178    <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
179 [% END %]
180 </fieldset>
181          
182 [% END %]
183 </div>
184     </div>
185 [% INCLUDE 'intranet-bottom.inc' %]