Merge remote-tracking branch 'kc/new/awaiting_qa/bug_6316' into kcmaster
[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 [% INCLUDE 'background-job.inc' %]
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 src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11
12 // Prepare array of all column headers, incrementing each index by
13 // two to accomodate control and title columns
14 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
15 console.log(allColumns);
16 for( x=0; x<allColumns.length; x++ ){
17   allColumns[x] = Number(allColumns[x]) + 2;
18 }
19 //]]>
20 </script>
21 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
22 <!--[if IE]>
23 <style type="text/css">#selections { display: none; }</style>
24 <![endif]-->
25 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
26 </head>
27 <body>
28 [% INCLUDE 'header.inc' %]
29 [% INCLUDE 'cat-search.inc' %]
30
31 <div id="breadcrumbs">
32   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
33   <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
34   <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
35 </div>
36
37 <div id="doc3" class="yui-t7">
38     <div id="bd">
39         <div id="yui-main">
40             [% IF ( show ) %]<h1>Batch item modification</h1>[% ELSE %]<h1>Batch item modification results</h1>[% END %]
41 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
42 [% 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 %]
43 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
44 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
45
46     [% IF ( notfoundbarcodes ) %]
47       <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
48       <table style="margin:auto;">
49     <thead>
50         <tr><th>Barcodes not found</th></tr>
51     </thead>
52     <tbody>
53         [% FOREACH notfoundbarcode IN notfoundbarcodes %]
54       <tr><td>[% notfoundbarcode.barcode %]</td></td>
55         [% END %]
56     </tbody>
57       </table>
58       [% UNLESS ( too_many_items ) %]
59       <h4>The following barcodes were found: </h4>
60       [% END %]
61   [% END %] <!-- /notfoundbarcodes -->
62
63 <form name="f" action="batchMod.pl" method="post">
64      <input type="hidden" name="op" value="[% op %]" />
65      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
66      <input type="hidden" name="runinbackground" id="runinbackground" value="" />
67      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
68
69 [% IF ( item_loop ) %]
70   [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% ELSE %][% END %]
71 <div id="cataloguing_additem_itemlist">
72
73 <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> 
74         [% FOREACH item_header_loo IN item_header_loop %]
75         <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
76         [% END %]
77 </p>
78         <table id="itemst">
79       <thead>
80     <tr>
81         <th>&nbsp;</th>
82         <th>Title</th>
83         [% FOREACH item_header_loo IN item_header_loop %]
84         <th> [% item_header_loo.header_value %] </th>
85         [% END %] 
86     </tr>
87       </thead>
88       <tbody>
89             [% 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 %]
90                 <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>
91                 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
92         [% END %] </tr>
93             [% END %]
94       </tbody>
95         </table>
96 </div>
97 [% END %]<!-- /item_loop -->
98
99 [% IF ( simple_items_display ) %]
100     <p>The following items were modified:</p>
101     <ul>
102     [% FOREACH simple_items_displa IN simple_items_display %]
103   <li>
104       [% 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 %]
105   </li>
106     [% END %]
107     </ul>
108 [% END %]<!-- /simple_items_display -->
109
110 [% IF ( show ) %]
111
112 [% IF ( too_many_items ) %]
113     <p>Too many items ([% too_many_items %]): not displaying each one individually.</p>
114     [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
115   <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
116     [% END %]
117 [% END %]<!-- /too_many_items -->
118
119 <div id="cataloguing_additem_newitem">
120         <h2>Edit Items</h2>
121   <fieldset class="rows">
122   <ol>
123         [% FOREACH ite IN item %]
124                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
125                <label>[% ite.subfield %] - 
126           [% IF ( ite.mandatory ) %]<b>[% END %]
127           [% ite.marc_lib %]
128           [% IF ( ite.mandatory ) %] *</b>[% END %]
129          </label>
130                 [% ite.marc_value %]
131                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
132                 <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
133                 <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
134                 [% IF ( ite.repeatable ) %]
135                     <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
136                 [% END %]
137    
138             </div></li>
139         [% END %]
140     </ol>
141     </fieldset>
142     <fieldset class="action">    
143    <div id="jobpanel">
144        <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
145        <div id="jobfailed"></div>
146    </div>
147    <input type="submit" name="mainformsubmit" value="Save" onclick="return submitBackgroundJob(this.form);" />
148          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
149     </fieldset>
150 </div>
151 [% ELSE %] <!-- // show -->
152 <fieldset class="action">
153   <a href="/cgi-bin/koha/tools/batchMod.pl">Done</a>
154 </fieldset>
155          
156 [% END %]
157 </div>
158     </div>
159 [% INCLUDE 'intranet-bottom.inc' %]