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