2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Batch item modification</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
6 <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging.js"></script>
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8 [% INCLUDE 'datatables.inc' %]
9 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
10 <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/batchMod.js"></script>
11 <script type="text/javascript">
14 // Prepare array of all column headers, incrementing each index by
15 // two to accommodate control and title columns
16 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
17 for( x=0; x<allColumns.length; x++ ){
18 allColumns[x] = Number(allColumns[x]) + 2;
20 $(document).ready(function(){
22 $("input[name='disable_input']").click(function() {
23 var row = $(this).attr("id");
24 row = row.replace("row","hint");
25 var subfield = $(this).next();
26 if ($(this).is(":checked")){
27 $(this).val($(this).siblings("[name='subfield']").val());
28 $(subfield).prop('disabled', true);
29 $("#"+row).html(_("This subfield will be deleted"));
31 $(subfield).prop('disabled', false);
35 $("#mainformsubmit").on("click",function(){
36 return submitBackgroundJob(this.form);
42 <style type="text/css">#selections { display: none; }</style>
44 <style type="text/css">input[type=checkbox]{ margin : 0 .5em; }</style>
45 <link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addbiblio.css" />
47 [% INCLUDE 'select2.inc' %]
48 <script type="text/javascript">
49 $(document).ready(function() {
50 $('.subfield_line select').select2();
55 <body id="tools_batchMod-edit" class="tools">
56 [% INCLUDE 'header.inc' %]
57 [% INCLUDE 'cat-search.inc' %]
59 <div id="breadcrumbs">
60 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
61 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
62 <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
65 <div id="doc3" class="yui-t7">
69 <h1>Batch item modification</h1>
71 <h1>Batch item modification results</h1>
72 <div class="dialog message">
73 [% IF (modified_items) %]
74 [% modified_items %] item(s) modified (with [% modified_fields %] field(s) modified).
78 <fieldset class="action">
79 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
80 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Return to the record</a>
82 <a href="[% src %]">Return to where you were</a>
84 <a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a>
89 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
90 [% 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 %]
91 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
92 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
94 [% IF ( notfoundbarcodes ) %]
95 <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
96 <table style="margin:auto;">
98 <tr><th>Barcodes not found</th></tr>
101 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
102 <tr><td>[% notfoundbarcode.barcode %]</td></td>
106 [% IF ( item_loop ) %]
107 [% UNLESS ( too_many_items ) %]
108 <h4>The following barcodes were found: </h4>
111 [% END %] <!-- /notfoundbarcodes -->
113 <form name="f" action="batchMod.pl" method="post">
114 <input type="hidden" name="op" value="[% op %]" />
115 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
116 <input type="hidden" name="runinbackground" id="runinbackground" value="" />
117 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
118 <input type="hidden" name="src" id="src" value="[% src %]" />
119 [% IF biblionumber %]
120 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
123 [% IF ( item_loop ) %]
126 <a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a> | <a id="clearonloanbutton" href="#">Clear on loan</a>
129 <div id="cataloguing_additem_itemlist">
131 <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>
132 [% FOREACH item_header_loo IN item_header_loop %]
133 <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
140 <th class="anti-the">Title</th>
141 [% FOREACH item_header_loo IN item_header_loop %]
142 <th> [% item_header_loo.header_value %] </th>
147 [% FOREACH item_loo IN item_loop %]
150 [% IF item_loo.nomod %]
151 <td class="error">Cannot edit</td>
153 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" data-is-onloan="[% item_loo.onloan %]" /></td>
158 <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>
159 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td>
165 [% END %]<!-- /item_loop -->
167 [% IF ( simple_items_display ) %]
168 <p>The following items were modified:</p>
170 [% FOREACH simple_items_displa IN simple_items_display %]
172 [% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% simple_items_displa.biblionumber %]&itemnumber=[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>[% ELSE %][% simple_items_displa.barcode %][% END %]
176 [% END %]<!-- /simple_items_display -->
180 [% IF ( too_many_items ) %]
181 <p>Too many items ([% too_many_items %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') %] items in a batch.</p>
182 [% FOREACH itemnumber IN itemnumbers_array %]
183 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
185 [% END %]<!-- /too_many_items -->
187 [% IF ( item_loop ) %]
188 <div id="cataloguing_additem_newitem">
190 <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>
191 <fieldset class="rows">
193 [% FOREACH ite IN item %]
195 <div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
196 [% IF ( ite.mandatory ) %]
197 <label class="required" for="tag_[% ite.tag %]_subfield_[% ite.subfield %]_[% ite.random %]">
199 <label for="tag_[% ite.tag %]_subfield_[% ite.subfield %]_[% ite.random %]">
201 [% ite.subfield %] - [% ite.marc_lib %]
204 [% SET mv = ite.marc_value %]
205 [% IF ( mv.type == 'select' ) -%]
206 <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" tabindex="1" class="input_marceditor">
207 [%- FOREACH aval IN mv.values %]
208 [% IF aval == mv.default %]
209 <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
211 <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
215 [% ELSIF ( mv.type == 'text1' ) %]
216 <input type="text" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" />
217 <a href="#" class="buttonDot" onclick="Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=[%- mv.authtypecode -%]&index=[%- mv.id -%]','[%- mv.id -%]'); return false;" title="Tag editor">...</a>
218 [% ELSIF ( mv.type == 'text2' ) %]
219 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" />
221 <a href="#" class="buttonDot disabled" title="No popup">...</a>
223 <a href="#" id="buttonDot_[% mv.id %]" class="buttonDot" title="Tag editor">...</a>
226 [% ELSIF ( mv.type == 'text' ) %]
227 <input type="text" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" />
228 [% ELSIF ( mv.type == 'hidden' ) %]
229 <input type="hidden" tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value -%]" />
230 [% ELSIF ( mv.type == 'textarea' ) %]
231 <textarea tabindex="1" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value -%]"</textarea>
234 [% UNLESS ( ite.mandatory ) %]
235 <input type="checkbox" id="row[% ite.tag %][% ite.subfield %][% ite.random %]" title="Check to delete subfield [% ite.subfield %]" name="disable_input" value="[% ite.subfield %]" />
237 <span class="required">Required</span>
240 <input type="hidden" name="tag" value="[% ite.tag %]" />
241 <input type="hidden" name="subfield" value="[% ite.subfield %]" />
242 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
243 [% IF ( ite.repeatable ) %]
244 <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
245 <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
248 <span class="hint" id="hint[% ite.tag %][% ite.subfield %][% ite.random %]"></span>
254 <fieldset class="action">
256 <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
257 <div id="jobfailed"></div>
259 <input type="submit" id="mainformsubmit" value="Save" />
260 <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
264 <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
266 [% ELSE %] <!-- // show -->
267 <fieldset class="action">
268 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
269 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
271 <a class="btn btn-default" href="[% src %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
273 <a class="btn btn-default" href="/cgi-bin/koha/tools/batchMod.pl"><i class="fa fa-check-square-o"></i> Return to batch item modification</a>
280 [% INCLUDE 'intranet-bottom.inc' %]