Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tmpl
Owen Leonard 84205212b4 Fix for Bug 5006 - Invalid XHTML in record matching rules template
- Rework JavaScript clone routines to use jQuery, to take
  label "for" into account, to handle incrementing label,
  and to properly place cloned blocks at the bottom of the group
- Rework JavaScript delete routines to use jQuery, to take
  block label numbers into account, and to show the "add"
  link if you have deleted the last block.
- Correcting markup which nests <div> inside <fieldset>
- Ensuring labels' "for" attribute matches input IDs
- Adding "required" style to required fields

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-07 09:57:11 +13:00

694 lines
32 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Administration &rsaquo; Record Matching Rules
<!-- TMPL_IF name="matching_rule_form" -->
<!-- TMPL_IF name="edit_matching_rule" -->
&rsaquo; Modify record matching rule
<!-- TMPL_ELSE -->
&rsaquo; Add record matching rule
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_matching_rule_form" -->
&rsaquo; Confirm deletion of record matching rule &quot;<!-- TMPL_VAR name="code" -->&quot;
<!-- /TMPL_IF -->
</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
//<![CDATA[
var maxMatchPoint = <!-- TMPL_VAR name="max_matchpoint" -->;
var maxMatchCheck = <!-- TMPL_VAR name="max_matchcheck" -->;
function InsertMatchpoint(loc, index) {
var original= $("#"+index);
var clone = original.clone();
clone.show();
// update IDs and form names
maxMatchPoint++;
clone.attr('id', 'mp_' + maxMatchPoint);
$("span.counter",clone).html(maxMatchPoint);
$("label",clone).each(function(){
var s = $(this).attr("for");
if (s.match(/mp_num/)) {
$(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
}
});
$("div",clone).each(function(){
var s = $(this).attr("id");
if (s.match(/mp_num/)) {
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
}
});
$("input",clone).each(function(){
var s = $(this).attr("id");
if(s.match(/mp_num/)){
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
}
var s = $(this).attr("name");
if(s.match(/mp_num/)){
$(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
}
});
$("#match_points").append(clone);
}
function InsertMatchcheck(loc, index) {
var original= $("#"+index);
var clone = original.clone();
clone.show();
// update IDs and form names
maxMatchCheck++;
clone.attr('id', 'mc_' + maxMatchCheck);
$("span.counter",clone).html(maxMatchCheck);
$("label",clone).each(function(){
var s = $(this).attr("for");
if (s.match(/mc_num/)) {
$(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
}
});
$("div",clone).each(function(){
var s = $(this).attr("id");
if (s.match(/mc_num/)) {
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
}
});
$("input",clone).each(function(){
var s = $(this).attr("id");
if(s.match(/mc_num/)){
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
}
var s = $(this).attr("name");
if(s.match(/mc_num/)){
$(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
}
});
$("#match_checks").append(clone);
}
function DeleteMatchpoint(loc) {
$(loc).parent().parent().parent().remove();
if($(".matchgroup",$("#match_points")).length == 0){
maxMatchPoint = 0;
$("#addMatchPoint").show();
}
}
function DeleteMatchcheck(loc) {
$(loc).parent().parent().parent().remove();
if($(".matchgroup",$("#match_checks")).length == 0){
maxMatchCheck = 0;
$("#addMatchCheck").show();
}
}
function DoCancel(f) {
f.op.value='';
document.Aform.submit();
}
function CheckMatchingRuleForm(f) {
var ok=1;
var _alertString="";
var alertString2;
if (f.code.value.length==0) {
_alertString += "\n- " + _("Matching rule code missing");
}
if (f.description.value.length==0) {
_alertString += "\n- " + _("Description missing");
}
if (f.threshold.value.length==0) {
_alertString += "\n- " + _("Threshold missing");
}
if (_alertString.length==0) {
document.Aform.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
alertString2 += _alertString;
alert(alertString2);
}
}
function CheckRuleForm(f) {
var ok=1;
var _alertString="";
var alertString2;
if (f.sort_rule.value.length==0) {
_alertString += "\n- " + _("Filing rule code missing");
}
if (f.description.value.length==0) {
_alertString += "\n- " + _("Description missing");
}
if (f.sort_routine.value.length==0) {
_alertString += "\n- " + _("Sort routine missing");
}
if (_alertString.length==0) {
document.Aform.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
alertString2 += _alertString;
alert(alertString2);
}
}
//]]>
</script>
<style type="text/css">
fieldset.rows fieldset.rows { border-width : 0; }
fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
fieldset, fieldset.rows { width : 90%; padding: .3em .6em .3em .6em; }
fieldset.rows fieldset {font-size:100%;}
div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
</style>
</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> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <!-- TMPL_IF name="display_list" -->Record Matching Rules<!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/matching-rules.pl">Record Matching Rules</a><!-- /TMPL_IF -->
<!-- TMPL_IF name="matching_rule_form" -->
<!-- TMPL_IF name="edit_matching_rule" -->
&rsaquo; Modify record matching rule
<!-- TMPL_ELSE -->
&rsaquo; Add record matching rule
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_matching_rule_form" -->
&rsaquo; Confirm deletion of record matching rule &quot;<!-- TMPL_VAR name="code" -->&quot;
<!-- /TMPL_IF -->
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<!-- TMPL_IF name="matching_rule_form" -->
<!-- TMPL_IF name="edit_matching_rule" -->
<h2>Modify record matching rule</h2>
<!-- TMPL_ELSE -->
<h2>Add record matching rule</h2>
<!-- /TMPL_IF -->
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<fieldset class="rows">
<ol>
<li>
<!-- TMPL_IF name="edit_matching_rule" -->
<span class="label">Matching rule code: </span>
<input type="hidden" name="matcher_id" value="<!-- TMPL_VAR name="matcher_id" -->" />
<input type="hidden" name="code" value="<!-- TMPL_VAR name="code" -->" />
<!-- TMPL_VAR name="code" -->
<!-- TMPL_ELSE -->
<label for="code" class="required">Matching rule code: </label>
<input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
<!-- /TMPL_IF -->
</li>
<li><label for="description" class="required">Description: </label>
<input type="text" id="description" name="description" size="50" maxlength="250"
value="<!-- TMPL_VAR name="description" escape="HTML" -->" /> <span class="required">Required</span>
</li>
<li><label for="threshold" class="required">Match threshold: </label>
<input type="text" id="threshold" name="threshold" size="5" maxlength="5"
value="<!-- TMPL_VAR name="threshold" escape="HTML" -->" /> <span class="required">Required</span>
</li>
</ol>
</fieldset>
<fieldset class="rows" id="match_points">
<h4>Match points</h4>
<!-- TMPL_IF name="edit_matching_rule" -->
<!-- TMPL_IF NAME="matchpoints" --><p id="addMatchPoint" style="display:none;"><!-- TMPL_ELSE --><p id="addMatchPoint"><!-- /TMPL_IF --><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>
<!-- TMPL_ELSE --><p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p><!-- /TMPL_IF -->
<!-- TMPL_IF name="edit_matching_rule" -->
<!-- TMPL_LOOP name="matchpoints" -->
<div id="mp_<!-- TMPL_VAR name="mp_num" -->" class="matchgroup">
<fieldset class="rows">
<legend>Match Point <!-- TMPL_VAR NAME="mp_num" --> | <a href="#" class="button" onclick="InsertMatchpoint('mp_<!-- TMPL_VAR NAME="mp_num" -->', 'mp_template'); return false;">Add match point</a> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
<ol>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_search_index">Search index: </label>
<input type ="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_search_index"
name="mp_<!-- TMPL_VAR name="mp_num" -->_search_index" size="20"
value="<!-- TMPL_VAR name="index" escape="HTML" -->"
maxlength="30" />
</li>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_score">Score: </label>
<input type ="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_score"
name="mp_<!-- TMPL_VAR name="mp_num" -->_score" size="5"
value="<!-- TMPL_VAR name="score" escape="HTML" -->"
maxlength="5" />
</li>
</ol>
<!-- TMPL_LOOP name="components" -->
<fieldset class="rows" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->">
<legend>Matchpoint components</legend>
<ol>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
<input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag"
name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag"
value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
size="3" maxlength="3" />
</li>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
<input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
size="10" maxlength="40" />
</li>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
<input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset"
name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset"
value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<li>
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
<input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length"
name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length"
value="<!-- TMPL_VAR name="length" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<!-- TMPL_LOOP name="norms" -->
<li id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num"-->">
<label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n__<!-- TMPL_VAR name="norm_num"-->_norm">Normalization rule: </label>
<input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n__<!-- TMPL_VAR name="norm_num"-->_norm"
name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num"-->_norm"
value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
size="20" maxlength="50" />
</li>
<!-- /TMPL_LOOP -->
</ol>
</fieldset>
<!-- /TMPL_LOOP -->
</fieldset>
<br style="clear:both;" />
</div>
</fieldset>
<!-- /TMPL_LOOP -->
<!-- TMPL_ELSE -->
<div id="mp_1" class="matchgroup">
<fieldset class="rows">
<legend>Match Point 1 | <a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
<ol>
<li>
<label for="mp_1_search_index">Search index: </label>
<input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20"
maxlength="30" />
</li>
<li>
<label for="mp_1_score">Score: </label>
<input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
</li>
</ol>
<fieldset class="rows" id="mp_1_c_1">
<legend>Matchpoint components</legend>
<ol>
<li>
<label for="mp_1_c_1_tag">Tag: </label>
<input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mp_1_c_1_subfields">Subfields: </label>
<input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mp_1_c_1_offset">Offset: </label>
<input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mp_1_c_1_length">Length: </label>
<input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
</li>
<li id="mp_1_c_1_n_1">
<label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
</fieldset>
<br style="clear:both;" />
</div>
</fieldset>
<!-- /TMPL_IF -->
<fieldset class="rows" id="match_checks">
<h4>Required match checks</h4>
<!-- TMPL_IF name="edit_matching_rule" -->
<!-- TMPL_IF NAME="matchchecks" --><p id="addMatchCheck" style="display:none;"><!-- TMPL_ELSE --><p id="addMatchCheck"><!-- /TMPL_IF --><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
<!-- TMPL_ELSE --><p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p><!-- /TMPL_IF -->
<!-- TMPL_IF name="edit_matching_rule" -->
<!-- TMPL_LOOP name="matchchecks" -->
<fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->">
<legend>Match check <!-- TMPL_VAR NAME="mc_num" --><a href="#" class="button" onclick="InsertMatchcheck('mc_<!-- TMPL_VAR NAME="mc_num" -->', 'mc_template'); return false;">Add match check</a> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
<input type="hidden" id="mc_<!-- TMPL_VAR name="mc_num" -->_id" name="mc_<!-- TMPL_VAR name="mc_num" -->_id" value="1" />
<!-- TMPL_LOOP name="src_components" -->
<fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->">
<legend>Source (incoming) record check field</legend>
<ol>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag"
name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag"
value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
size="3" maxlength="3" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
size="10" maxlength="40" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset"
name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset"
value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length"
name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length"
value="<!-- TMPL_VAR name="length" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<!-- TMPL_LOOP name="norms" -->
<li id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->">
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm">Normalization rule: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm"
name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm"
value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
size="20" maxlength="50" />
</li>
<!-- /TMPL_LOOP -->
</ol>
</fieldset>
<!-- /TMPL_LOOP -->
<!-- TMPL_LOOP name="tgt_components" -->
<fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->">
<legend>Target (database) record check field</legend>
<ol>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag"
name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag"
value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
size="3" maxlength="3" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields"
value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
size="10" maxlength="40" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset"
name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset"
value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<li>
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length"
name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length"
value="<!-- TMPL_VAR name="length" escape="HTML" -->"
size="5" maxlength="5" />
</li>
<!-- TMPL_LOOP name="norms" -->
<li id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->">
<label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm">Normalization rule: </label>
<input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm"
name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm"
value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
size="20" maxlength="50" />
</li>
<!-- /TMPL_LOOP -->
</ol>
</fieldset>
<!-- /TMPL_LOOP -->
</fieldset>
<!-- /TMPL_LOOP -->
<!-- TMPL_ELSE -->
<div id="mc_1" class="matchgroup">
<fieldset class="rows">
<legend>Match check 1 | <a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
<input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
<fieldset class="rows" id="mc_1_src_c_1">
<legend>Source (incoming) record check field</legend>
<ol>
<li>
<label for="mc_1_src_c_1_tag">Tag: </label>
<input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mc_1_src_c_1_subfields">Subfields: </label>
<input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mc_1_src_c_1_offset">Offset: </label>
<input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mc_1_src_c_1_length">Length: </label>
<input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
</li>
<li id="mc_1_src_c_1_n_1">
<label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
<fieldset class="rows" id="mc_1_tgt_c_1">
<legend>Target (database) record check field</legend>
<ol>
<li>
<label for="mc_1_tgt_c_1_tag">Tag: </label>
<input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mc_1_tgt_c_1_subfields">Subfields: </label>
<input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mc_1_tgt_c_1_offset">Offset: </label>
<input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mc_1_tgt_c_1_length">Length: </label>
<input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
</li>
<li id="mc_1_tgt_c_1_n_1">
<label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
</fieldset>
<br style="clear:both;" />
</div>
<!-- /TMPL_IF -->
</fieldset>
<fieldset class="action">
<!-- TMPL_IF name="edit_matching_rule" -->
<input type="button" value="Save"
onclick="CheckMatchingRuleForm(this.form)" />
<!-- TMPL_ELSE -->
<input type="button" value="Save"
onclick="CheckMatchingRuleForm(this.form)" />
<!-- /TMPL_IF-->
<a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
</fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_matching_rule_form" -->
<div class="dialog alert"><h3>Confirm deletion of record matching rule <span class="ex">'<!-- TMPL_VAR name="code" -->' (<!-- TMPL_VAR name="description" -->)</span>?</h3>
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<input type="hidden" name="matcher_id" value="<!-- TMPL_VAR name="matcher_id" -->" />
<input type="submit" value="Delete record matching rule" class="approve" /></form>
<form action="<!-- TMPL_VAR name="script_name" -->" method="get">
<input type="submit" value="No, Do Not Delete" class="deny" />
</form></div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="display_list" -->
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
// prepare DOM for YUI Toolbar
$(document).ready(function() {
yuiToolbar();
});
// YUI Toolbar Functions
function yuiToolbar() {
new YAHOO.widget.Button("newrule");
} //]]>
</script>
<ul class="toolbar">
<li><a id="newrule" href="<!-- TMPL_VAR name="script_name" -->?op=add_matching_rule">New Record Matching Rule</a></li>
</ul></div>
<h2>Record Matching Rules</h2>
<!-- TMPL_IF name="added_matching_rule" -->
<div class="dialog message">Added record matching rule &quot;<!-- TMPL_VAR name="added_matching_rule" -->&quot;</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="edited_matching_rule" -->
<div class="dialog message">Modified record matching rule &quot;<!-- TMPL_VAR name="edited_matching_rule" -->&quot;</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="deleted_matching_rule" -->
<div class="dialog message">Deleted record matching rule &quot;<!-- TMPL_VAR name="deleted_matching_rule" -->&quot;</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="available_matching_rules" --><table>
<tr>
<th>#</th>
<th>Code</th>
<th>Description</th>
<th>Actions</th>
</tr>
<!-- TMPL_LOOP name="available_matching_rules" -->
<tr>
<td><!-- TMPL_VAR name="matcher_id" --></td>
<td><!-- TMPL_VAR name="code" --></td>
<td><!-- TMPL_VAR name="description" --></td>
<td>
<a href="<!-- TMPL_VAR name="script_name" -->?op=edit_matching_rule&amp;matcher_id=<!-- TMPL_VAR name="matcher_id" escape="HTML" -->">Edit</a>
<a href="<!-- TMPL_VAR name="script_name" -->?op=delete_matching_rule&amp;matcher_id=<!-- TMPL_VAR name="matcher_id" escape="HTML" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
</table><!-- TMPL_ELSE --><p>There are no saved matching rules.</p><!-- /TMPL_IF -->
<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="matching_rule_form" -->
<div id="mp_template" class="matchgroup" style="display:none;">
<fieldset class="rows">
<legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
<ol>
<li>
<label for="mp_num_search_index">Search index: </label>
<input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20"
maxlength="30" />
</li>
<li>
<label for="mp_num_score">Score: </label>
<input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
</li>
</ol>
<fieldset id="mp_num_c_1" class="rows">
<legend>Matchpoint components</legend>
<ol>
<li>
<label for="mp_num_c_1_tag">Tag: </label>
<input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mp_num_c_1_subfields">Subfields: </label>
<input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mp_num_c_1_offset">Offset: </label>
<input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mp_num_c_1_length">Length: </label>
<input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
</li>
<li id="mp_num_c_1_n_1">
<label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
</fieldset>
<br style="clear:both;" />
</div>
<div id="mc_template" class="matchgroup" style="display:none">
<fieldset class="rows">
<legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
<input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
<fieldset class="rows" id="mc_num_src_c_1">
<legend>Source (incoming) record check field</legend>
<ol>
<li>
<label for="mc_num_src_c_1_tag">Tag: </label>
<input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mc_num_src_c_1_subfields">Subfields: </label>
<input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mc_num_src_c_1_offset">Offset: </label>
<input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mc_num_src_c_1_length">Length: </label>
<input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
</li>
<li id="mc_num_src_c_1_n_1">
<label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
<fieldset class="rows" id="mc_num_tgt_c_1">
<legend>Target (database) record check field</legend>
<ol>
<li>
<label for="mc_num_tgt_c_1_tag">Tag: </label>
<input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
</li>
<li>
<label for="mc_num_tgt_c_1_subfields">Subfields: </label>
<input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
</li>
<li>
<label for="mc_num_tgt_c_1_offset">Offset: </label>
<input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
</li>
<li>
<label for="mc_num_tgt_c_1_length">Length: </label>
<input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
</li>
<li id="mc_num_tgt_c_1_n_1">
<label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
<input type="text" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" size="20" maxlength="50" />
</li>
</ol>
</fieldset>
</fieldset>
<br style="clear:both;" />
</div>
<!-- /TMPL_IF -->
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->