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