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></td>
20 [% INCLUDE 'doc-head-open.inc' %]
21 <title>Koha › Tools › Manage staged MARC records
22 [% IF ( import_batch_id ) %]
23 › Batch [% import_batch_id %]
26 [% INCLUDE 'greybox.inc' %]
27 [% INCLUDE 'doc-head-close.inc' %]
28 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
29 <script type="text/JavaScript" language="JavaScript">
31 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch? This cannot be undone.");
33 $(document).ready(function(){
34 $("#staged-record-matching-rules select").change(function(){
35 var str = $(this).attr("id");
36 $("#reset_"+str).parent().show();
38 $("a.reset").click(function(){
39 var str = $(this).attr("id");
40 str = str.replace("reset_","")
41 $("#"+str+" option[selected='selected']").attr("selected","selected");
42 $(this).parent().hide();
47 <style type="text/css">
48 #jobpanel,#jobstatus,#jobfailed { display : none; }
49 #jobstatus { margin:.4em; }
50 #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>
52 <body id="tools_manage-marc-import" class="tools">
53 [% INCLUDE 'header.inc' %]
54 [% INCLUDE 'cat-search.inc' %]
56 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
57 [% IF ( import_batch_id ) %]
59 <a href="[% script_name %]">Manage staged MARC records</a>
60 › Batch [% import_batch_id %]
62 › Manage staged MARC records
66 <div id="doc3" class="yui-t2">
72 <h1>Manage staged MARC records
73 [% IF ( import_batch_id ) %]
74 › Batch [% import_batch_id %]
77 [% IF ( label_batch_msg ) %]
83 <b><p>[% label_batch_msg %]</p></b>
87 [% IF ( did_clean ) %]
88 <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
91 [% UNLESS ( batch_list ) %]
92 [% UNLESS ( batch_info ) %]
93 <div class="dialog message">
94 <p>No records have been staged.</p>
95 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
100 [% IF ( batch_info ) %]
102 [% IF ( can_commit ) %]
103 <form action="[% script_name %]" method="post">
104 <input type="hidden" name="op" value="redo-matching" />
105 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
106 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
109 [% IF ( rematch_attempted ) %]
110 [% IF ( rematch_failed ) %]
111 <div class="dialog alert">Failed to apply different matching rule</div>
113 <div class="dialog message">Applied different matching rule. Number of records matched now
114 [% num_with_matches %]
118 [% IF ( changed_overlay_action ) %]
119 <div class="dialog message">Changed action if matching record found</div>
121 [% IF ( changed_nomatch_action ) %]
122 <div class="dialog message">Changed action if no match found</div>
124 [% IF ( changed_item_action ) %]
125 <div class="dialog message">Changed item processing option</div>
128 <fieldset class="rows" id="staged-record-matching-rules">
130 <li><span class="label">File name:</span> [% file_name %]</li>
131 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
132 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
133 <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
134 <li><span class="label">Status:</span>
135 [% IF ( import_status == 'cleaned' ) %]
137 [% ELSIF ( import_status == 'imported' ) %]
139 [% ELSIF ( import_status == 'importing' ) %]
141 [% ELSIF ( import_status == 'reverted' ) %]
143 [% ELSIF ( import_status == 'reverting' ) %]
145 [% ELSIF ( import_status == 'staged' ) %]
152 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
153 <option value="">Do not look for matching records</option>
154 [% FOREACH available_matcher IN available_matchers %]
155 [% IF ( available_matcher.selected ) %]
156 <option value="[% available_matcher.matcher_id %]" selected="selected">
157 [% available_matcher.code %] ([% available_matcher.description %])
160 <option value="[% available_matcher.matcher_id %]">
161 [% available_matcher.code %] ([% available_matcher.description %])
165 </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 ) %]
166 [% current_matcher_code %] ([% current_matcher_description %])
168 No matching rule in effect
172 [% IF ( can_commit ) %]
173 <label for="overlay_action">Action if matching record found:</label>
174 [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
176 <span class="label">Action if matching record found:</span>
177 [% IF ( overlay_action == 'replace' ) %]
178 Replace existing record with incoming record
179 [% ELSIF ( overlay_action == 'create_new' ) %]
181 [% ELSIF ( overlay_action == 'ignore' ) %]
182 Ignore incoming record (its items may still be processed)
189 [% IF ( can_commit ) %]
190 <label for="nomatch_action">Action if no match found:</label>
191 [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
193 <span class="label">Action if no match found:</span>
194 [% IF ( nomatch_action == 'create_new' ) %]
196 [% ELSIF ( nomatch_action == 'ignore' ) %]
197 Ignore incoming record (its items may still be processed)
205 [% IF ( can_commit ) %]
206 <label for="item_action">Item processing:</label>
207 [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
209 <span class="label">Item processing:</span>
210 [% IF ( item_action == 'always_add' ) %]
212 [% ELSIF ( item_action == 'add_only_for_matches' ) %]
213 Add items only if matching bib was found
214 [% ELSIF ( item_action == 'add_only_for_new' ) %]
215 Add items only if no matching bib was found
216 [% ELSIF ( item_action == 'ignore' ) %]
224 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
229 [% IF ( can_commit ) %]
230 <form action="[% script_name %]" method="post">
231 <input type="hidden" name="op" value="commit-batch" />
232 <input type="hidden" name="runinbackground" value="" />
233 <input type="hidden" name="completedJobID" value="" />
234 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
235 <fieldset class="action">
236 <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
238 [% IF ( record_type != 'auth' ) %]
239 Add new bibliographic records into this framework:
240 <select name="framework" id="frameworks">
241 <option value="">Default</option>
242 [% FOREACH framework IN frameworks %]
243 <option value="[% framework.value %]">[% framework.label %]</option>
249 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
250 <div id="jobfailed"></div></div>
252 [% IF ( can_revert ) %]
253 <form action="[% script_name %]" method="post">
254 <input type="hidden" name="op" value="revert-batch" />
255 <input type="hidden" name="runinbackground" value="" />
256 <input type="hidden" name="completedJobID" value="" />
257 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
258 <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
260 <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
261 <div id="jobfailed"></div></div>
264 [% IF ( did_commit ) %]
265 <div class="dialog message">Completed import of records</div>
267 <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
268 <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
269 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
270 <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
271 <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
274 [% IF ( did_revert ) %]
275 <div class="dialog message">Success: Import reversed</div>
277 <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
278 <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
279 <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
280 <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
281 <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
285 <br style="clear:both;" />
287 [% IF ( batch_list ) %]
291 [% FOREACH page IN pages %]
292 [% IF ( page.current_page ) %]
293 <span class="current">[% page.page_number %]</span>
295 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
312 [% FOREACH batch_lis IN batch_list %]
313 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
314 <td>[% batch_lis.import_batch_id %]</td>
315 <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
316 <td>[% batch_lis.comments %]</td>
317 <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
319 [% IF ( batch_lis.import_status == 'cleaned' ) %]
321 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
323 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
325 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
327 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
329 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
332 [% batch_lis.import_status %]
335 <td>[% batch_lis.upload_timestamp %]</td>
336 <td>[% batch_lis.num_records %]</td>
337 <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>
338 <td>[% IF ( batch_lis.can_clean ) %]
339 <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
340 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
341 <input type="hidden" name="op" value="clean-batch" />
342 <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
352 [% FOREACH page IN pages %]
353 [% IF ( page.current_page ) %]
354 <span class="current">[% page.page_number %]</span>
356 <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
363 [% IF ( record_list ) %]
367 [% FOREACH page IN pages %]
368 [% IF ( page.current_page ) %]
369 <span class="current">[% page.page_number %]</span>
371 <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&offset=[% page.offset %]">[% page.page_number %]</a>
385 [% FOREACH record_lis IN record_list %]
386 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
387 <td>[% record_lis.record_sequence %]</td>
388 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% record_lis.import_record_id %]" rel="gb_page_center[600,500]">[% record_lis.citation %]</a></td>
390 [% IF ( record_lis.status == 'imported' ) %]
392 [% ELSIF ( record_lis.status == 'ignored' ) %]
394 [% ELSIF ( record_lis.status == 'reverted' ) %]
397 [% record_lis.status %]
401 [% IF ( record_lis.overlay_status == 'no_match' ) %]
403 [% ELSIF ( record_lis.overlay_status == 'match_applied' ) %]
406 [% record_lis.overlay_status %]
409 <td>[% IF ( record_lis.final_match_id ) %]
410 [% PROCESS final_match_link record=record_lis %]
414 [% PROCESS match_link record=record_lis %]
420 [% FOREACH page IN pages %]
421 [% IF ( page.current_page ) %]
422 <span class="current">[% page.page_number %]</span>
424 <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&offset=[% page.offset %]">[% page.page_number %]</a>
430 [% IF ( batch_info ) %]
431 <div class="dialog alert">There are no records in this batch to import.
432 <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a>.</div>
440 [% INCLUDE 'tools-menu.inc' %]
443 [% INCLUDE 'intranet-bottom.inc' %]