4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Record matching rules
6 [% IF ( matching_rule_form ) %]
7 [% IF ( edit_matching_rule ) %]
8 › Modify record matching rule
10 › Add record matching rule
13 [% IF ( delete_matching_rule_form ) %]
14 › Confirm deletion of record matching rule "[% code | html %]"
17 [% INCLUDE 'doc-head-close.inc' %]
19 [% BLOCK norms_text %]
22 [% CASE 'remove_spaces' %]Remove spaces
23 [% CASE 'upper_case' %]Uppercase
24 [% CASE 'lower_case' %]Lowercase
25 [% CASE 'legacy_default' %]Legacy default
26 [% CASE %][% norm | html %]
30 [% BLOCK norms_options %]
31 [%# PARAMS: selected_norm %]
32 [% FOREACH norm IN valid_norms %]
33 [% IF ( norm == selected_norm ) %]
34 <option value="[% norm | html %]" selected="selected">[% PROCESS norms_text norm=norm %]</option>
36 <option value="[% norm | html %]">[% PROCESS norms_text norm=norm %]</option>
41 [% BLOCK norms_select %]
42 [%# PARAMS: selected_norm, id, name %]
43 [% UNLESS valid_norms.grep(selected_norm).size %]
44 [%# Fallback to 'none' %]
45 [% selected_norm = 'none' | html %]
47 <select id="[% id | html %]" name="[% name | html %]">
48 [% PROCESS norms_options selected_norm=selected_norm %]
52 <style type="text/css">
53 fieldset.rows fieldset.rows { border-width : 0; }
54 fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
55 fieldset, fieldset.rows { width : 90%; padding: .3em .6em .3em .6em; }
56 fieldset.rows fieldset {font-size:100%;}
57 div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
60 <body id="admin_matching-rules" class="admin">
61 [% INCLUDE 'header.inc' %]
62 [% INCLUDE 'prefs-admin-search.inc' %]
64 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( display_list ) %]Record matching rules[% ELSE %]<a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>[% END %]
65 [% IF ( matching_rule_form ) %]
66 [% IF ( edit_matching_rule ) %]
67 › Modify record matching rule
69 › Add record matching rule
72 [% IF ( delete_matching_rule_form ) %]
73 › Confirm deletion of record matching rule "[% code | html %]"
77 <div id="doc3" class="yui-t2">
83 [% IF ( matching_rule_form ) %]
84 [% IF ( edit_matching_rule ) %]
85 <h2>Modify record matching rule</h2>
87 <h2>Add record matching rule</h2>
89 <form action="[% script_name | html %]" name="Aform" method="post">
90 <input type="hidden" name="op" value="[% confirm_op | html %]" />
91 <fieldset class="rows">
94 [% IF ( edit_matching_rule ) %]
95 <span class="label">Matching rule code: </span>
96 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
97 <input type="hidden" name="code" value="[% code | html %]" />
100 <label for="code" class="required">Matching rule code: </label>
101 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
104 <li><label for="description" class="required">Description: </label>
105 <input type="text" id="description" name="description" size="50" maxlength="250"
106 value="[% description | html %]" /> <span class="required">Required</span>
108 <li><label for="threshold" class="required">Match threshold: </label>
109 <input type="text" id="threshold" name="threshold" size="5" maxlength="5"
110 value="[% threshold | html %]" /> <span class="required">Required</span>
112 <li><label for="record_type" class="required">Record type: </label>
113 <select id="record_type" name="record_type">
114 [% IF ( record_type == "authority" ) %]
115 <option value="biblio">Bibliographic record</option>
116 <option value="authority" selected="selected">Authority record</option>
118 <option value="biblio" selected="selected">Bibliographic record</option>
119 <option value="authority">Authority record</option>
121 </select><span class="required">Required</span>
126 <fieldset class="rows" id="match_points">
127 <h4>Match points</h4>
128 [% IF ( edit_matching_rule ) %]
129 [% IF ( matchpoints ) %]<p id="addMatchPoint" style="display:none;">[% ELSE %]<p id="addMatchPoint">[% END %]<a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>
130 [% ELSE %]<p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>[% END %]
131 [% IF ( edit_matching_rule ) %]
132 [% FOREACH matchpoint IN matchpoints %]
133 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
134 <fieldset class="rows">
135 <legend>Match point [% matchpoint.mp_num | html %] | <a href="#" class="button" onclick="InsertMatchpoint('mp_[% matchpoint.mp_num | html %]', 'mp_template'); return false;">Add match point</a> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
138 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
139 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_search_index"
140 name="mp_[% matchpoint.mp_num | html %]_search_index" size="20"
141 value="[% matchpoint.index | html %]"
145 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
146 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_score"
147 name="mp_[% matchpoint.mp_num | html %]_score" size="5"
148 value="[% matchpoint.score | html %]"
152 [% FOREACH component IN matchpoint.components %]
153 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
154 <legend>Matchpoint components</legend>
157 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
158 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag"
159 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag"
160 value="[% component.tag | html %]"
161 size="3" maxlength="3" />
164 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
165 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields"
166 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields"
167 value="[% component.subfields | html %]"
168 size="10" maxlength="40" />
171 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
172 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset"
173 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset"
174 value="[% component.offset | html %]"
175 size="5" maxlength="5" />
178 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
179 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length"
180 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length"
181 value="[% component.length | html %]"
182 size="5" maxlength="5" />
184 [% FOREACH norm IN component.norms %]
185 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
186 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
187 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
188 [% PROCESS norms_select selected_norm=norm.norm id="mp_${norm.mp_num}_c_${component.comp_num}_n__${norm.norm_num}_norm" name="mp_${matchpoint.mp_num}_c_${component.comp_num}_n_${norm.norm_num}_norm" %]
195 <br style="clear:both;" />
201 <div id="mp_1" class="matchgroup">
202 <fieldset class="rows">
203 <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>
206 <label for="mp_1_search_index">Search index: </label>
207 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20"
211 <label for="mp_1_score">Score: </label>
212 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
215 <fieldset class="rows" id="mp_1_c_1">
216 <legend>Matchpoint components</legend>
219 <label for="mp_1_c_1_tag">Tag: </label>
220 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
223 <label for="mp_1_c_1_subfields">Subfields: </label>
224 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
227 <label for="mp_1_c_1_offset">Offset: </label>
228 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
231 <label for="mp_1_c_1_length">Length: </label>
232 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
234 <li id="mp_1_c_1_n_1">
235 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
236 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
241 <br style="clear:both;" />
247 <fieldset class="rows" id="match_checks">
248 <h4>Required match checks</h4>
249 [% IF ( edit_matching_rule ) %]
250 [% IF ( matchchecks ) %]<p id="addMatchCheck" style="display:none;">[% ELSE %]<p id="addMatchCheck">[% END %]<a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
251 [% ELSE %]<p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>[% END %]
252 [% IF ( edit_matching_rule ) %]
253 [% FOREACH matchcheck IN matchchecks %]
254 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
255 <fieldset class="rows">
256 <legend>Match check [% matchcheck.mc_num | html %]<a href="#" class="button" onclick="InsertMatchcheck('mc_[% matchcheck.mc_num | html %]', 'mc_template'); return false;">Add match check</a> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
257 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
258 [% FOREACH src_component IN matchcheck.src_components %]
259 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
260 <legend>Source (incoming) record check field</legend>
263 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
264 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag"
265 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag"
266 value="[% src_component.tag | html %]"
267 size="3" maxlength="3" />
270 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
271 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields"
272 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields"
273 value="[% src_component.subfields | html %]"
274 size="10" maxlength="40" />
277 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
278 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset"
279 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset"
280 value="[% src_component.offset | html %]"
281 size="5" maxlength="5" />
284 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length">Length: </label>
285 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length"
286 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length"
287 value="[% src_component.length | html %]"
288 size="5" maxlength="5" />
290 [% FOREACH norm IN src_component.norms %]
291 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
292 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
293 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
294 [% PROCESS norms_select selected_norm=norm.norm id="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" name="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" %]
300 [% FOREACH tgt_component IN matchcheck.tgt_components %]
301 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
302 <legend>Target (database) record check field</legend>
305 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
306 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag"
307 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag"
308 value="[% tgt_component.tag | html %]"
309 size="3" maxlength="3" />
312 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
313 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields"
314 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields"
315 value="[% tgt_component.subfields | html %]"
316 size="10" maxlength="40" />
319 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
320 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset"
321 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset"
322 value="[% tgt_component.offset | html %]"
323 size="5" maxlength="5" />
326 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
327 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length"
328 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length"
329 value="[% tgt_component.length | html %]"
330 size="5" maxlength="5" />
332 [% FOREACH norm IN tgt_component.norms %]
333 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
334 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
335 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
336 [% PROCESS norms_select selected_norm=norm.norm id="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" name="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" %]
343 <br style="clear:both;" />
347 <div id="mc_1" class="matchgroup">
348 <fieldset class="rows">
349 <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>
350 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
351 <fieldset class="rows" id="mc_1_src_c_1">
352 <legend>Source (incoming) record check field</legend>
355 <label for="mc_1_src_c_1_tag">Tag: </label>
356 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
359 <label for="mc_1_src_c_1_subfields">Subfields: </label>
360 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
363 <label for="mc_1_src_c_1_offset">Offset: </label>
364 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
367 <label for="mc_1_src_c_1_length">Length: </label>
368 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
370 <li id="mc_1_src_c_1_n_1">
371 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
372 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
377 <fieldset class="rows" id="mc_1_tgt_c_1">
378 <legend>Target (database) record check field</legend>
381 <label for="mc_1_tgt_c_1_tag">Tag: </label>
382 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
385 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
386 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
389 <label for="mc_1_tgt_c_1_offset">Offset: </label>
390 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
393 <label for="mc_1_tgt_c_1_length">Length: </label>
394 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
396 <li id="mc_1_tgt_c_1_n_1">
397 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
398 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
403 <br style="clear:both;" />
407 <fieldset class="action">
408 [% IF ( edit_matching_rule ) %]
409 <input type="button" value="Save"
410 onclick="CheckMatchingRuleForm(this.form)" />
412 <input type="button" value="Save"
413 onclick="CheckMatchingRuleForm(this.form)" />
415 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
420 [% IF ( delete_matching_rule_form ) %]
421 <div class="dialog alert">
422 <h3>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h3>
423 <form action="[% script_name | html %]" name="Aform" method="post">
424 <input type="hidden" name="op" value="[% confirm_op | html %]" />
425 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
426 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
428 <form action="[% script_name | html %]" method="get">
429 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
434 [% IF ( display_list ) %]
436 <div id="toolbar" class="btn-toolbar">
437 <a class="btn btn-default btn-sm" id="newrule" href="[% script_name | html %]?op=add_matching_rule"><i class="fa fa-plus"></i> New record matching rule</a>
440 <h2>Record matching rules</h2>
441 [% IF ( added_matching_rule ) %]
442 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
444 [% IF ( edited_matching_rule ) %]
445 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
447 [% IF ( deleted_matching_rule ) %]
448 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
450 [% IF ( available_matching_rules ) %]<table>
457 [% FOREACH available_matching_rule IN available_matching_rules %]
459 <td>[% available_matching_rule.matcher_id | html %]</td>
460 <td>[% available_matching_rule.code | html %]</td>
461 <td>[% available_matching_rule.description | html %]</td>
463 <a class="btn btn-default btn-xs" href="[% available_matching_rule.script_name | html %]?op=edit_matching_rule&matcher_id=[% available_matching_rule.matcher_id | html %]"><i class="fa fa-pencil"></i> Edit</a>
464 <a class="btn btn-default btn-xs" href="[% available_matching_rule.script_name | html %]?op=delete_matching_rule&matcher_id=[% available_matching_rule.matcher_id | html %]"><i class="fa fa-trash"></i> Delete</a>
468 </table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
470 <div class="pages">[% pagination_bar | $raw %]</div>
473 [% IF ( matching_rule_form ) %]
474 <div id="mp_template" class="matchgroup" style="display:none;">
475 <fieldset class="rows">
476 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
479 <label for="mp_num_search_index">Search index: </label>
480 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20"
484 <label for="mp_num_score">Score: </label>
485 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
488 <fieldset id="mp_num_c_1" class="rows">
489 <legend>Matchpoint components</legend>
492 <label for="mp_num_c_1_tag">Tag: </label>
493 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
496 <label for="mp_num_c_1_subfields">Subfields: </label>
497 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
500 <label for="mp_num_c_1_offset">Offset: </label>
501 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
504 <label for="mp_num_c_1_length">Length: </label>
505 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
507 <li id="mp_num_c_1_n_1">
508 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
509 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
514 <br style="clear:both;" />
517 <div id="mc_template" class="matchgroup" style="display:none">
518 <fieldset class="rows">
519 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
520 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
521 <fieldset class="rows" id="mc_num_src_c_1">
522 <legend>Source (incoming) record check field</legend>
525 <label for="mc_num_src_c_1_tag">Tag: </label>
526 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
529 <label for="mc_num_src_c_1_subfields">Subfields: </label>
530 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
533 <label for="mc_num_src_c_1_offset">Offset: </label>
534 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
537 <label for="mc_num_src_c_1_length">Length: </label>
538 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
540 <li id="mc_num_src_c_1_n_1">
541 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
542 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
546 <fieldset class="rows" id="mc_num_tgt_c_1">
547 <legend>Target (database) record check field</legend>
550 <label for="mc_num_tgt_c_1_tag">Tag: </label>
551 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
554 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
555 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
558 <label for="mc_num_tgt_c_1_offset">Offset: </label>
559 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
562 <label for="mc_num_tgt_c_1_length">Length: </label>
563 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
565 <li id="mc_num_tgt_c_1_n_1">
566 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
567 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
572 <br style="clear:both;" />
579 [% INCLUDE 'admin-menu.inc' %]
583 [% MACRO jsinclude BLOCK %]
584 [% Asset.js("js/admin-menu.js") | $raw %]
585 <script type="text/javascript">
586 var maxMatchPoint = [% max_matchpoint | html %];
587 var maxMatchCheck = [% max_matchcheck | html %];
589 function InsertMatchpoint(loc, index) {
590 var original= $("#"+index);
591 var clone = original.clone();
594 // update IDs and form names
596 clone.attr('id', 'mp_' + maxMatchPoint);
597 $("span.counter",clone).html(maxMatchPoint);
598 $("label",clone).each(function(){
599 var s = $(this).attr("for");
600 if (s.match(/mp_num/)) {
601 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
605 $("div",clone).each(function(){
606 var s = $(this).attr("id");
607 if (s.match(/mp_num/)) {
608 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
611 $("input",clone).each(function(){
612 var s = $(this).attr("id");
613 if(s.match(/mp_num/)){
614 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
617 var s = $(this).attr("name");
618 if(s.match(/mp_num/)){
619 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
622 $("#match_points").append(clone);
625 function InsertMatchcheck(loc, index) {
626 var original= $("#"+index);
627 var clone = original.clone();
630 // update IDs and form names
632 clone.attr('id', 'mc_' + maxMatchCheck);
633 $("span.counter",clone).html(maxMatchCheck);
634 $("label",clone).each(function(){
635 var s = $(this).attr("for");
636 if (s.match(/mc_num/)) {
637 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
641 $("div",clone).each(function(){
642 var s = $(this).attr("id");
643 if (s.match(/mc_num/)) {
644 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
647 $("input",clone).each(function(){
648 var s = $(this).attr("id");
649 if(s.match(/mc_num/)){
650 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
653 var s = $(this).attr("name");
654 if(s.match(/mc_num/)){
655 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
658 $("#match_checks").append(clone);
661 function DeleteMatchpoint(loc) {
662 $(loc).parent().parent().parent().remove();
663 if($(".matchgroup",$("#match_points")).length == 0){
665 $("#addMatchPoint").show();
669 function DeleteMatchcheck(loc) {
670 $(loc).parent().parent().parent().remove();
671 if($(".matchgroup",$("#match_checks")).length == 0){
673 $("#addMatchCheck").show();
677 function DoCancel(f) {
679 document.Aform.submit();
682 function CheckMatchingRuleForm(f) {
686 if (f.code.value.length==0) {
687 _alertString += "\n- " + _("Matching rule code missing");
689 if (f.description.value.length==0) {
690 _alertString += "\n- " + _("Description missing");
692 if (f.threshold.value.length==0) {
693 _alertString += "\n- " + _("Threshold missing");
695 if (_alertString.length==0) {
696 document.Aform.submit();
698 alertString2 = _("Form not submitted because of the following problem(s)");
699 alertString2 += "\n------------------------------------------------------------------------------------\n";
700 alertString2 += _alertString;
705 function CheckRuleForm(f) {
709 if (f.sort_rule.value.length==0) {
710 _alertString += "\n- " + _("Filing rule code missing");
712 if (f.description.value.length==0) {
713 _alertString += "\n- " + _("Description missing");
715 if (f.sort_routine.value.length==0) {
716 _alertString += "\n- " + _("Sort routine missing");
718 if (_alertString.length==0) {
719 document.Aform.submit();
721 alertString2 = _("Form not submitted because of the following problem(s)");
722 alertString2 += "\n------------------------------------------------------------------------------------\n";
723 alertString2 += _alertString;
729 [% INCLUDE 'intranet-bottom.inc' %]