4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › Batch item modification</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.js("js/background-job-progressbar.js") | $raw %]
8 [% Asset.js("js/cataloging.js") | $raw %]
9 [% INCLUDE 'datatables.inc' %]
10 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
11 [% Asset.js("js/pages/batchMod.js") | $raw %]
12 <script type="text/javascript">
15 // Prepare array of all column headers, incrementing each index by
16 // two to accommodate control and title columns
17 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
18 for( x=0; x<allColumns.length; x++ ){
19 allColumns[x] = Number(allColumns[x]) + 2;
21 $(document).ready(function(){
23 $("input[name='disable_input']").click(function() {
24 var row = $(this).attr("id");
25 row = row.replace("row","hint");
26 var todisable = $(this).parent().find("[name='field_value'],[name='tag'],[name='subfield'],[name='mandatory']");
27 var regex_link = $(this).parent().find("[name='field_regex']");
28 if ($(this).is(":checked")) {
29 $(todisable).prop('disabled', true);
30 $("#"+row).html(_("This subfield will be deleted"));
33 $(todisable).prop('disabled', false);
38 $("#mainformsubmit").on("click",function(){
39 return submitBackgroundJob(this.form);
41 $('a[name="field_regex"]').click(function() {
42 var id = $(this).attr('id');
43 var editor = $(this).parent().find("[name='field_value']");
44 var regex = $(this).parent().find("[name='regex_fields']");
45 var disable_input = $(this).parent().find("[name='disable_input']");
46 if ($(this).html() == 'RegEx') {
50 $(disable_input).prop('disabled', true);
54 $(this).html('RegEx');
55 $(disable_input).prop('disabled', false);
63 <style>#selections { display: none; }</style>
65 <style>input[type=checkbox]{ margin : 0 .5em; }</style>
66 [% Asset.css("css/addbiblio.css") | $raw %]
68 [% INCLUDE 'select2.inc' %]
69 <script type="text/javascript">
70 $(document).ready(function() {
71 $('.subfield_line select').select2();
76 <body id="tools_batchMod-edit" class="tools">
77 [% INCLUDE 'header.inc' %]
78 [% INCLUDE 'cat-search.inc' %]
80 <div id="breadcrumbs">
81 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
82 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
83 <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
86 <div class="main container-fluid">
89 <h1>Batch item modification</h1>
91 <h1>Batch item modification results</h1>
92 <div class="dialog message">
93 [% IF (modified_items) %]
94 [% modified_items | html %] item(s) modified (with [% modified_fields | html %] field(s) modified).
98 <fieldset class="action">
99 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
100 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
102 <a href="[% src | url %]">Return to where you were</a>
104 <a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a>
109 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
110 [% 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 %]
111 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
112 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
114 [% IF ( notfoundbarcodes.size ) %]
115 <div class="dialog alert"><p>Warning, the following barcodes were not found:</p></div>
116 <table style="margin:auto;">
118 <tr><th>Barcodes not found</th></tr>
121 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
122 <tr><td>[% notfoundbarcode |html %]</td></td>
126 [% IF ( item_loop ) %]
127 [% UNLESS ( too_many_items_display ) %]
128 <h4>The following barcodes were found: </h4>
131 [% END %] <!-- /notfoundbarcodes -->
132 [% IF ( notfounditemnumbers.size ) %]
133 <div class="dialog alert"><p>Warning, the following itemnumbers were not found:</p></div>
134 <table style="margin:auto;">
136 <tr><th>Itemnumbers not found</th></tr>
139 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
140 <tr><td>[% notfounditemnumber |html %]</td></td>
144 [% IF ( item_loop ) %]
145 [% UNLESS ( too_many_items_display ) %]
146 <h4>The following itemnumbers were found: </h4>
149 [% END %] <!-- /notfounditemnumbers -->
152 <form name="f" action="batchMod.pl" method="post">
153 <input type="hidden" name="op" value="[% op | html %]" />
154 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
155 <input type="hidden" name="runinbackground" id="runinbackground" value="" />
156 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
157 <input type="hidden" name="src" id="src" value="[% src | html %]" />
158 [% IF biblionumber %]
159 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
162 [% IF ( item_loop ) %]
165 <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>
168 <div id="cataloguing_additem_itemlist">
170 <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>
171 [% FOREACH item_header_loo IN item_header_loop %]
172 <span class="selected"><input id="checkheader[% loop.count | html %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count | html %]">[% item_header_loo.header_value | html %]</label> </span>
179 <th class="anti-the">Title</th>
180 <th class="holds_count" title="Item holds / Total holds">Holds</th>
181 [% FOREACH item_header_loo IN item_header_loop %]
182 <th> [% item_header_loo.header_value | html %] </th>
187 [% FOREACH item_loo IN item_loop %]
190 [% IF item_loo.nomod %]
191 <td class="error">Cannot edit</td>
193 <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" data-is-onloan="[% item_loo.onloan | html %]" /></td>
199 <label for="row[% item_loo.itemnumber | html %]">
200 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">
201 [% item_loo.title | html %]
203 [% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]
206 <td class="holds_count">
207 [% IF item_loo.holds %]
208 [% IF item_loo.item_holds %]
209 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this item: [% item_loo.item_holds | html %] / Total holds on this record: [% item_loo.holds | html -%]" >
211 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this item / Total holds on this record: [% item_loo.holds | html -%]" >
214 [% IF item_loo.holds %]
215 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this record: [% item_loo.holds | html -%]" >
217 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this record" >
220 [% IF item_loo.holds %]
221 [% item_loo.item_holds | html %]/[% item_loo.holds | html %]
223 [% item_loo.holds | html %]
227 [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field | html %]</td>
233 [% END %]<!-- /item_loop -->
235 [% IF ( simple_items_display || job_completed ) %]
236 [% IF ( too_many_items_display ) %]
237 <p>Too many items ([% too_many_items_display | html %]): You have edited more than [% Koha.Preference('MaxItemsToDisplayForBatchMod') | html %] items in a batch, items will not be shown.</p>
239 <p>The following items were modified:</p>
241 [% FOREACH simple_items_displa IN simple_items_display %]
243 [% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% simple_items_displa.biblionumber | uri %]&itemnumber=[% simple_items_displa.itemnumber | uri %]">[% simple_items_displa.barcode | html %]</a>[% ELSE %][% simple_items_displa.barcode | html %][% END %]
248 [% END %]<!-- /simple_items_display -->
252 [% IF ( too_many_items_process ) %]
253 <p>Too many items ([% too_many_items_process | html %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') | html %] items in a batch.</p>
254 [% ELSIF ( too_many_items_display ) %]
255 <p>Too many items ([% too_many_items_display | html %]): You are editing more than [% Koha.Preference('MaxItemsToDisplayForBatchMod') | html %] items in a batch, items will not be shown.</p>
256 [% FOREACH itemnumber IN itemnumbers_array %]
257 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
259 [% END %]<!-- /too_many_items -->
261 [% UNLESS (too_many_items_process) %]
262 <div id="cataloguing_additem_newitem">
264 <div class="hint">Checking the box right next to the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.</div>
265 <fieldset class="rows">
267 [% FOREACH ite IN item %]
269 <div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]">
270 [% SET mv = ite.marc_value %]
271 [% IF ( ite.mandatory ) %]
272 <label class="required" for="[%- mv.id | html -%]">
274 <label for="[%- mv.id | html -%]">
276 [% ite.subfield | html %] - [% ite.marc_lib | $raw %]
279 [% IF ( mv.type == 'select' ) -%]
280 <select name="[%- mv.name | html -%]" id="[%- mv.id | html -%]" size="1" tabindex="1" class="input_marceditor">
281 [%- FOREACH aval IN mv.values %]
282 [% ite.subfield | html %] -
283 [% IF aval == mv.default %]
284 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
286 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
290 [% ELSIF ( mv.type == 'text1' ) %]
291 <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
292 <a href="#" class="buttonDot" onclick="Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=[%- mv.authtypecode | uri -%]&index=[%- mv.id | uri -%]','[%- mv.id | uri -%]'); return false;" title="Tag editor">...</a>
293 [% ELSIF ( mv.type == 'text2' ) %]
294 <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
296 <a href="#" class="buttonDot disabled" title="No popup">...</a>
298 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot" title="Tag editor">...</a>
300 [% mv.javascript | $raw %]
301 [% ELSIF ( mv.type == 'text' ) %]
302 <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
303 [% ELSIF ( mv.type == 'hidden' ) %]
304 <input type="hidden" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
305 [% ELSIF ( mv.type == 'textarea' ) %]
306 <textarea tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value | html -%]"</textarea>
309 <span name="regex_fields" style="display: none;">
310 s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/
311 <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/
312 <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" />
315 [% UNLESS ( ite.mandatory ) %]
316 <input type="checkbox" id="row[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]" title="Check to delete subfield [% ite.subfield | html %]" name="disable_input" value="[% ite.subfield | html %]" />
318 <span class="required">Required</span>
321 [% IF (mv.type == 'text' || mv.type == 'textarea' ) %]
322 <a href="#" name="field_regex" id="[% ite.id | html %]" >RegEx</a>
325 <input type="hidden" name="tag" value="[% ite.tag | html %]" />
326 <input type="hidden" name="subfield" value="[% ite.subfield | html %]" />
327 <input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" />
328 [% IF ( ite.repeatable ) %]
329 <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
330 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
333 <span class="hint" id="hint[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]"></span>
339 <fieldset class="action">
341 <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
342 <div id="jobfailed"></div>
344 <input type="submit" id="mainformsubmit" value="Save" />
345 <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
349 <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
351 [% ELSE %] <!-- // show -->
352 <fieldset class="action">
353 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
354 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | html %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
356 <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
358 <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>
364 [% INCLUDE 'intranet-bottom.inc' %]