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