1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Manage staged MARC records
3 [% IF ( import_batch_id ) %]
4 › Batch [% import_batch_id %]
7 [% INCLUDE 'doc-head-close.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
9 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
11 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
12 [% INCLUDE 'datatables-strings.inc' %]
13 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
14 <script type="text/JavaScript" language="JavaScript">
16 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch? This cannot be undone.");
18 $(document).ready(function(){
19 $("#staged-record-matching-rules select").change(function(){
20 var str = $(this).attr("id");
21 $("#reset_"+str).parent().show();
23 $("a.reset").click(function(){
24 var str = $(this).attr("id");
25 str = str.replace("reset_","")
26 $("#"+str+" option[selected='selected']").attr("selected","selected");
27 $(this).parent().hide();
30 $("#records-table").dataTable({
31 "aLengthMenu": [[10, 15, 20, 25, 50, 100], [10, 15, 20, 25, 50, 100]],
32 "iDisplayLength" : 20,
37 "sAjaxSource": 'batch_records_ajax.pl',
38 "sPaginationType": "full_numbers",
39 "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">',
41 { "mDataProp": "import_record_id" },
42 { "mDataProp": "citation" },
43 { "mDataProp": "status" },
44 { "mDataProp": "overlay_status" },
45 { "mDataProp": "match_citation" },
46 { "mDataProp": "matched" },
48 "fnServerData": function ( sSource, aoData, fnCallback ) {
49 aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } );
51 $.getJSON( sSource, aoData, function (json) {
55 "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
56 $('td:eq(1)', nRow).html(
57 '<a href="javascript:void()" onclick="show_marc('
58 + aData['import_record_id']
59 + ')">' + aData['citation'] + '</a>'
62 if ( aData['match_id'] ) {
63 $('td:eq(4)', nRow).html(
66 + " (" + _("score") + "="
68 + '):' + '<a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='
69 + aData['match_id'] + '">' + aData['match_citation'] + '</a>'
73 $('td:eq(5)', nRow).html(
74 '<a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='
75 + aData['matched'] + '">' + aData['matched'] + '</a>'
81 function show_marc( id ) {
82 var page = "/cgi-bin/koha/catalogue/showmarc.pl?importid=" + id;
84 var $dialog = $('<div></div>')
85 .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
91 title: _("MARC Preview")
94 $dialog.dialog('open');
98 <style type="text/css">
99 #jobpanel,#jobstatus,#jobfailed { display : none; }
100 #jobstatus { margin:.4em; }
101 #jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('[% interface %]/[% theme %]/img/progress.png') -300px 0px no-repeat; } span.change-status { font-style:italic; color:#666; display:none; }</style>
103 <body id="tools_manage-marc-import" class="tools">
104 [% INCLUDE 'header.inc' %]
105 [% INCLUDE 'cat-search.inc' %]
107 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
108 [% IF ( import_batch_id ) %]
110 <a href="[% script_name %]">Manage staged MARC records</a>
111 › Batch [% import_batch_id %]
113 › Manage staged MARC records
117 <div id="doc3" class="yui-t2">
123 <h1>Manage staged MARC records
124 [% IF ( import_batch_id ) %]
125 › Batch [% import_batch_id %]
128 [% IF ( label_batch_msg ) %]
134 <b><p>[% label_batch_msg %]</p></b>
138 [% IF ( did_clean ) %]
139 <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
142 [% UNLESS ( batch_list ) %]
143 [% UNLESS ( batch_info ) %]
144 <div class="dialog message">
145 <p>No records have been staged.</p>
146 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
151 [% IF ( batch_info ) %]
153 [% IF ( can_commit ) %]
154 <form action="[% script_name %]" method="post">
155 <input type="hidden" name="op" value="redo-matching" />
156 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
157 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
160 [% IF ( rematch_attempted ) %]
161 [% IF ( rematch_failed ) %]
162 <div class="dialog alert">Failed to apply different matching rule</div>
164 <div class="dialog message">Applied different matching rule. Number of records matched now
165 [% num_with_matches %]
169 [% IF ( changed_overlay_action ) %]
170 <div class="dialog message">Changed action if matching record found</div>
172 [% IF ( changed_nomatch_action ) %]
173 <div class="dialog message">Changed action if no match found</div>
175 [% IF ( changed_item_action ) %]
176 <div class="dialog message">Changed item processing option</div>
179 <fieldset class="rows" id="staged-record-matching-rules">
181 <li><span class="label">File name:</span> [% file_name %]</li>
182 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
183 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
184 <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
185 <li><span class="label">Status:</span>
186 [% IF ( import_status == 'cleaned' ) %]
188 [% ELSIF ( import_status == 'imported' ) %]
190 [% ELSIF ( import_status == 'importing' ) %]
192 [% ELSIF ( import_status == 'reverted' ) %]
194 [% ELSIF ( import_status == 'reverting' ) %]
196 [% ELSIF ( import_status == 'staged' ) %]
203 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
204 <option value="">Do not look for matching records</option>
205 [% FOREACH available_matcher IN available_matchers %]
206 [% IF ( available_matcher.selected ) %]
207 <option value="[% available_matcher.matcher_id %]" selected="selected">
208 [% available_matcher.code %] ([% available_matcher.description %])
211 <option value="[% available_matcher.matcher_id %]">
212 [% available_matcher.code %] ([% available_matcher.description %])
216 </select> <span class="change-status">Changed. <a href="#" class="reset" id="reset_new_matcher_id">Reset</a></span>[% ELSE %]<span class="label">Matching rule applied</span>[% IF ( current_matcher_id ) %]
217 [% current_matcher_code %] ([% current_matcher_description %])
219 No matching rule in effect
223 [% IF ( can_commit ) %]
224 <label for="overlay_action">Action if matching record found:</label>
225 [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
227 <span class="label">Action if matching record found:</span>
228 [% IF ( overlay_action == 'replace' ) %]
229 Replace existing record with incoming record
230 [% ELSIF ( overlay_action == 'create_new' ) %]
232 [% ELSIF ( overlay_action == 'ignore' ) %]
233 Ignore incoming record (its items may still be processed)
240 [% IF ( can_commit ) %]
241 <label for="nomatch_action">Action if no match found:</label>
242 [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
244 <span class="label">Action if no match found:</span>
245 [% IF ( nomatch_action == 'create_new' ) %]
247 [% ELSIF ( nomatch_action == 'ignore' ) %]
248 Ignore incoming record (its items may still be processed)
256 [% IF ( can_commit ) %]
257 <label for="item_action">Item processing:</label>
258 [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
260 <span class="label">Item processing:</span>
261 [% IF ( item_action == 'always_add' ) %]
263 [% ELSIF ( item_action == 'add_only_for_matches' ) %]
264 Add items only if matching bib was found
265 [% ELSIF ( item_action == 'add_only_for_new' ) %]
266 Add items only if no matching bib was found
267 [% ELSIF ( item_action == 'ignore' ) %]
275 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
280 [% IF ( can_commit ) %]
281 <form action="[% script_name %]" method="post">
282 <input type="hidden" name="op" value="commit-batch" />
283 <input type="hidden" name="runinbackground" value="" />
284 <input type="hidden" name="completedJobID" value="" />
285 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
286 <fieldset class="action">
287 <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
289 [% IF ( record_type != 'auth' ) %]
290 Add new bibliographic records into this framework:
291 <select name="framework" id="frameworks">
292 <option value="">Default</option>
293 [% FOREACH framework IN frameworks %]
294 <option value="[% framework.value %]">[% framework.label %]</option>
300 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
301 <div id="jobfailed"></div></div>
303 [% IF ( can_revert ) %]
304 <form action="[% script_name %]" method="post">
305 <input type="hidden" name="op" value="revert-batch" />
306 <input type="hidden" name="runinbackground" value="" />
307 <input type="hidden" name="completedJobID" value="" />
308 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
309 <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
311 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
312 <div id="jobfailed"></div></div>
315 [% IF ( did_commit ) %]
316 <div class="dialog message">Completed import of records</div>
318 <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
319 <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
320 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
321 <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
322 <tr><td>Number of items replaced</td><td>[% num_items_replaced %]</td></tr>
323 <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
326 [% IF ( did_revert ) %]
327 <div class="dialog message">Success: Import reversed</div>
329 <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
330 <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
331 <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
332 <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
333 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
337 <br style="clear:both;" />
339 [% IF ( batch_list ) %]
343 [% FOREACH page IN pages %]
344 [% IF ( page.current_page ) %]
345 <span class="current">[% page.page_number %]</span>
347 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
364 [% FOREACH batch_lis IN batch_list %]
365 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
366 <td>[% batch_lis.import_batch_id %]</td>
367 <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
368 <td>[% batch_lis.comments %]</td>
369 <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
371 [% IF ( batch_lis.import_status == 'cleaned' ) %]
373 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
375 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
377 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
379 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
381 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
384 [% batch_lis.import_status %]
387 <td>[% batch_lis.upload_timestamp %]</td>
388 <td>[% batch_lis.num_records %]</td>
389 <td>[% batch_lis.num_items %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]&op=create_labels">(Create label batch)</a>[% END %]</td>
390 <td>[% IF ( batch_lis.can_clean ) %]
391 <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
392 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
393 <input type="hidden" name="op" value="clean-batch" />
394 <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
404 [% FOREACH page IN pages %]
405 [% IF ( page.current_page ) %]
406 <span class="current">[% page.page_number %]</span>
408 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
415 <table id="records-table">
422 <th>Match details</th>
431 [% INCLUDE 'tools-menu.inc' %]
434 [% INCLUDE 'intranet-bottom.inc' %]