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"><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 %]
66 [% IF ( matching_rule_form ) %]
67 [% IF ( edit_matching_rule ) %]
68 › Modify record matching rule
70 › Add record matching rule
73 [% IF ( delete_matching_rule_form ) %]
74 › Confirm deletion of record matching rule "[% code | html %]"
78 <div class="main container-fluid">
80 <div class="col-sm-10 col-sm-push-2">
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" id="newrule" href="[% script_name | url %]?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>
455 <th class="noExport">Actions</th>
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 | url %]?op=edit_matching_rule&matcher_id=[% available_matching_rule.matcher_id | uri %]"><i class="fa fa-pencil"></i> Edit</a>
464 <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>
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;" />
577 </div> <!-- /.col-sm-10.col-sm-push-2 -->
579 <div class="col-sm-2 col-sm-pull-10">
581 [% INCLUDE 'admin-menu.inc' %]
583 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
584 </div> <!-- /.row -->
586 [% MACRO jsinclude BLOCK %]
587 [% Asset.js("js/admin-menu.js") | $raw %]
589 var maxMatchPoint = [% max_matchpoint | html %];
590 var maxMatchCheck = [% max_matchcheck | html %];
592 function InsertMatchpoint(loc, index) {
593 var original= $("#"+index);
594 var clone = original.clone();
597 // update IDs and form names
599 clone.attr('id', 'mp_' + maxMatchPoint);
600 $("span.counter",clone).html(maxMatchPoint);
601 $("label",clone).each(function(){
602 var s = $(this).attr("for");
603 if (s.match(/mp_num/)) {
604 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
608 $("div",clone).each(function(){
609 var s = $(this).attr("id");
610 if (s.match(/mp_num/)) {
611 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
614 $("input",clone).each(function(){
615 var s = $(this).attr("id");
616 if(s.match(/mp_num/)){
617 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
620 var s = $(this).attr("name");
621 if(s.match(/mp_num/)){
622 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
625 $("#match_points").append(clone);
628 function InsertMatchcheck(loc, index) {
629 var original= $("#"+index);
630 var clone = original.clone();
633 // update IDs and form names
635 clone.attr('id', 'mc_' + maxMatchCheck);
636 $("span.counter",clone).html(maxMatchCheck);
637 $("label",clone).each(function(){
638 var s = $(this).attr("for");
639 if (s.match(/mc_num/)) {
640 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
644 $("div",clone).each(function(){
645 var s = $(this).attr("id");
646 if (s.match(/mc_num/)) {
647 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
650 $("input",clone).each(function(){
651 var s = $(this).attr("id");
652 if(s.match(/mc_num/)){
653 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
656 var s = $(this).attr("name");
657 if(s.match(/mc_num/)){
658 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
661 $("#match_checks").append(clone);
664 function DeleteMatchpoint(loc) {
665 $(loc).parent().parent().parent().remove();
666 if($(".matchgroup",$("#match_points")).length == 0){
668 $("#addMatchPoint").show();
672 function DeleteMatchcheck(loc) {
673 $(loc).parent().parent().parent().remove();
674 if($(".matchgroup",$("#match_checks")).length == 0){
676 $("#addMatchCheck").show();
680 function DoCancel(f) {
682 document.Aform.submit();
685 function CheckMatchingRuleForm(f) {
689 if (f.code.value.length==0) {
690 _alertString += "\n- " + _("Matching rule code missing");
692 if (f.description.value.length==0) {
693 _alertString += "\n- " + _("Description missing");
695 if (f.threshold.value.length==0) {
696 _alertString += "\n- " + _("Threshold missing");
698 if (_alertString.length==0) {
699 document.Aform.submit();
701 alertString2 = _("Form not submitted because of the following problem(s)");
702 alertString2 += "\n------------------------------------------------------------------------------------\n";
703 alertString2 += _alertString;
708 function CheckRuleForm(f) {
712 if (f.sort_rule.value.length==0) {
713 _alertString += "\n- " + _("Filing rule code missing");
715 if (f.description.value.length==0) {
716 _alertString += "\n- " + _("Description missing");
718 if (f.sort_routine.value.length==0) {
719 _alertString += "\n- " + _("Sort routine missing");
721 if (_alertString.length==0) {
722 document.Aform.submit();
724 alertString2 = _("Form not submitted because of the following problem(s)");
725 alertString2 += "\n------------------------------------------------------------------------------------\n";
726 alertString2 += _alertString;
732 [% INCLUDE 'intranet-bottom.inc' %]