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",
40 { "mDataProp": "import_record_id" },
41 { "mDataProp": "citation" },
42 { "mDataProp": "status" },
43 { "mDataProp": "overlay_status" },
44 { "mDataProp": "match_citation" },
45 { "mDataProp": "matched" },
47 "fnServerData": function ( sSource, aoData, fnCallback ) {
48 aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } );
50 $.getJSON( sSource, aoData, function (json) {
54 "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
55 $('td:eq(1)', nRow).html(
56 '<a href="javascript:void()" onclick="show_marc('
57 + aData['import_record_id']
58 + ')">' + aData['citation'] + '</a>'
61 if ( aData['match_id'] ) {
62 $('td:eq(4)', nRow).html(
65 + " (" + _("score") + "="
67 + '):' + '<a target="_blank" href="http://staff.kohadev/cgi-bin/koha/catalogue/detail.pl?biblionumber='
68 + aData['match_id'] + '">' + aData['match_citation'] + '</a>'
72 $('td:eq(5)', nRow).html(
73 '<a target="_blank" href="http://staff.kohadev/cgi-bin/koha/catalogue/detail.pl?biblionumber='
74 + aData['matched'] + '">' + aData['matched'] + '</a>'
80 function show_marc( id ) {
81 var page = "/cgi-bin/koha/catalogue/showmarc.pl?importid=" + id;
83 var $dialog = $('<div></div>')
84 .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
90 title: _("MARC Preview")
93 $dialog.dialog('open');
97 <style type="text/css">
98 #jobpanel,#jobstatus,#jobfailed { display : none; }
99 #jobstatus { margin:.4em; }
100 #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>
102 <body id="tools_manage-marc-import" class="tools">
103 [% INCLUDE 'header.inc' %]
104 [% INCLUDE 'cat-search.inc' %]
106 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
107 [% IF ( import_batch_id ) %]
109 <a href="[% script_name %]">Manage staged MARC records</a>
110 › Batch [% import_batch_id %]
112 › Manage staged MARC records
116 <div id="doc3" class="yui-t2">
122 <h1>Manage staged MARC records
123 [% IF ( import_batch_id ) %]
124 › Batch [% import_batch_id %]
127 [% IF ( label_batch_msg ) %]
133 <b><p>[% label_batch_msg %]</p></b>
137 [% IF ( did_clean ) %]
138 <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
141 [% UNLESS ( batch_list ) %]
142 [% UNLESS ( batch_info ) %]
143 <div class="dialog message">
144 <p>No records have been staged.</p>
145 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
150 [% IF ( batch_info ) %]
152 [% IF ( can_commit ) %]
153 <form action="[% script_name %]" method="post">
154 <input type="hidden" name="op" value="redo-matching" />
155 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
156 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
159 [% IF ( rematch_attempted ) %]
160 [% IF ( rematch_failed ) %]
161 <div class="dialog alert">Failed to apply different matching rule</div>
163 <div class="dialog message">Applied different matching rule. Number of records matched now
164 [% num_with_matches %]
168 [% IF ( changed_overlay_action ) %]
169 <div class="dialog message">Changed action if matching record found</div>
171 [% IF ( changed_nomatch_action ) %]
172 <div class="dialog message">Changed action if no match found</div>
174 [% IF ( changed_item_action ) %]
175 <div class="dialog message">Changed item processing option</div>
178 <fieldset class="rows" id="staged-record-matching-rules">
180 <li><span class="label">File name:</span> [% file_name %]</li>
181 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
182 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
183 <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
184 <li><span class="label">Status:</span>
185 [% IF ( import_status == 'cleaned' ) %]
187 [% ELSIF ( import_status == 'imported' ) %]
189 [% ELSIF ( import_status == 'importing' ) %]
191 [% ELSIF ( import_status == 'reverted' ) %]
193 [% ELSIF ( import_status == 'reverting' ) %]
195 [% ELSIF ( import_status == 'staged' ) %]
202 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
203 <option value="">Do not look for matching records</option>
204 [% FOREACH available_matcher IN available_matchers %]
205 [% IF ( available_matcher.selected ) %]
206 <option value="[% available_matcher.matcher_id %]" selected="selected">
207 [% available_matcher.code %] ([% available_matcher.description %])
210 <option value="[% available_matcher.matcher_id %]">
211 [% available_matcher.code %] ([% available_matcher.description %])
215 </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 ) %]
216 [% current_matcher_code %] ([% current_matcher_description %])
218 No matching rule in effect
222 [% IF ( can_commit ) %]
223 <label for="overlay_action">Action if matching record found:</label>
224 [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
226 <span class="label">Action if matching record found:</span>
227 [% IF ( overlay_action == 'replace' ) %]
228 Replace existing record with incoming record
229 [% ELSIF ( overlay_action == 'create_new' ) %]
231 [% ELSIF ( overlay_action == 'ignore' ) %]
232 Ignore incoming record (its items may still be processed)
239 [% IF ( can_commit ) %]
240 <label for="nomatch_action">Action if no match found:</label>
241 [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
243 <span class="label">Action if no match found:</span>
244 [% IF ( nomatch_action == 'create_new' ) %]
246 [% ELSIF ( nomatch_action == 'ignore' ) %]
247 Ignore incoming record (its items may still be processed)
255 [% IF ( can_commit ) %]
256 <label for="item_action">Item processing:</label>
257 [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
259 <span class="label">Item processing:</span>
260 [% IF ( item_action == 'always_add' ) %]
262 [% ELSIF ( item_action == 'add_only_for_matches' ) %]
263 Add items only if matching bib was found
264 [% ELSIF ( item_action == 'add_only_for_new' ) %]
265 Add items only if no matching bib was found
266 [% ELSIF ( item_action == 'ignore' ) %]
274 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
279 [% IF ( can_commit ) %]
280 <form action="[% script_name %]" method="post">
281 <input type="hidden" name="op" value="commit-batch" />
282 <input type="hidden" name="runinbackground" value="" />
283 <input type="hidden" name="completedJobID" value="" />
284 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
285 <fieldset class="action">
286 <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
288 [% IF ( record_type != 'auth' ) %]
289 Add new bibliographic records into this framework:
290 <select name="framework" id="frameworks">
291 <option value="">Default</option>
292 [% FOREACH framework IN frameworks %]
293 <option value="[% framework.value %]">[% framework.label %]</option>
299 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
300 <div id="jobfailed"></div></div>
302 [% IF ( can_revert ) %]
303 <form action="[% script_name %]" method="post">
304 <input type="hidden" name="op" value="revert-batch" />
305 <input type="hidden" name="runinbackground" value="" />
306 <input type="hidden" name="completedJobID" value="" />
307 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
308 <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
310 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
311 <div id="jobfailed"></div></div>
314 [% IF ( did_commit ) %]
315 <div class="dialog message">Completed import of records</div>
317 <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
318 <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
319 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
320 <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
321 <tr><td>Number of items replaced</td><td>[% num_items_replaced %]</td></tr>
322 <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
325 [% IF ( did_revert ) %]
326 <div class="dialog message">Success: Import reversed</div>
328 <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
329 <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
330 <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
331 <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
332 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
336 <br style="clear:both;" />
338 [% IF ( batch_list ) %]
342 [% FOREACH page IN pages %]
343 [% IF ( page.current_page ) %]
344 <span class="current">[% page.page_number %]</span>
346 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
363 [% FOREACH batch_lis IN batch_list %]
364 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
365 <td>[% batch_lis.import_batch_id %]</td>
366 <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
367 <td>[% batch_lis.comments %]</td>
368 <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
370 [% IF ( batch_lis.import_status == 'cleaned' ) %]
372 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
374 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
376 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
378 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
380 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
383 [% batch_lis.import_status %]
386 <td>[% batch_lis.upload_timestamp %]</td>
387 <td>[% batch_lis.num_records %]</td>
388 <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>
389 <td>[% IF ( batch_lis.can_clean ) %]
390 <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
391 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
392 <input type="hidden" name="op" value="clean-batch" />
393 <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
403 [% FOREACH page IN pages %]
404 [% IF ( page.current_page ) %]
405 <span class="current">[% page.page_number %]</span>
407 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
414 <table id="records-table">
430 [% INCLUDE 'tools-menu.inc' %]
433 [% INCLUDE 'intranet-bottom.inc' %]