4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › Batch item modification</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
8 [% Asset.js("js/background-job-progressbar.js") | $raw %]
9 [% Asset.js("js/cataloging.js") | $raw %]
10 [% INCLUDE 'datatables.inc' %]
11 [% Asset.js("js/pages/batchMod.js") | $raw %]
13 // Prepare array of all column headers, incrementing each index by
14 // two to accommodate control and title columns
15 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count | html %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
16 for( x=0; x<allColumns.length; x++ ){
17 allColumns[x] = Number(allColumns[x]) + 2;
20 $(document).ready(function(){
21 $("input[name='disable_input']").click(function() {
22 var row = $(this).attr("id");
23 row = row.replace("row","hint");
24 var todisable = $(this).parent().find("[name='field_value'],[name='tag'],[name='subfield'],[name='mandatory']");
25 var regex_link = $(this).parent().find("[name='field_regex']");
26 if ($(this).is(":checked")) {
27 $(todisable).prop('disabled', true);
28 $("#"+row).html(_("This subfield will be deleted"));
31 $(todisable).prop('disabled', false);
36 $("#mainformsubmit").on("click",function(){
37 return submitBackgroundJob(this.form);
39 $('a[name="field_regex"]').click(function() {
40 var id = $(this).attr('id');
41 var editor = $(this).parent().find("[name='field_value']");
42 var regex = $(this).parent().find("[name='regex_fields']");
43 var disable_input = $(this).parent().find("[name='disable_input']");
44 if ($(this).html() == 'RegEx') {
48 $(disable_input).prop('disabled', true);
52 $(this).html('RegEx');
53 $(disable_input).prop('disabled', false);
59 <style>input[type=checkbox]{ margin : 0 .5em; }</style>
60 [% Asset.css("css/addbiblio.css") | $raw %]
61 [% Asset.css("css/humanmsg.css") | $raw %]
62 [% INCLUDE 'select2.inc' %]
65 <body id="tools_batchMod-edit" class="tools">
66 [% INCLUDE 'header.inc' %]
67 [% INCLUDE 'cat-search.inc' %]
69 <div id="breadcrumbs">
70 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
71 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
72 <a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a>
75 <div class="main container-fluid">
78 <h1>Batch item modification</h1>
80 <h1>Batch item modification results</h1>
81 <div class="dialog message">
82 [% IF (modified_items) %]
83 [% modified_items | html %] item(s) modified (with [% modified_fields | html %] field(s) modified).
87 <fieldset class="action">
88 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
90 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]">Return to the record</a>
92 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a>
95 <a href="[% src | url %]">Return to where you were</a>
97 <a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a>
100 </div> <!-- /.dialog.message -->
103 [% IF ( barcode_not_unique ) %]
104 <div class="dialog alert">
105 <strong>Error saving item</strong>: Barcode must be unique.
108 [% IF ( no_next_barcode ) %]
109 <div class="dialog alert">
110 <strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.
114 [% IF ( notfoundbarcodes.size ) %]
115 <div class="dialog alert">
116 <p>Warning, the following barcodes were not found:</p>
119 <table style="margin:auto;">
121 <tr><th>Barcodes not found</th></tr>
124 [% FOREACH notfoundbarcode IN notfoundbarcodes %]
125 <tr><td>[% notfoundbarcode |html %]</td></td>
130 [% IF ( item_loop ) %]
131 [% UNLESS ( too_many_items_display ) %]
132 <h4>The following barcodes were found: </h4>
135 [% END # /IF notfoundbarcodes.size %]
137 [% IF ( notfounditemnumbers.size ) %]
138 <div class="dialog alert">
139 <p>Warning, the following itemnumbers were not found:</p>
142 <table style="margin:auto;">
144 <tr><th>Itemnumbers not found</th></tr>
147 [% FOREACH notfounditemnumber IN notfounditemnumbers %]
148 <tr><td>[% notfounditemnumber |html %]</td></td>
152 [% IF ( item_loop ) %]
153 [% UNLESS ( too_many_items_display ) %]
154 <h4>The following itemnumbers were found: </h4>
157 [% END # /IF notfounditemnumbers.size %]
160 <form name="f" action="batchMod.pl" method="post">
161 <input type="hidden" name="op" value="[% op | html %]" />
162 <input type="hidden" name="searchid" value="[% searchid | html %]" />
163 <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
164 <input type="hidden" name="runinbackground" id="runinbackground" value="" />
165 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
166 <input type="hidden" name="src" id="src" value="[% src | html %]" />
167 [% IF biblionumber %]
168 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
171 [% IF ( item_loop ) %]
174 <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>
178 <div id="cataloguing_additem_itemlist">
181 <strong>Show/hide columns:</strong>
182 <span class="selected">
183 <input type="checkbox" checked="checked" id="showall" />
184 <label for="showall">Show all columns</label>
187 <input type="checkbox" id="hideall" />
188 <label for="hideall">Hide all columns</label>
191 [% FOREACH item_header_loo IN item_header_loop %]
192 <span class="selected">
193 <input id="checkheader[% loop.count | html %]" type="checkbox" checked="checked" />
194 <label for="checkheader[% loop.count | html %]">[% item_header_loo.header_value | html %]</label>
197 </p> <!-- /#selections -->
203 <th class="anti-the">Title</th>
204 <th class="holds_count" title="Item holds / Total holds">Holds</th>
205 [% FOREACH item_header_loo IN item_header_loop %]
206 <th> [% item_header_loo.header_value | html %] </th>
211 [% FOREACH item_loo IN item_loop %]
214 [% IF item_loo.nomod %]
215 <td class="error">Cannot edit</td>
218 <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 %]" />
225 <label for="row[% item_loo.itemnumber | html %]">
226 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber | uri %]">
227 [% item_loo.title | html %]
229 [% IF ( item_loo.author ) %], by [% item_loo.author | html %][% END %]
232 <td class="holds_count">
233 [% IF item_loo.holds %]
234 [% IF item_loo.item_holds %]
235 <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 -%]" >
237 <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 -%]" >
240 [% IF item_loo.holds %]
241 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="Holds on this record: [% item_loo.holds | html -%]" >
243 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% item_loo.biblionumber | uri %]" title="No holds on this record" >
245 [% END # /IF item_loo.holds %]
246 [% IF item_loo.holds %]
247 [% item_loo.item_holds | html %]/[% item_loo.holds | html %]
249 [% item_loo.holds | html %]
253 [% FOREACH item_valu IN item_loo.item_value %]
255 [% item_valu.field | html %]
259 [% END # /FOREACH item_loo %]
261 </table> <!-- /#itemst -->
262 </div> <!-- /#cataloguing_additem_itemlist -->
263 [% END # /IF item_loop %]
265 [% IF ( simple_items_display || job_completed ) %]
266 [% IF ( too_many_items_display ) %]
267 <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>
269 <p>The following items were modified:</p>
271 [% FOREACH simple_items_displa IN simple_items_display %]
273 [% 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 %]
277 [% END # /IF too_many_items_display %]
278 [% END # /IF simple_items_display %]
282 [% IF ( too_many_items_process ) %]
283 <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>
284 [% ELSIF ( too_many_items_display ) %]
285 <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>
286 [% FOREACH itemnumber IN itemnumbers_array %]
287 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
289 [% END # /IF too_many_items_process %]
291 [% UNLESS (too_many_items_process) %]
292 <div id="cataloguing_additem_newitem">
294 <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>
295 <fieldset class="rows">
297 [% FOREACH ite IN item %]
299 <div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]">
300 [% SET mv = ite.marc_value %]
301 [% IF ( ite.mandatory ) %]
302 <label class="required" for="[%- mv.id | html -%]">
304 <label for="[%- mv.id | html -%]">
306 [% ite.subfield | html %] - [% ite.marc_lib | $raw %]
309 [% IF ( mv.type == 'select' ) -%]
310 <select name="[%- mv.name | html -%]" id="[%- mv.id | html -%]" size="1" tabindex="1" class="input_marceditor select2">
311 [%- FOREACH aval IN mv.values %]
312 [% ite.subfield | html %] -
313 [% IF aval == mv.default %]
314 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
316 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
320 [% ELSIF ( mv.type == 'text1' ) %]
321 <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
322 <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>
323 [% ELSIF ( mv.type == 'text2' ) %]
324 <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
326 <a href="#" class="buttonDot disabled" title="No popup">...</a>
328 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot" title="Tag editor">...</a>
330 [% mv.javascript | $raw %]
331 [% ELSIF ( mv.type == 'text' ) %]
332 <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
333 [% ELSIF ( mv.type == 'hidden' ) %]
334 <input type="hidden" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" />
335 [% ELSIF ( mv.type == 'textarea' ) %]
336 <textarea tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value | html -%]"</textarea>
337 [%- END # /IF mv.type == ... -%]
339 <span name="regex_fields" style="display: none;">
340 s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/
341 <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/
342 <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" />
345 [% UNLESS ( ite.mandatory ) %]
346 <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 %]" />
348 <span class="required">Required</span>
351 [% IF (mv.type == 'text' || mv.type == 'textarea' ) %]
352 <a href="#" name="field_regex" id="[% ite.id | html %]" >RegEx</a>
355 <input type="hidden" name="tag" value="[% ite.tag | html %]" />
356 <input type="hidden" name="subfield" value="[% ite.subfield | html %]" />
357 <input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" />
358 [% IF ( ite.repeatable ) %]
359 <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;">
360 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
363 <span class="hint" id="hint[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]"></span>
364 </div> <!-- /.subfield_line -->
366 [% END # /FOREACH ite %]
370 <fieldset class="rows">
371 <legend>Other attributes</legend>
374 <div class="subfield_line">
375 <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
376 <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority" class="input_marceditor select2" style="width: 50px">
377 <option selected></option>
378 <option value="1">Yes</option>
379 <option value="0">No</option>
386 <fieldset class="action">
388 <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
389 <div id="jobfailed"></div>
391 <input type="submit" id="mainformsubmit" value="Save" />
392 <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
394 </div> <!-- /#cataloguing_additem_newitem -->
396 <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
397 [% END # /UNLESS too_many_items_process %]
399 <fieldset class="action">
400 [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%]
402 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&searchid=[% searchid | uri %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
404 <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
407 <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
409 <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>
411 </fieldset> <!-- /.action -->
414 [% INCLUDE 'intranet-bottom.inc' %]