|
Line 0
Link Here
|
| 0 |
- |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
|
|
2 |
<title>Koha › Cataloging › Deduplicator</title> |
| 3 |
[% INCLUDE 'greybox.inc' %] |
| 4 |
[% INCLUDE 'doc-head-close.inc' %] |
| 5 |
<style type="text/css"> |
| 6 |
/* Prevent floating the main form */ |
| 7 |
fieldset.rows { float:none; } |
| 8 |
.mergeReference { color: #161; font-weight: bold; } |
| 9 |
.cell {float: left;} |
| 10 |
</style> |
| 11 |
<script type="text/javascript"> |
| 12 |
//<![CDATA[ |
| 13 |
|
| 14 |
function updateMergereference(self) { |
| 15 |
var matchContainer = $(self).parents(".matchContainer"); |
| 16 |
var checkboxes = $(matchContainer).find('input[id^="checkbox"]'); |
| 17 |
var mergeReferenceInput = $(matchContainer).parents("form").children("input.mergeReference"); |
| 18 |
var checkedBoxes = 0; |
| 19 |
$(checkboxes).each(function() { |
| 20 |
if($(this).attr('checked') === 'checked' ) { |
| 21 |
checkedBoxes++; |
| 22 |
} |
| 23 |
}); |
| 24 |
|
| 25 |
if (checkedBoxes == 1 && $(self).attr('checked') === 'checked') { |
| 26 |
$(self).parent().find("span.matchDescription").addClass('mergeReference'); |
| 27 |
$(mergeReferenceInput).val( $(self).val() ); //Save the biblionumber as the mergereference |
| 28 |
} |
| 29 |
else if (checkedBoxes == 0) { |
| 30 |
$(matchContainer).find("span.matchDescription").removeClass('mergeReference'); |
| 31 |
$(mergeReferenceInput).val( 0 ); |
| 32 |
} |
| 33 |
|
| 34 |
return 1; |
| 35 |
} |
| 36 |
//]]> |
| 37 |
</script> |
| 38 |
</head> |
| 39 |
<body id="deduplicator"> |
| 40 |
[% INCLUDE 'header.inc' %] |
| 41 |
[% INCLUDE 'cataloging-search.inc' %] |
| 42 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › Deduplicator</div> |
| 43 |
|
| 44 |
<div id="doc" class="yui-t7"> |
| 45 |
<div id="bd"> |
| 46 |
<div id="yui-main"> |
| 47 |
|
| 48 |
|
| 49 |
<h1>Deduplicator</h1> |
| 50 |
|
| 51 |
<div id="deduplicatorForm"> |
| 52 |
<form name="deduplicationForm" action="/cgi-bin/koha/cataloguing/deduplicator.pl" method="post"> |
| 53 |
<input type="hidden" name="op" value="deduplicate"/> |
| 54 |
<fieldset class="rows"> |
| 55 |
<legend>Configure the deduplication search!</legend> |
| 56 |
<ol> |
| 57 |
<li> |
| 58 |
<label>Limit</label><input type="number" name="limit" value="[% limit %]"/><i>How many bibliographic records to deduplicate? Hint: less than 1000.</i> |
| 59 |
</li> |
| 60 |
<li> |
| 61 |
<label>Offset</label><input type="number" name="offset" value="[% offset %]"/><i>From which bibliographic record to start? Hint: increment this by the limit of previous deduplication run. If limit = 200, then first offset is 0, then 200, then 400...</i> |
| 62 |
</li> |
| 63 |
<li> |
| 64 |
<label>Matcher</label> |
| 65 |
<select name="matcher_id" size="1" id="matchers"> |
| 66 |
[% FOREACH matcher IN matchers %] |
| 67 |
[% IF ( matcher.selected ) %] |
| 68 |
<option value="[% matcher.matcher_id %]" selected="selected">[% matcher.code %] - [% matcher.description %]</option> |
| 69 |
[% ELSE %] |
| 70 |
<option value="[% matcher.matcher_id %]">[% matcher.code %] - [% matcher.description %]</option> |
| 71 |
[% END %] |
| 72 |
[% END %] |
| 73 |
</select> |
| 74 |
<i>The matcher to use to find duplicates. Hint: one can define matchers from the administration menu.</i> |
| 75 |
</li> |
| 76 |
<li> |
| 77 |
<input type="submit" value="Deduplicate!"/> |
| 78 |
</li> |
| 79 |
</ol> |
| 80 |
</fieldset> |
| 81 |
</form> |
| 82 |
</div> |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
[% IF duplicates %] |
| 87 |
<div id="duplicatesContainer"> |
| 88 |
<fieldset class="rows"> |
| 89 |
<legend> |
| 90 |
List of duplicates |
| 91 |
</legend> |
| 92 |
|
| 93 |
<label>Matches - Score</label> |
| 94 |
<label>Title</label> |
| 95 |
<label>Author</label> |
| 96 |
<label>Merge</label> |
| 97 |
|
| 98 |
<ol> |
| 99 |
[% FOREACH duplicate IN duplicates %] |
| 100 |
<form name="form[% duplicate.biblionumber %]" action="/cgi-bin/koha/cataloguing/merge.pl" method="post"> |
| 101 |
<input type="hidden" class="mergeReference" name="mergereference" value=""/> |
| 102 |
<li> |
| 103 |
<div class="cell"> |
| 104 |
<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% duplicate.biblionumber %]">[% duplicate.biblionumber %]</a> |
| 105 |
<div class="matchContainer"> |
| 106 |
[% FOREACH match IN duplicate.matches %] |
| 107 |
<div> |
| 108 |
<input id="checkbox[% match.record_id %]" name="biblionumber" value="[% match.record_id %]" type="checkbox" onclick="updateMergereference(this)"/> |
| 109 |
<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% match.record_id %]"> |
| 110 |
<span class="matchDescription"> |
| 111 |
[% match.record_id %] - <i>[% match.score %]</i> |
| 112 |
</span> |
| 113 |
</a> |
| 114 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% match.record_id %]"> |
| 115 |
[[% match.itemsCount %]] |
| 116 |
</a> |
| 117 |
</div> |
| 118 |
[% END %] |
| 119 |
</div> |
| 120 |
</div> |
| 121 |
<div class="cell">[% duplicate.title %]</div> |
| 122 |
<div class="cell">[% duplicate.author %]</div> |
| 123 |
<div class="cell"><input type="submit" value="Merge!"/></div> |
| 124 |
</li> |
| 125 |
</form> |
| 126 |
[% END %] |
| 127 |
</ol> |
| 128 |
</fieldset> |
| 129 |
</div><!--<div id="duplicatesContainer">%--> |
| 130 |
[% END %] |
| 131 |
</div> |
| 132 |
</div> <!--EO <div id="bd"> --> |
| 133 |
|
| 134 |
|
| 135 |
[% INCLUDE 'intranet-bottom.inc' %] |