438ed23337
Enhanced the ability of catalogers to specify how bib and item records should be added, replaced, or ignored during a staging import. When an import batch of bib records is staged and commit, the user can now explicitly specify what should occur when an incoming bib record has, or does not have, a match with a record already in the database. The options are: if match found (overlay_action): create_new (just add the incoming record) replace (replace the matched record with the incoming one) use_template (option not implemented) ignore (do nothing with the incoming bib; however, the items attached to it may still be processed based on the item action) if no match is found (nomatch_action): create_new (just add the incoming record) ignore (do nothing with the incoming bib; in this case, any items attached to it will be ignored since there will be nothing to attach them to) The following options for handling items embedded in the bib record are now available: always_add (add the items to the new or replaced bib) add_only_if_match (add the items only if the incoming bib matches an existing bib) add_only_if_add (add the items only if the incoming bib does *not* match an existing bib) ignore (ignore the items entirely) With these changes, it is now possible to support the following use cases: [1] A library joining an existing Koha database wishes to add their items to existing bib records if they match, but does not want to overlay the bib records themselves. [2] A library wants to load a file of records, but only handle the new ones, not ones that are already in the database. [3] A library wants to load a file of records, but only handle the ones that match existing records (e.g., if the records are coming back from an authority control vendor). Documentation changes: * See description above; also, screenshots of the 'stage MARC records for import' and 'manage staged MARC records' should be updated. Test cases: * Added test cases to exercise staging and committing import batches. UI changes: * The pages for staging and managing import batches now have controls for setting the overlay action, action if no match, and item action separately. * in the manage import batch tool, user is notified when they change overlay action, no-match action, and item action * HTML for manage import batch tool now uses fieldsets Database changes (DB rev 076): * added import_batches.item_action * added import_batches.nomatch_action * added 'ignore' as a valid value for import_batches.overlay_action * added 'ignored' as a valid value for import_records.status * added 'status' as a valid value for import_items.status API changes: * new accessor routines for C4::ImportBatch GetImportBatchNoMatchAction SetImportBatchNoMatchAction GetImportBatchItemAction SetImportBatchItemAction * new internal functions for C4::ImportBatch to determine how a given bib and item are to be processed, based on overlay_action, nomatch_action, and item_action: _get_commit_action _get_revert_action Signed-off-by: Joshua Ferraro <jmf@liblime.com>
270 lines
11 KiB
Cheetah
270 lines
11 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
|
<title>Koha › Tools › Manage Staged MARC Records
|
|
<!-- TMPL_IF name="import_batch_id" -->
|
|
› Batch <!-- TMPL_VAR name="import_batch_id" -->
|
|
<!-- /TMPL_IF -->
|
|
</title>
|
|
<!-- TMPL_INCLUDE NAME="greybox.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="background-job.inc" -->
|
|
</head>
|
|
<body>
|
|
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
|
|
<!-- TMPL_IF name="import_batch_id" -->
|
|
›
|
|
<a href="<!-- TMPL_VAR name="script_name"-->">Manage Staged MARC Records</a>
|
|
› Batch <!-- TMPL_VAR name="import_batch_id" -->
|
|
<!-- TMPL_ELSE -->
|
|
› Manage Staged MARC Records
|
|
<!-- /TMPL_IF -->
|
|
</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
<h1>Manage Staged MARC Records
|
|
<!-- TMPL_IF name="import_batch_id" -->
|
|
› Batch <!-- TMPL_VAR name="import_batch_id" -->
|
|
<!-- /TMPL_IF -->
|
|
</h1>
|
|
<!-- TMPL_IF name="label_batch" -->
|
|
<div class="alert">
|
|
<p>Label batch created, with id: <!-- TMPL_VAR name="label_batch" --> </p>
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="batch_info" -->
|
|
<fieldset class="rows">
|
|
<ul>
|
|
<li><label>File name</label> <!-- TMPL_VAR name="file_name" --></li>
|
|
<li><label>Comments</label> <!-- TMPL_VAR name="comments" --></li>
|
|
<li><label>Staged</label> <!-- TMPL_VAR name="upload_timestamp" --></li>
|
|
<li><label>Status</label> <!-- TMPL_VAR name="import_status" --></li>
|
|
<li><label>Matching rule applied</label>
|
|
<!-- TMPL_IF name="current_matcher_id" -->
|
|
<!-- TMPL_VAR name="current_matcher_code" --> (<!-- TMPL_VAR name="current_matcher_description" -->)
|
|
<!-- TMPL_ELSE -->
|
|
No matching rule in effect
|
|
<!-- /TMPL_IF -->
|
|
</li>
|
|
<li><label>Action if matching record found</label> <!-- TMPL_VAR NAME="overlay_action" --></li>
|
|
<li><label>Action if no match found</label> <!-- TMPL_VAR NAME="nomatch_action" --></li>
|
|
<li><label>Item processing</label> <!-- TMPL_VAR NAME="item_action" --></li>
|
|
</ul>
|
|
</fieldset>
|
|
<!-- TMPL_IF name="can_commit" -->
|
|
<div>
|
|
<fieldset class="rows">
|
|
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="redo-matching" />
|
|
<input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
|
|
<input type="hidden" name="current_matcher_id" value="<!-- TMPL_VAR name="current_matcher_id" -->" />
|
|
<ul>
|
|
<li><label for name="new_matcher_id">New matching rule</label>
|
|
<select name="new_matcher_id" id="new_matcher_id">
|
|
<option value="">Do not look for matching records</option>
|
|
<!-- TMPL_LOOP name="available_matchers" -->
|
|
<!-- TMPL_IF name="selected" -->
|
|
<option value="<!-- TMPL_VAR name="matcher_id" -->" selected="selected">
|
|
<!-- TMPL_VAR name="code" --> (<!-- TMPL_VAR name="description" -->)
|
|
</option>
|
|
<!-- TMPL_ELSE -->
|
|
<option value="<!-- TMPL_VAR name="matcher_id" -->">
|
|
<!-- TMPL_VAR name="code" --> (<!-- TMPL_VAR name="description" -->)
|
|
</option>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</select>
|
|
</li>
|
|
<li><label for="overlay_action">Action if matching record found</label>
|
|
<!-- TMPL_INCLUDE NAME="tools-overlay-action.inc" -->
|
|
</li>
|
|
<li><label for="overlay_action">Action if no match found</label>
|
|
<!-- TMPL_INCLUDE NAME="tools-nomatch-action.inc" -->
|
|
</li>
|
|
<li><label for="overlay_action">Item processing</label>
|
|
<!-- TMPL_INCLUDE NAME="tools-item-action.inc" -->
|
|
</li>
|
|
</ul>
|
|
<input type="submit" class="button" value="Apply different matching rule" />
|
|
</form>
|
|
<!-- TMPL_IF name="rematch_attempted" -->
|
|
<!-- TMPL_IF name="rematch_failed" -->
|
|
<p><span class="problem">Failed to apply different matching rule</span></p>
|
|
<!-- TMPL_ELSE -->
|
|
<p><span class="problem">Applied different matching rule. Number of records matched now
|
|
<!-- TMPL_VAR name="num_with_matches" -->
|
|
</span></p>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="changed_overlay_action" -->
|
|
<p><span class="problem">Changed action if matching record found</span></p>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="changed_nomatch_action" -->
|
|
<p><span class="problem">Changed action if no match found</span></p>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="changed_item_action" -->
|
|
<p><span class="problem">Changed item processing option</span></p>
|
|
<!-- /TMPL_IF -->
|
|
</fieldset>
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<div>
|
|
<fieldset class="rows">
|
|
<!-- TMPL_IF name="can_commit" -->
|
|
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="commit-batch" />
|
|
<input type="hidden" name="runinbackground" value="" />
|
|
<input type="hidden" name="completedJobID" value="" />
|
|
<input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
|
|
<input type="submit" class="button" name="mainformsubmit" value="Complete import" onclick="return submitBackgroundJob(this.form);" />
|
|
</form>
|
|
<div id="jobstatus" style="display:none">Job progress: <span id="jobprogress">0</span>%</div>
|
|
<div id="jobfailed" style="display:none"></div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="can_revert" -->
|
|
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="revert-batch" />
|
|
<input type="hidden" name="runinbackground" value="" />
|
|
<input type="hidden" name="completedJobID" value="" />
|
|
<input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
|
|
<input type="submit" class="button" name="mainformsubmit" value="Undo import" onclick="return submitBackgroundJob(this.form);" />
|
|
</form>
|
|
<div id="jobstatus" style="display:none">Job progress: <span id="jobprogress">0</span>%</div>
|
|
<div id="jobfailed" style="display:none"></div>
|
|
<!-- /TMPL_IF -->
|
|
</fieldset>
|
|
</div>
|
|
<!-- TMPL_IF name="did_commit" -->
|
|
<p><span class="problem">Completed import of records</span></p>
|
|
<table>
|
|
<tr><td>Number of records added</td><td><!-- TMPL_VAR name="num_added" --></td></tr>
|
|
<tr><td>Number of records updated</td><td><!-- TMPL_VAR name="num_updated" --></td></tr>
|
|
<tr><td>Number of records ignored</td><td><!-- TMPL_VAR name="num_ignored" --></td></tr>
|
|
<tr><td>Number of items added</td><td><!-- TMPL_VAR name="num_items_added" --></td></tr>
|
|
<tr><td>Number of items ignored because of duplicate barcode</td><td><!-- TMPL_VAR name="num_items_errored" --></td></tr>
|
|
</table>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="did_revert" -->
|
|
<p><span class="problem">Undid import of records</span></p>
|
|
<table>
|
|
<tr><td>Number of records deleted</td><td><!-- TMPL_VAR name="num_deleted" --></td></tr>
|
|
<tr><td>Number of items deleted</td><td><!-- TMPL_VAR name="num_items_deleted" --></td></tr>
|
|
<tr><td>Number of records not deleted due to items on loan</td><td><!-- TMPL_VAR name="num_errors" --></td></tr>
|
|
<tr><td>Number of records changed back</td><td><!-- TMPL_VAR name="num_reverted" --></td></tr>
|
|
<tr><td>Number of records ignored</td><td><!-- TMPL_VAR name="num_ignored" --></td></tr>
|
|
</table>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
<br />
|
|
|
|
<!-- TMPL_IF name="batch_list" -->
|
|
<!-- TMPL_IF name="pages" -->
|
|
<div class="pages">
|
|
Page
|
|
<!-- TMPL_LOOP name="pages" -->
|
|
<!-- TMPL_IF name="current_page" -->
|
|
<span class="current"><!-- TMPL_VAR name="page_number" --></span>
|
|
<!-- TMPL_ELSE -->
|
|
<a class="nav" href="<!-- TMPL_VAR name="script_name" -->?offset=<!-- TMPL_VAR name="offset" -->"><!-- TMPL_VAR name="page_number" --></a>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<table>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>File name</th>
|
|
<th>Comments</th>
|
|
<th>Status</th>
|
|
<th>Staged</th>
|
|
<th># Bibs</th>
|
|
<th># Items</th>
|
|
</tr>
|
|
<!-- TMPL_LOOP name="batch_list" -->
|
|
<tr>
|
|
<td><a href="<!-- TMPL_VAR name="script_name" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->"><!-- TMPL_VAR name="import_batch_id" --></a></td>
|
|
<td><!-- TMPL_VAR name="file_name" --></td>
|
|
<td><!-- TMPL_VAR name="comments" --></td>
|
|
<td><!-- TMPL_VAR name="import_status" --></td>
|
|
<td><!-- TMPL_VAR name="upload_timestamp" --></td>
|
|
<td><!-- TMPL_VAR name="num_biblios" --></td>
|
|
<td><!-- TMPL_VAR name="num_items" --><!-- TMPL_IF NAME="num_items" --><a href="<!-- TMPL_VAR name="script_name" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->&op=create_labels">(Create Label Batch)</a><!-- /TMPL_IF --></td>
|
|
</tr>
|
|
<!-- /TMPL_LOOP -->
|
|
</table>
|
|
<!-- TMPL_IF name="pages" -->
|
|
<div class="pages">
|
|
Page
|
|
<!-- TMPL_LOOP name="pages" -->
|
|
<!-- TMPL_IF name="current_page" -->
|
|
<span class="current"><!-- TMPL_VAR name="page_number" --></span>
|
|
<!-- TMPL_ELSE -->
|
|
<a class="nav" href="<!-- TMPL_VAR name="script_name" -->?offset=<!-- TMPL_VAR name="offset" -->"><!-- TMPL_VAR name="page_number" --></a>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- TMPL_IF name="biblio_list" -->
|
|
<!-- TMPL_IF name="pages" -->
|
|
<div class="pages">
|
|
Page
|
|
<!-- TMPL_LOOP name="pages" -->
|
|
<!-- TMPL_IF name="current_page" -->
|
|
<span class="current"><!-- TMPL_VAR name="page_number" --></span>
|
|
<!-- TMPL_ELSE -->
|
|
<a class="nav" href="<!-- TMPL_VAR name="script_name" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->&offset=<!-- TMPL_VAR name="offset" -->"><!-- TMPL_VAR name="page_number" --></a>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<table>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Citation</th>
|
|
<th>Status</th>
|
|
<th>Overlay?</th>
|
|
</tr>
|
|
<!-- TMPL_LOOP name="biblio_list" -->
|
|
<tr>
|
|
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR name='import_record_id' -->" rel="gb_page_center[600,500]"><!-- TMPL_VAR name="record_sequence"--></a></td>
|
|
<td><!-- TMPL_VAR name="citation"--></td>
|
|
<td><!-- TMPL_VAR name="status"--></td>
|
|
<td><!-- TMPL_VAR name="overlay_status"--></td>
|
|
</tr>
|
|
<!-- TMPL_IF name="match_biblionumber" -->
|
|
<tr>
|
|
<td />
|
|
<td class="highlight" colspan="3">Matches biblio <!-- TMPL_VAR name="match_biblionumber" --> (score = <!-- TMPL_VAR name="match_score" -->): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="match_biblionumber" -->"><!-- TMPL_VAR name="match_citation" --></a></td>
|
|
</tr>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</table>
|
|
<!-- TMPL_IF name="pages" -->
|
|
<div class="pages">
|
|
Page
|
|
<!-- TMPL_LOOP name="pages" -->
|
|
<!-- TMPL_IF name="current_page" -->
|
|
<span class="current"><!-- TMPL_VAR name="page_number" --></span>
|
|
<!-- TMPL_ELSE -->
|
|
<a class="nav" href="<!-- TMPL_VAR name="script_name" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->&offset=<!-- TMPL_VAR name="offset" -->"><!-- TMPL_VAR name="page_number" --></a>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b noprint">
|
|
<!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
|
|
</div>
|
|
</div>
|
|
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|