1 [% BLOCK final_match_link %]
2 [% IF ( record.record_type == 'biblio' ) %]
3 <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a>
4 [% ELSIF ( record.record_type == 'auth' ) %]
5 <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a>
9 [% IF ( record_lis.match_id ) %]
12 [% IF ( record.record_type == 'biblio' ) %]
13 <td colspan="5">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
14 [% ELSIF ( record.record_type == 'auth' ) %]
15 <td colspan="5">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a> |
16 <a href="/cgi-bin/koha/authorities/merge.pl?mergereference=breeding&authid=[% record_lis.match_id %]&authid=[% record_lis.import_record_id %]">Merge</a>
20 [% ELSIF ( record.record_type == 'auth') %]
21 <tr data-authid="[% record_lis.import_record_id %]">
23 <td colspan="4"><a href="#" class="merge_auth">Search for a record to merge in a new window</a></td>
28 [% INCLUDE 'doc-head-open.inc' %]
29 <title>Koha › Tools › Manage staged MARC records
30 [% IF ( import_batch_id ) %]
31 › Batch [% import_batch_id %]
34 [% INCLUDE 'doc-head-close.inc' %]
35 <script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
36 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
37 [% INCLUDE 'datatables.inc' %]
38 <script type="text/javascript">
40 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch? This cannot be undone.");
41 var MSG_CONFIRM_UNDO_IMPORT = _("Are you sure you want to undo the import of this batch into the catalog?");
43 $(document).ready(function(){
44 $("#staged-record-matching-rules select").change(function(){
45 var str = $(this).attr("id");
46 $("#reset_"+str).parent().show();
48 $("a.reset").click(function(){
49 var str = $(this).attr("id");
50 str = str.replace("reset_","")
51 $("#"+str+" option[selected='selected']").attr("selected","selected");
52 $(this).parent().hide();
55 [% IF import_batch_id %]
56 $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, {
61 "sAjaxSource": 'batch_records_ajax.pl',
62 "sPaginationType": "full_numbers",
63 "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">',
65 { "mDataProp": "import_record_id" },
66 { "mDataProp": "citation" },
67 { "mDataProp": "status" },
68 { "mDataProp": "overlay_status" },
69 { "mDataProp": "match_citation" },
70 { "mDataProp": "diff_url" },
71 { "mDataProp": "matched" }
73 "fnServerData": function ( sSource, aoData, fnCallback ) {
74 aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } );
81 'success': function(json){
86 "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
87 [% IF ( record_type == 'auth' ) %]
88 var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid=";
90 var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=";
93 $('td:eq(1)', nRow).html(
94 '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>'
97 $('td:eq(2)', nRow).html(
98 aData['status'] == 'imported' ? _("Imported") :
99 aData['status'] == 'ignored' ? _("Ignored") :
100 aData['status'] == 'reverted' ? _("Reverted") :
101 aData['status'] == 'staged' ? _("Staged") :
102 aData['status'] == 'error' ? _("Error") :
106 $('td:eq(3)', nRow).html(
107 aData['overlay_status'] == 'no_match' ? _("No match") :
108 aData['overlay_status'] == 'match_applied' ? _("Match applied") :
109 aData['overlay_status'] == 'auto_match' ? _("Match found") :
110 aData['overlay_status']
113 if ( aData['match_id'] ) {
114 [% IF ( record_type == 'auth' ) -%]
115 var matching_msg = _("Matches authority %s (score=%s):%s");
117 var matching_msg = _("Matches biblio %s (score=%s):%s");
119 $('td:eq(4)', nRow).html(
120 matching_msg.format(aData['match_id'], aData['score'],
121 '<a target="_blank" href="' + record_details_url
122 + aData['match_id'] + '">' + aData['match_citation'] + '</a>')
125 if (aData['diff_url']){
126 $('td:eq(5)', nRow).html(
127 '<a href="'+aData['diff_url']+'">View</a>'
130 $('td:eq(6)', nRow).html(
131 '<a target="_blank" href="' + record_details_url
132 + aData['matched'] + '">' + aData['matched'] + '</a>'
137 $("body").on("click",".previewMARC", function(e){
139 var ltitle = $(this).text();
140 var page = $(this).attr("href");
141 $("#marcPreviewLabel").text(ltitle);
142 $("#marcPreview .modal-body").load(page + " table");
143 $('#marcPreview').modal({show:true});
145 $("#marcPreview").on("hidden", function(){
146 $("#marcPreviewLabel").html("");
147 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
153 <style type="text/css">
154 #jobpanel,#jobstatus,#jobfailed { display : none; }
155 #jobstatus { margin:.4em; }
156 #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; }#marcPreview { width : 80%; margin-left : -40%; } @media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } }
159 <body id="tools_manage-marc-import" class="tools">
160 [% INCLUDE 'header.inc' %]
161 [% INCLUDE 'cat-search.inc' %]
163 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
164 [% IF ( import_batch_id ) %]
166 <a href="[% script_name %]">Manage staged MARC records</a>
167 › Batch [% import_batch_id %]
169 › Manage staged MARC records
173 <div id="doc3" class="yui-t2">
179 <h1>Manage staged MARC records
180 [% IF ( import_batch_id ) %]
181 › Batch [% import_batch_id %]
184 [% IF ( label_batch_msg ) %]
188 <div class="dialog message">
190 <b><p>[% label_batch_msg %]</p></b>
194 [% IF ( did_clean ) %]
195 <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
198 [% UNLESS ( batch_list ) %]
199 [% UNLESS ( batch_info ) %]
200 <div class="dialog message">
201 <p>No records have been staged.</p>
202 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
207 [% IF ( batch_info ) %]
209 [% IF ( can_commit ) %]
210 <form action="[% script_name %]" method="post">
211 <input type="hidden" name="op" value="redo-matching" />
212 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
213 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
216 [% IF ( rematch_attempted ) %]
217 [% IF ( rematch_failed ) %]
218 <div class="dialog alert">Failed to apply different matching rule</div>
220 <div class="dialog message">Applied different matching rule. Number of records matched now
221 [% num_with_matches %]
225 [% IF ( changed_overlay_action ) %]
226 <div class="dialog message">Changed action if matching record found</div>
228 [% IF ( changed_nomatch_action ) %]
229 <div class="dialog message">Changed action if no match found</div>
231 [% IF ( changed_item_action ) %]
232 <div class="dialog message">Changed item processing option</div>
235 <fieldset class="rows" id="staged-record-matching-rules">
237 <li><span class="label">File name:</span> [% file_name %]</li>
238 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
239 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
240 <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
241 <li><span class="label">Status:</span>
242 [% IF ( import_status == 'cleaned' ) %]
244 [% ELSIF ( import_status == 'imported' ) %]
246 [% ELSIF ( import_status == 'importing' ) %]
248 [% ELSIF ( import_status == 'reverted' ) %]
250 [% ELSIF ( import_status == 'reverting' ) %]
252 [% ELSIF ( import_status == 'staged' ) %]
259 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
260 <option value="">Do not look for matching records</option>
261 [% FOREACH available_matcher IN available_matchers %]
262 [% IF ( available_matcher.selected ) %]
263 <option value="[% available_matcher.matcher_id %]" selected="selected">
264 [% available_matcher.code %] ([% available_matcher.description %])
267 <option value="[% available_matcher.matcher_id %]">
268 [% available_matcher.code %] ([% available_matcher.description %])
272 </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 ) %]
273 [% current_matcher_code %] ([% current_matcher_description %])
275 No matching rule in effect
279 [% IF ( can_commit ) %]
280 <label for="overlay_action">Action if matching record found:</label>
281 [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
283 <span class="label">Action if matching record found:</span>
284 [% IF ( overlay_action == 'replace' ) %]
285 Replace existing record with incoming record
286 [% ELSIF ( overlay_action == 'create_new' ) %]
288 [% ELSIF ( overlay_action == 'ignore' ) %]
289 Ignore incoming record (its items may still be processed)
296 [% IF ( can_commit ) %]
297 <label for="nomatch_action">Action if no match found:</label>
298 [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
300 <span class="label">Action if no match found:</span>
301 [% IF ( nomatch_action == 'create_new' ) %]
303 [% ELSIF ( nomatch_action == 'ignore' ) %]
304 Ignore incoming record (its items may still be processed)
311 [% IF ( record_type == 'biblio' ) %]
313 [% IF ( can_commit ) %]
314 <label for="item_action">Item processing:</label>
315 [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
317 <span class="label">Item processing:</span>
318 [% IF ( item_action == 'always_add' ) %]
320 [% ELSIF ( item_action == 'add_only_for_matches' ) %]
321 Add items only if matching bib was found
322 [% ELSIF ( item_action == 'add_only_for_new' ) %]
323 Add items only if no matching bib was found
324 [% ELSIF ( item_action == 'ignore' ) %]
333 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
338 [% IF ( can_commit ) %]
339 <form action="[% script_name %]" method="post">
340 <input type="hidden" name="op" value="commit-batch" />
341 <input type="hidden" name="runinbackground" value="" />
342 <input type="hidden" name="completedJobID" value="" />
343 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
344 <fieldset class="action">
345 <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
347 [% IF ( record_type != 'auth' ) %]
348 Add new bibliographic records into this framework:
349 <select name="framework" id="frameworks">
350 <option value="">Default</option>
351 [% FOREACH framework IN frameworks %]
352 <option value="[% framework.value %]">[% framework.label %]</option>
358 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
359 <div id="jobfailed"></div></div>
361 [% IF ( can_revert ) %]
362 <form action="[% script_name %]" method="post">
363 <input type="hidden" name="op" value="revert-batch" />
364 <input type="hidden" name="runinbackground" value="" />
365 <input type="hidden" name="completedJobID" value="" />
366 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
367 <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return confirm(MSG_CONFIRM_UNDO_IMPORT) && submitBackgroundJob(this.form);" /></fieldset>
369 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
370 <div id="jobfailed"></div></div>
373 [% IF ( did_commit ) %]
374 <div class="dialog message">Completed import of records</div>
376 <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
377 <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
378 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
379 [% IF ( record_type == 'biblio' ) %]
380 <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
381 <tr><td>Number of items replaced</td><td>[% num_items_replaced %]</td></tr>
382 <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
386 [% IF ( did_revert ) %]
387 <div class="dialog message">Success: Import reversed</div>
389 <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
390 [% IF ( record_type == 'biblio' ) %]
391 <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
392 <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
394 <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
395 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
399 <br style="clear:both;" />
401 [% IF ( batch_list ) %]
405 [% FOREACH page IN pages %]
406 [% IF ( page.current_page ) %]
407 <span class="current">[% page.page_number %]</span>
409 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
426 [% FOREACH batch_lis IN batch_list %]
428 <td>[% batch_lis.import_batch_id %]</td>
429 <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
430 <td>[% batch_lis.comments %]</td>
431 <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
433 [% IF ( batch_lis.import_status == 'cleaned' ) %]
435 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
437 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
439 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
441 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
443 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
446 [% batch_lis.import_status %]
449 <td>[% batch_lis.upload_timestamp %]</td>
450 <td>[% batch_lis.num_records %]</td>
451 <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>
452 <td>[% IF ( batch_lis.can_clean ) %]
453 <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
454 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
455 <input type="hidden" name="op" value="clean-batch" />
456 <button class="btn btn-small" onclick="return confirm(MSG_CONFIRM_CLEAN);">Clean</button>
466 [% FOREACH page IN pages %]
467 [% IF ( page.current_page ) %]
468 <span class="current">[% page.page_number %]</span>
470 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
477 [% IF import_batch_id %]
478 <table id="records-table">
485 <th>Match details</th>
486 <th><abbr title="Differences between the original biblio and the imported" lang="en">Diff</abbr></th>
492 <div id="marcPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
493 <div class="modal-header">
494 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
495 <h3 id="marcPreviewLabel">MARC preview</h3>
497 <div class="modal-body">
498 <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
500 <div class="modal-footer">
501 <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
509 [% INCLUDE 'tools-menu.inc' %]
512 [% INCLUDE 'intranet-bottom.inc' %]