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
27 [% CASE %][% norm | html %]
31 [% BLOCK norms_options %]
32 [%# PARAMS: selected_norm %]
33 [% FOREACH norm IN valid_norms %]
34 [% IF ( norm == selected_norm ) %]
35 <option value="[% norm | html %]" selected="selected">[% PROCESS norms_text norm=norm %]</option>
37 <option value="[% norm | html %]">[% PROCESS norms_text norm=norm %]</option>
42 [% BLOCK norms_select %]
43 [%# PARAMS: selected_norm, id, name %]
44 [% UNLESS valid_norms.grep(selected_norm).size %]
45 [%# Fallback to 'none' %]
46 [% selected_norm = 'none' %]
48 <select id="[% id | html %]" name="[% name | html %]">
49 [% PROCESS norms_options selected_norm=selected_norm %]
54 fieldset.rows fieldset.rows { border-width : 0; }
55 fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
56 fieldset, fieldset.rows { width : 90%; padding: .3em .6em .3em .6em; }
57 fieldset.rows fieldset {font-size:100%;}
58 div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
61 <body id="admin_matching-rules" class="admin">
62 [% INCLUDE 'header.inc' %]
63 [% INCLUDE 'prefs-admin-search.inc' %]
65 <div id="breadcrumbs">
66 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
67 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
68 [% IF ( display_list ) %]
71 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
73 [% IF ( matching_rule_form ) %]
74 [% IF ( edit_matching_rule ) %]
75 › Modify record matching rule
77 › Add record matching rule
80 [% IF ( delete_matching_rule_form ) %]
81 › Confirm deletion of record matching rule "[% code | html %]"
85 <div class="main container-fluid">
87 <div class="col-sm-10 col-sm-push-2">
90 [% IF ( matching_rule_form ) %]
91 [% IF ( edit_matching_rule ) %]
92 <h2>Modify record matching rule</h2>
94 <h2>Add record matching rule</h2>
96 <form action="[% script_name | html %]" name="Aform" method="post">
97 <input type="hidden" name="op" value="[% confirm_op | html %]" />
98 <fieldset class="rows">
101 [% IF ( edit_matching_rule ) %]
102 <span class="label">Matching rule code: </span>
103 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
104 <input type="hidden" name="code" value="[% code | html %]" />
107 <label for="code" class="required">Matching rule code: </label>
108 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
112 <label for="description" class="required">Description: </label>
113 <input type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> <span class="required">Required</span>
116 <label for="threshold" class="required">Match threshold: </label>
117 <input type="text" id="threshold" name="threshold" size="5" maxlength="5" value="[% threshold | html %]" /> <span class="required">Required</span>
120 <label for="record_type" class="required">Record type: </label>
121 <select id="record_type" name="record_type">
122 [% IF ( record_type == "authority" ) %]
123 <option value="biblio">Bibliographic record</option>
124 <option value="authority" selected="selected">Authority record</option>
126 <option value="biblio" selected="selected">Bibliographic record</option>
127 <option value="authority">Authority record</option>
129 </select><span class="required">Required</span>
134 <fieldset class="rows" id="match_points">
135 <h4>Match points</h4>
136 [% IF ( edit_matching_rule ) %]
137 [% IF ( matchpoints ) %]
138 <p id="addMatchPoint" style="display:none;">
140 <p id="addMatchPoint">
142 <a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a>
145 <p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">
150 [% IF ( edit_matching_rule ) %]
151 [% FOREACH matchpoint IN matchpoints %]
152 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
153 <fieldset class="rows">
154 <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>
157 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
158 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_search_index" name="mp_[% matchpoint.mp_num | html %]_search_index" size="20" value="[% matchpoint.index | html %]" maxlength="30" />
161 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
162 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_score" name="mp_[% matchpoint.mp_num | html %]_score" size="5" value="[% matchpoint.score | html %]" maxlength="5" />
165 [% FOREACH component IN matchpoint.components %]
166 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
167 <legend>Matchpoint components</legend>
170 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
171 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag" name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag" value="[% component.tag | html %]" size="3" maxlength="3" />
174 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
175 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields" name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields" value="[% component.subfields | html %]"
176 size="10" maxlength="40" />
179 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
180 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset" name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset" value="[% component.offset | html %]"
181 size="5" maxlength="5" />
184 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
185 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length" name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length" value="[% component.length | html %]"
186 size="5" maxlength="5" />
188 [% FOREACH norm IN component.norms %]
189 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
190 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
191 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
192 [% 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" %]
199 <br style="clear:both;" />
203 <div id="mp_1" class="matchgroup">
204 <fieldset class="rows">
205 <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>
208 <label for="mp_1_search_index">Search index: </label>
209 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" maxlength="30" />
212 <label for="mp_1_score">Score: </label>
213 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
216 <fieldset class="rows" id="mp_1_c_1">
217 <legend>Matchpoint components</legend>
220 <label for="mp_1_c_1_tag">Tag: </label>
221 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
224 <label for="mp_1_c_1_subfields">Subfields: </label>
225 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
228 <label for="mp_1_c_1_offset">Offset: </label>
229 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
232 <label for="mp_1_c_1_length">Length: </label>
233 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
235 <li id="mp_1_c_1_n_1">
236 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
237 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
242 <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 ) %]
251 <p id="addMatchCheck" style="display:none;">
253 <p id="addMatchCheck">
255 <a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
257 <p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
260 [% IF ( edit_matching_rule ) %]
261 [% FOREACH matchcheck IN matchchecks %]
262 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
263 <fieldset class="rows">
264 <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>
265 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
266 [% FOREACH src_component IN matchcheck.src_components %]
267 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
268 <legend>Source (incoming) record check field</legend>
271 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
272 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag" name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag" value="[% src_component.tag | html %]" size="3" maxlength="3" />
275 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
276 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields" name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields" value="[% src_component.subfields | html %]" size="10" maxlength="40" />
279 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
280 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset" name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset" value="[% src_component.offset | html %]" size="5" maxlength="5" />
283 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length">Length: </label>
284 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length" name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length" value="[% src_component.length | html %]" size="5" maxlength="5" />
286 [% FOREACH norm IN src_component.norms %]
287 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
288 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
289 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
290 [% 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" %]
297 [% FOREACH tgt_component IN matchcheck.tgt_components %]
298 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
299 <legend>Target (database) record check field</legend>
302 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
303 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag" name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag" value="[% tgt_component.tag | html %]" size="3" maxlength="3" />
306 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
307 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields" name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields" value="[% tgt_component.subfields | html %]" size="10" maxlength="40" />
310 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
311 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset" name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset" value="[% tgt_component.offset | html %]" size="5" maxlength="5" />
314 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
315 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length" name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length" value="[% tgt_component.length | html %]" size="5" maxlength="5" />
317 [% FOREACH norm IN tgt_component.norms %]
318 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
319 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
320 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
321 [% 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" %]
328 <br style="clear:both;" />
332 <div id="mc_1" class="matchgroup">
333 <fieldset class="rows">
334 <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>
335 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
336 <fieldset class="rows" id="mc_1_src_c_1">
337 <legend>Source (incoming) record check field</legend>
340 <label for="mc_1_src_c_1_tag">Tag: </label>
341 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
344 <label for="mc_1_src_c_1_subfields">Subfields: </label>
345 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
348 <label for="mc_1_src_c_1_offset">Offset: </label>
349 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
352 <label for="mc_1_src_c_1_length">Length: </label>
353 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
355 <li id="mc_1_src_c_1_n_1">
356 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
357 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
362 <fieldset class="rows" id="mc_1_tgt_c_1">
363 <legend>Target (database) record check field</legend>
366 <label for="mc_1_tgt_c_1_tag">Tag: </label>
367 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
370 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
371 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
374 <label for="mc_1_tgt_c_1_offset">Offset: </label>
375 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
378 <label for="mc_1_tgt_c_1_length">Length: </label>
379 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
381 <li id="mc_1_tgt_c_1_n_1">
382 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
383 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
388 <br style="clear:both;" />
392 <fieldset class="action">
393 [% IF ( edit_matching_rule ) %]
394 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
396 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
398 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
403 [% IF ( delete_matching_rule_form ) %]
404 <div class="dialog alert">
405 <h3>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h3>
406 <form action="[% script_name | html %]" name="Aform" method="post">
407 <input type="hidden" name="op" value="[% confirm_op | html %]" />
408 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
409 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
411 <form action="[% script_name | html %]" method="get">
412 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
417 [% IF ( display_list ) %]
419 <div id="toolbar" class="btn-toolbar">
420 <a class="btn btn-default" id="newrule" href="[% script_name | url %]?op=add_matching_rule"><i class="fa fa-plus"></i> New record matching rule</a>
423 <h2>Record matching rules</h2>
425 [% IF ( added_matching_rule ) %]
426 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
428 [% IF ( edited_matching_rule ) %]
429 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
431 [% IF ( deleted_matching_rule ) %]
432 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
434 [% IF ( available_matching_rules ) %]
442 [% FOREACH available_matching_rule IN available_matching_rules %]
444 <td>[% available_matching_rule.matcher_id | html %]</td>
445 <td>[% available_matching_rule.code | html %]</td>
446 <td>[% available_matching_rule.description | html %]</td>
448 <a class="btn btn-default btn-xs" href="[% available_matching_rule.script_name | url %]?op=edit_matching_rule&matcher_id=[% available_matching_rule.matcher_id | uri %]"><i class="fa fa-pencil"></i> Edit</a>
449 <a class="btn btn-default btn-xs" href="[% available_matching_rule.script_name | url %]?op=delete_matching_rule&matcher_id=[% available_matching_rule.matcher_id | uri %]"><i class="fa fa-trash"></i> Delete</a>
455 <p>There are no saved matching rules.</p>
458 <div class="pages">[% pagination_bar | $raw %]</div>
461 [% IF ( matching_rule_form ) %]
462 <div id="mp_template" class="matchgroup" style="display:none;">
463 <fieldset class="rows">
464 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
467 <label for="mp_num_search_index">Search index: </label>
468 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" maxlength="30" />
471 <label for="mp_num_score">Score: </label>
472 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
475 <fieldset id="mp_num_c_1" class="rows">
476 <legend>Matchpoint components</legend>
479 <label for="mp_num_c_1_tag">Tag: </label>
480 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
483 <label for="mp_num_c_1_subfields">Subfields: </label>
484 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
487 <label for="mp_num_c_1_offset">Offset: </label>
488 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
491 <label for="mp_num_c_1_length">Length: </label>
492 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
494 <li id="mp_num_c_1_n_1">
495 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
496 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
501 <br style="clear:both;" />
504 <div id="mc_template" class="matchgroup" style="display:none">
505 <fieldset class="rows">
506 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
507 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
508 <fieldset class="rows" id="mc_num_src_c_1">
509 <legend>Source (incoming) record check field</legend>
512 <label for="mc_num_src_c_1_tag">Tag: </label>
513 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
516 <label for="mc_num_src_c_1_subfields">Subfields: </label>
517 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
520 <label for="mc_num_src_c_1_offset">Offset: </label>
521 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
524 <label for="mc_num_src_c_1_length">Length: </label>
525 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
527 <li id="mc_num_src_c_1_n_1">
528 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
529 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
533 <fieldset class="rows" id="mc_num_tgt_c_1">
534 <legend>Target (database) record check field</legend>
537 <label for="mc_num_tgt_c_1_tag">Tag: </label>
538 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
541 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
542 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
545 <label for="mc_num_tgt_c_1_offset">Offset: </label>
546 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
549 <label for="mc_num_tgt_c_1_length">Length: </label>
550 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
552 <li id="mc_num_tgt_c_1_n_1">
553 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
554 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
559 <br style="clear:both;" />
564 </div> <!-- /.col-sm-10.col-sm-push-2 -->
566 <div class="col-sm-2 col-sm-pull-10">
568 [% INCLUDE 'admin-menu.inc' %]
570 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
571 </div> <!-- /.row -->
573 [% MACRO jsinclude BLOCK %]
574 [% Asset.js("js/admin-menu.js") | $raw %]
576 var maxMatchPoint = [% max_matchpoint | html %];
577 var maxMatchCheck = [% max_matchcheck | html %];
579 function InsertMatchpoint(loc, index) {
580 var original= $("#"+index);
581 var clone = original.clone();
584 // update IDs and form names
586 clone.attr('id', 'mp_' + maxMatchPoint);
587 $("span.counter",clone).html(maxMatchPoint);
588 $("label",clone).each(function(){
589 var s = $(this).attr("for");
590 if (s.match(/mp_num/)) {
591 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
595 $("div",clone).each(function(){
596 var s = $(this).attr("id");
597 if (s.match(/mp_num/)) {
598 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
601 $("input",clone).each(function(){
602 var s = $(this).attr("id");
603 if(s.match(/mp_num/)){
604 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
607 var s = $(this).attr("name");
608 if(s.match(/mp_num/)){
609 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
612 $("#match_points").append(clone);
615 function InsertMatchcheck(loc, index) {
616 var original= $("#"+index);
617 var clone = original.clone();
620 // update IDs and form names
622 clone.attr('id', 'mc_' + maxMatchCheck);
623 $("span.counter",clone).html(maxMatchCheck);
624 $("label",clone).each(function(){
625 var s = $(this).attr("for");
626 if (s.match(/mc_num/)) {
627 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
631 $("div",clone).each(function(){
632 var s = $(this).attr("id");
633 if (s.match(/mc_num/)) {
634 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
637 $("input",clone).each(function(){
638 var s = $(this).attr("id");
639 if(s.match(/mc_num/)){
640 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
643 var s = $(this).attr("name");
644 if(s.match(/mc_num/)){
645 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
648 $("#match_checks").append(clone);
651 function DeleteMatchpoint(loc) {
652 $(loc).parent().parent().parent().remove();
653 if($(".matchgroup",$("#match_points")).length == 0){
655 $("#addMatchPoint").show();
659 function DeleteMatchcheck(loc) {
660 $(loc).parent().parent().parent().remove();
661 if($(".matchgroup",$("#match_checks")).length == 0){
663 $("#addMatchCheck").show();
667 function DoCancel(f) {
669 document.Aform.submit();
672 function CheckMatchingRuleForm(f) {
676 if (f.code.value.length==0) {
677 _alertString += "\n- " + _("Matching rule code missing");
679 if (f.description.value.length==0) {
680 _alertString += "\n- " + _("Description missing");
682 if (f.threshold.value.length==0) {
683 _alertString += "\n- " + _("Threshold missing");
685 if (_alertString.length==0) {
686 document.Aform.submit();
688 alertString2 = _("Form not submitted because of the following problem(s)");
689 alertString2 += "\n------------------------------------------------------------------------------------\n";
690 alertString2 += _alertString;
695 function CheckRuleForm(f) {
699 if (f.sort_rule.value.length==0) {
700 _alertString += "\n- " + _("Filing rule code missing");
702 if (f.description.value.length==0) {
703 _alertString += "\n- " + _("Description missing");
705 if (f.sort_routine.value.length==0) {
706 _alertString += "\n- " + _("Sort routine missing");
708 if (_alertString.length==0) {
709 document.Aform.submit();
711 alertString2 = _("Form not submitted because of the following problem(s)");
712 alertString2 += "\n------------------------------------------------------------------------------------\n";
713 alertString2 += _alertString;
719 [% INCLUDE 'intranet-bottom.inc' %]