Bug 11475: fix return link after editing/deleting items in batch
[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
23   $("input[name='disable_input']").click(function() {
24       var row = $(this).attr("id");
25       row = row.replace("row","hint");
26       var subfield = $(this).next();
27       if ($(this).is(":checked")){
28           $(this).val($(this).siblings("[name='subfield']").val());
29           $(subfield).attr('disabled',true);
30           $("#"+row).html(_("This subfield will be deleted"));
31       } else {
32           $(subfield).removeAttr('disabled');
33           $("#"+row).html("");
34       }
35   });
36
37 });
38 //]]>
39 </script>
40 <!--[if IE]>
41 <style type="text/css">#selections { display: none; }</style>
42 <![endif]-->
43 <style type="text/css">input[type=checkbox]{ margin : 0 .5em; }</style>
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 ) %]
60               <h1>Batch item modification</h1>
61             [% ELSE %]
62               <h1>Batch item modification results</h1>
63               <div class="dialog message">
64               [% modified_items %] item(s) modified (with [% modified_fields %] fields modified)
65               </div>
66             [% END %]
67 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
68 [% 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 %]
69 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
70 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
71
72     [% IF ( notfoundbarcodes ) %]
73       <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
74       <table style="margin:auto;">
75     <thead>
76         <tr><th>Barcodes not found</th></tr>
77     </thead>
78     <tbody>
79         [% FOREACH notfoundbarcode IN notfoundbarcodes %]
80       <tr><td>[% notfoundbarcode.barcode %]</td></td>
81         [% END %]
82     </tbody>
83       </table>
84       [% IF ( item_loop ) %]
85           [% UNLESS ( too_many_items ) %]
86           <h4>The following barcodes were found: </h4>
87           [% END %]
88       [% END %]
89   [% END %] <!-- /notfoundbarcodes -->
90
91 <form name="f" action="batchMod.pl" method="post">
92      <input type="hidden" name="op" value="[% op %]" />
93      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
94      <input type="hidden" name="runinbackground" id="runinbackground" value="" />
95      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
96      <input type="hidden" name="src" id="src" value="[% src %]" />
97      [% IF biblionumber %]
98         <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
99      [% END %]
100
101 [% IF ( item_loop ) %]
102   [% IF show %]
103     <div id="toolbar">
104       <a id="selectallbutton" href="#">Select all</a> | <a id="clearallbutton" href="#">Clear all</a> | <a id="clearonloanbutton" href="#">Clear on loan</a>
105     </div>
106   [% END %]
107 <div id="cataloguing_additem_itemlist">
108
109 <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> 
110         [% FOREACH item_header_loo IN item_header_loop %]
111         <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
112         [% END %]
113 </p>
114         <table id="itemst">
115       <thead>
116     <tr>
117         <th>&nbsp;</th>
118         <th>Title</th>
119         [% FOREACH item_header_loo IN item_header_loop %]
120         <th> [% item_header_loo.header_value %] </th>
121         [% END %] 
122     </tr>
123       </thead>
124       <tbody>
125             [% FOREACH item_loo IN item_loop %]
126               <tr>
127                 [% IF show %]
128                   [% IF item_loo.nomod %]
129                     <td class="error">Cannot Edit</td>
130                   [% ELSE %]
131                     <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" data-is-onloan="[% item_loo.onloan %]" /></td>
132                   [% END %]
133                 [% ELSE %]
134                   <td>&nbsp;</td>
135                 [% END %]
136                 <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>
137                 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
138         [% END %] </tr>
139             [% END %]
140       </tbody>
141         </table>
142 </div>
143 [% END %]<!-- /item_loop -->
144
145 [% IF ( simple_items_display ) %]
146     <p>The following items were modified:</p>
147     <ul>
148     [% FOREACH simple_items_displa IN simple_items_display %]
149   <li>
150       [% 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 %]
151   </li>
152     [% END %]
153     </ul>
154 [% END %]<!-- /simple_items_display -->
155
156 [% IF ( show ) %]
157
158 [% IF ( too_many_items ) %]
159     <p>Too many items ([% too_many_items %]): not displaying each one individually.</p>
160     [% FOREACH itemnumber IN itemnumbers_array %]
161   <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
162     [% END %]
163 [% END %]<!-- /too_many_items -->
164
165 [% IF ( item_loop ) %]
166 <div id="cataloguing_additem_newitem">
167         <h2>Edit Items</h2>
168         <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>
169   <fieldset class="rows">
170   <ol>
171         [% FOREACH ite IN item %]
172                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
173               [% IF ( ite.mandatory ) %]
174               <label class="required" for="tag_[% ite.tag %]_subfield_[% ite.subfield %]_[% ite.random %]">
175               [% ELSE %]
176               <label for="tag_[% ite.tag %]_subfield_[% ite.subfield %]_[% ite.random %]">
177               [% END %]
178               [% ite.subfield %] -
179           [% ite.marc_lib %]
180          </label>
181                 [% 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 %]
182                 [% ite.marc_value %]
183                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
184                 <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
185                 <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
186                 [% IF ( ite.repeatable ) %]
187                     <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
188                         <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
189                     </a>
190                 [% END %]
191                 <span class="hint" id="hint[% ite.tag %][% ite.subfield %][% ite.random %]"></span>
192             </div></li>
193         [% END %]
194     </ol>
195     </fieldset>
196     <fieldset class="action">    
197    <div id="jobpanel">
198        <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
199        <div id="jobfailed"></div>
200    </div>
201    <input type="submit" name="mainformsubmit" value="Save" onclick="return submitBackgroundJob(this.form);" />
202          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
203     </fieldset>
204 </div>
205 [% ELSE %]
206     <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
207 [% END %]
208 [% ELSE %] <!-- // show -->
209 <fieldset class="action">
210 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
211    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
212 [% ELSIF src %]
213    <a href="[% src %]">Done</a>
214 [% ELSE %]
215    <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
216 [% END %]
217 </fieldset>
218          
219 [% END %]
220 </div>
221     </div>
222 [% INCLUDE 'intranet-bottom.inc' %]