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 class="highlight" colspan="4">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 class="highlight" colspan="4">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 class="highlight" colspan="4"><a href="#" class="merge_auth">Search for a record to merge in a new window</a></td>
27 [% INCLUDE 'doc-head-open.inc' %]
28 <title>Koha › Tools › Manage staged MARC records
29 [% IF ( import_batch_id ) %]
30 › Batch [% import_batch_id %]
33 [% INCLUDE 'greybox.inc' %]
34 [% INCLUDE 'doc-head-close.inc' %]
35 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
36 <script type="text/JavaScript" language="JavaScript">
38 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch? This cannot be undone.");
40 $(document).ready(function(){
41 $("#staged-record-matching-rules select").change(function(){
42 var str = $(this).attr("id");
43 $("#reset_"+str).parent().show();
45 $("a.reset").click(function(){
46 var str = $(this).attr("id");
47 str = str.replace("reset_","")
48 $("#"+str+" option[selected='selected']").attr("selected","selected");
49 $(this).parent().hide();
52 $('.merge_auth').click(function(event) {
53 event.preventDefault();
54 var authid = $(this).parents('tr').attr('data-authid');
55 $.cookie('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': $('tr[data-id="' + authid + '"] .citation').text(), 'mergereference': 'breeding' }), { 'path': '/' });
56 window.open("/cgi-bin/koha/authorities/authorities-home.pl");
61 <style type="text/css">
62 #jobpanel,#jobstatus,#jobfailed { display : none; }
63 #jobstatus { margin:.4em; }
64 #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>
66 <body id="tools_manage-marc-import" class="tools">
67 [% INCLUDE 'header.inc' %]
68 [% INCLUDE 'cat-search.inc' %]
70 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
71 [% IF ( import_batch_id ) %]
73 <a href="[% script_name %]">Manage staged MARC records</a>
74 › Batch [% import_batch_id %]
76 › Manage staged MARC records
80 <div id="doc3" class="yui-t2">
86 <h1>Manage staged MARC records
87 [% IF ( import_batch_id ) %]
88 › Batch [% import_batch_id %]
91 [% IF ( label_batch_msg ) %]
97 <b><p>[% label_batch_msg %]</p></b>
101 [% IF ( did_clean ) %]
102 <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
105 [% UNLESS ( batch_list ) %]
106 [% UNLESS ( batch_info ) %]
107 <div class="dialog message">
108 <p>No records have been staged.</p>
109 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
114 [% IF ( batch_info ) %]
116 [% IF ( can_commit ) %]
117 <form action="[% script_name %]" method="post">
118 <input type="hidden" name="op" value="redo-matching" />
119 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
120 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
123 [% IF ( rematch_attempted ) %]
124 [% IF ( rematch_failed ) %]
125 <div class="dialog alert">Failed to apply different matching rule</div>
127 <div class="dialog message">Applied different matching rule. Number of records matched now
128 [% num_with_matches %]
132 [% IF ( changed_overlay_action ) %]
133 <div class="dialog message">Changed action if matching record found</div>
135 [% IF ( changed_nomatch_action ) %]
136 <div class="dialog message">Changed action if no match found</div>
138 [% IF ( changed_item_action ) %]
139 <div class="dialog message">Changed item processing option</div>
142 <fieldset class="rows" id="staged-record-matching-rules">
144 <li><span class="label">File name:</span> [% file_name %]</li>
145 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
146 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
147 <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
148 <li><span class="label">Status:</span>
149 [% IF ( import_status == 'cleaned' ) %]
151 [% ELSIF ( import_status == 'imported' ) %]
153 [% ELSIF ( import_status == 'importing' ) %]
155 [% ELSIF ( import_status == 'reverted' ) %]
157 [% ELSIF ( import_status == 'reverting' ) %]
159 [% ELSIF ( import_status == 'staged' ) %]
166 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
167 <option value="">Do not look for matching records</option>
168 [% FOREACH available_matcher IN available_matchers %]
169 [% IF ( available_matcher.selected ) %]
170 <option value="[% available_matcher.matcher_id %]" selected="selected">
171 [% available_matcher.code %] ([% available_matcher.description %])
174 <option value="[% available_matcher.matcher_id %]">
175 [% available_matcher.code %] ([% available_matcher.description %])
179 </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 ) %]
180 [% current_matcher_code %] ([% current_matcher_description %])
182 No matching rule in effect
186 [% IF ( can_commit ) %]
187 <label for="overlay_action">Action if matching record found:</label>
188 [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
190 <span class="label">Action if matching record found:</span>
191 [% IF ( overlay_action == 'replace' ) %]
192 Replace existing record with incoming record
193 [% ELSIF ( overlay_action == 'create_new' ) %]
195 [% ELSIF ( overlay_action == 'ignore' ) %]
196 Ignore incoming record (its items may still be processed)
203 [% IF ( can_commit ) %]
204 <label for="nomatch_action">Action if no match found:</label>
205 [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
207 <span class="label">Action if no match found:</span>
208 [% IF ( nomatch_action == 'create_new' ) %]
210 [% ELSIF ( nomatch_action == 'ignore' ) %]
211 Ignore incoming record (its items may still be processed)
219 [% IF ( can_commit ) %]
220 <label for="item_action">Item processing:</label>
221 [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
223 <span class="label">Item processing:</span>
224 [% IF ( item_action == 'always_add' ) %]
226 [% ELSIF ( item_action == 'add_only_for_matches' ) %]
227 Add items only if matching bib was found
228 [% ELSIF ( item_action == 'add_only_for_new' ) %]
229 Add items only if no matching bib was found
230 [% ELSIF ( item_action == 'ignore' ) %]
238 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
243 [% IF ( can_commit ) %]
244 <form action="[% script_name %]" method="post">
245 <input type="hidden" name="op" value="commit-batch" />
246 <input type="hidden" name="runinbackground" value="" />
247 <input type="hidden" name="completedJobID" value="" />
248 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
249 <fieldset class="action">
250 <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
252 [% IF ( record_type != 'auth' ) %]
253 Add new bibliographic records into this framework:
254 <select name="framework" id="frameworks">
255 <option value="">Default</option>
256 [% FOREACH framework IN frameworks %]
257 <option value="[% framework.value %]">[% framework.label %]</option>
263 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
264 <div id="jobfailed"></div></div>
266 [% IF ( can_revert ) %]
267 <form action="[% script_name %]" method="post">
268 <input type="hidden" name="op" value="revert-batch" />
269 <input type="hidden" name="runinbackground" value="" />
270 <input type="hidden" name="completedJobID" value="" />
271 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
272 <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
274 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
275 <div id="jobfailed"></div></div>
278 [% IF ( did_commit ) %]
279 <div class="dialog message">Completed import of records</div>
281 <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
282 <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
283 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
284 <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
285 <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
288 [% IF ( did_revert ) %]
289 <div class="dialog message">Success: Import reversed</div>
291 <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
292 <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
293 <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
294 <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
295 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
299 <br style="clear:both;" />
301 [% IF ( batch_list ) %]
305 [% FOREACH page IN pages %]
306 [% IF ( page.current_page ) %]
307 <span class="current">[% page.page_number %]</span>
309 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
326 [% FOREACH batch_lis IN batch_list %]
327 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
328 <td>[% batch_lis.import_batch_id %]</td>
329 <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
330 <td>[% batch_lis.comments %]</td>
331 <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
333 [% IF ( batch_lis.import_status == 'cleaned' ) %]
335 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
337 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
339 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
341 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
343 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
346 [% batch_lis.import_status %]
349 <td>[% batch_lis.upload_timestamp %]</td>
350 <td>[% batch_lis.num_records %]</td>
351 <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>
352 <td>[% IF ( batch_lis.can_clean ) %]
353 <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
354 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
355 <input type="hidden" name="op" value="clean-batch" />
356 <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
366 [% FOREACH page IN pages %]
367 [% IF ( page.current_page ) %]
368 <span class="current">[% page.page_number %]</span>
370 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
377 [% IF ( record_list ) %]
381 [% FOREACH page IN pages %]
382 [% IF ( page.current_page ) %]
383 <span class="current">[% page.page_number %]</span>
385 <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&offset=[% page.offset %]">[% page.page_number %]</a>
399 [% FOREACH record_lis IN record_list %]
400 [% UNLESS ( loop.odd ) %]<tr data-id="[% record_lis.import_record_id %]" class="highlight">[% ELSE %]<tr data-id="[% record_lis.import_record_id %]">[% END %]
401 <td>[% record_lis.record_sequence %]</td>
402 <td><a class="citation" href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% record_lis.import_record_id %]" rel="gb_page_center[600,500]">[% record_lis.citation %]</a></td>
404 [% IF ( record_lis.status == 'imported' ) %]
406 [% ELSIF ( record_lis.status == 'ignored' ) %]
408 [% ELSIF ( record_lis.status == 'reverted' ) %]
410 [% ELSIF ( record_lis.status == 'staged' ) %]
412 [% ELSIF ( record_lis.status == 'error' ) %]
415 [% record_lis.status %]
419 [% IF ( record_lis.overlay_status == 'no_match' ) %]
421 [% ELSIF ( record_lis.overlay_status == 'match_applied' ) %]
423 [% ELSIF ( record_lis.overlay_status == 'auto_match' ) %]
426 [% record_lis.overlay_status %]
429 <td>[% IF ( record_lis.final_match_id ) %]
430 [% PROCESS final_match_link record=record_lis %]
434 [% PROCESS match_link record=record_lis %]
440 [% FOREACH page IN pages %]
441 [% IF ( page.current_page ) %]
442 <span class="current">[% page.page_number %]</span>
444 <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&offset=[% page.offset %]">[% page.page_number %]</a>
450 [% IF ( batch_info ) %]
451 <div class="dialog alert">There are no records in this batch to import.
452 <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a>.</div>
460 [% INCLUDE 'tools-menu.inc' %]
463 [% INCLUDE 'intranet-bottom.inc' %]