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' %]
47 <select id="[% id | html %]" name="[% name | html %]">
48 [% PROCESS norms_options selected_norm=selected_norm %]
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 class="main container-fluid">
79 <div class="col-sm-10 col-sm-push-2">
82 [% IF ( matching_rule_form ) %]
83 [% IF ( edit_matching_rule ) %]
84 <h2>Modify record matching rule</h2>
86 <h2>Add record matching rule</h2>
88 <form action="[% script_name | html %]" name="Aform" method="post">
89 <input type="hidden" name="op" value="[% confirm_op | html %]" />
90 <fieldset class="rows">
93 [% IF ( edit_matching_rule ) %]
94 <span class="label">Matching rule code: </span>
95 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
96 <input type="hidden" name="code" value="[% code | html %]" />
99 <label for="code" class="required">Matching rule code: </label>
100 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
103 <li><label for="description" class="required">Description: </label>
104 <input type="text" id="description" name="description" size="50" maxlength="250"
105 value="[% description | html %]" /> <span class="required">Required</span>
107 <li><label for="threshold" class="required">Match threshold: </label>
108 <input type="text" id="threshold" name="threshold" size="5" maxlength="5"
109 value="[% threshold | html %]" /> <span class="required">Required</span>
111 <li><label for="record_type" class="required">Record type: </label>
112 <select id="record_type" name="record_type">
113 [% IF ( record_type == "authority" ) %]
114 <option value="biblio">Bibliographic record</option>
115 <option value="authority" selected="selected">Authority record</option>
117 <option value="biblio" selected="selected">Bibliographic record</option>
118 <option value="authority">Authority record</option>
120 </select><span class="required">Required</span>
125 <fieldset class="rows" id="match_points">
126 <h4>Match points</h4>
127 [% IF ( edit_matching_rule ) %]
128 [% 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>
129 [% 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 %]
130 [% IF ( edit_matching_rule ) %]
131 [% FOREACH matchpoint IN matchpoints %]
132 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
133 <fieldset class="rows">
134 <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>
137 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
138 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_search_index"
139 name="mp_[% matchpoint.mp_num | html %]_search_index" size="20"
140 value="[% matchpoint.index | html %]"
144 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
145 <input type ="text" id="mp_[% matchpoint.mp_num | html %]_score"
146 name="mp_[% matchpoint.mp_num | html %]_score" size="5"
147 value="[% matchpoint.score | html %]"
151 [% FOREACH component IN matchpoint.components %]
152 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
153 <legend>Matchpoint components</legend>
156 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
157 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag"
158 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag"
159 value="[% component.tag | html %]"
160 size="3" maxlength="3" />
163 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
164 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields"
165 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields"
166 value="[% component.subfields | html %]"
167 size="10" maxlength="40" />
170 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
171 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset"
172 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset"
173 value="[% component.offset | html %]"
174 size="5" maxlength="5" />
177 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
178 <input type="text" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length"
179 name="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length"
180 value="[% component.length | html %]"
181 size="5" maxlength="5" />
183 [% FOREACH norm IN component.norms %]
184 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
185 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
186 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
187 [% 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" %]
194 <br style="clear:both;" />
200 <div id="mp_1" class="matchgroup">
201 <fieldset class="rows">
202 <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>
205 <label for="mp_1_search_index">Search index: </label>
206 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20"
210 <label for="mp_1_score">Score: </label>
211 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
214 <fieldset class="rows" id="mp_1_c_1">
215 <legend>Matchpoint components</legend>
218 <label for="mp_1_c_1_tag">Tag: </label>
219 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
222 <label for="mp_1_c_1_subfields">Subfields: </label>
223 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
226 <label for="mp_1_c_1_offset">Offset: </label>
227 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
230 <label for="mp_1_c_1_length">Length: </label>
231 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
233 <li id="mp_1_c_1_n_1">
234 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
235 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
240 <br style="clear:both;" />
246 <fieldset class="rows" id="match_checks">
247 <h4>Required match checks</h4>
248 [% IF ( edit_matching_rule ) %]
249 [% 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>
250 [% 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 %]
251 [% IF ( edit_matching_rule ) %]
252 [% FOREACH matchcheck IN matchchecks %]
253 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
254 <fieldset class="rows">
255 <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>
256 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
257 [% FOREACH src_component IN matchcheck.src_components %]
258 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
259 <legend>Source (incoming) record check field</legend>
262 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
263 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag"
264 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag"
265 value="[% src_component.tag | html %]"
266 size="3" maxlength="3" />
269 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
270 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields"
271 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields"
272 value="[% src_component.subfields | html %]"
273 size="10" maxlength="40" />
276 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
277 <input type="text" id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset"
278 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset"
279 value="[% src_component.offset | html %]"
280 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"
285 name="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length"
286 value="[% src_component.length | html %]"
287 size="5" maxlength="5" />
289 [% FOREACH norm IN src_component.norms %]
290 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
291 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
292 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
293 [% 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" %]
299 [% FOREACH tgt_component IN matchcheck.tgt_components %]
300 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
301 <legend>Target (database) record check field</legend>
304 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
305 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag"
306 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag"
307 value="[% tgt_component.tag | html %]"
308 size="3" maxlength="3" />
311 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
312 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields"
313 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields"
314 value="[% tgt_component.subfields | html %]"
315 size="10" maxlength="40" />
318 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
319 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset"
320 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset"
321 value="[% tgt_component.offset | html %]"
322 size="5" maxlength="5" />
325 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
326 <input type="text" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length"
327 name="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length"
328 value="[% tgt_component.length | html %]"
329 size="5" maxlength="5" />
331 [% FOREACH norm IN tgt_component.norms %]
332 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
333 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
334 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
335 [% 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" %]
342 <br style="clear:both;" />
346 <div id="mc_1" class="matchgroup">
347 <fieldset class="rows">
348 <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>
349 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
350 <fieldset class="rows" id="mc_1_src_c_1">
351 <legend>Source (incoming) record check field</legend>
354 <label for="mc_1_src_c_1_tag">Tag: </label>
355 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
358 <label for="mc_1_src_c_1_subfields">Subfields: </label>
359 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
362 <label for="mc_1_src_c_1_offset">Offset: </label>
363 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
366 <label for="mc_1_src_c_1_length">Length: </label>
367 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
369 <li id="mc_1_src_c_1_n_1">
370 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
371 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
376 <fieldset class="rows" id="mc_1_tgt_c_1">
377 <legend>Target (database) record check field</legend>
380 <label for="mc_1_tgt_c_1_tag">Tag: </label>
381 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
384 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
385 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
388 <label for="mc_1_tgt_c_1_offset">Offset: </label>
389 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
392 <label for="mc_1_tgt_c_1_length">Length: </label>
393 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
395 <li id="mc_1_tgt_c_1_n_1">
396 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
397 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
402 <br style="clear:both;" />
406 <fieldset class="action">
407 [% IF ( edit_matching_rule ) %]
408 <input type="button" value="Save"
409 onclick="CheckMatchingRuleForm(this.form)" />
411 <input type="button" value="Save"
412 onclick="CheckMatchingRuleForm(this.form)" />
414 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
419 [% IF ( delete_matching_rule_form ) %]
420 <div class="dialog alert">
421 <h3>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h3>
422 <form action="[% script_name | html %]" name="Aform" method="post">
423 <input type="hidden" name="op" value="[% confirm_op | html %]" />
424 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
425 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
427 <form action="[% script_name | html %]" method="get">
428 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
433 [% IF ( display_list ) %]
435 <div id="toolbar" class="btn-toolbar">
436 <a class="btn btn-default btn-sm" id="newrule" href="[% script_name | url %]?op=add_matching_rule"><i class="fa fa-plus"></i> New record matching rule</a>
439 <h2>Record matching rules</h2>
440 [% IF ( added_matching_rule ) %]
441 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
443 [% IF ( edited_matching_rule ) %]
444 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
446 [% IF ( deleted_matching_rule ) %]
447 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
449 [% IF ( available_matching_rules ) %]<table>
456 [% FOREACH available_matching_rule IN available_matching_rules %]
458 <td>[% available_matching_rule.matcher_id | html %]</td>
459 <td>[% available_matching_rule.code | html %]</td>
460 <td>[% available_matching_rule.description | html %]</td>
462 <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>
463 <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>
467 </table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
469 <div class="pages">[% pagination_bar | $raw %]</div>
472 [% IF ( matching_rule_form ) %]
473 <div id="mp_template" class="matchgroup" style="display:none;">
474 <fieldset class="rows">
475 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
478 <label for="mp_num_search_index">Search index: </label>
479 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20"
483 <label for="mp_num_score">Score: </label>
484 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
487 <fieldset id="mp_num_c_1" class="rows">
488 <legend>Matchpoint components</legend>
491 <label for="mp_num_c_1_tag">Tag: </label>
492 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
495 <label for="mp_num_c_1_subfields">Subfields: </label>
496 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
499 <label for="mp_num_c_1_offset">Offset: </label>
500 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
503 <label for="mp_num_c_1_length">Length: </label>
504 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
506 <li id="mp_num_c_1_n_1">
507 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
508 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
513 <br style="clear:both;" />
516 <div id="mc_template" class="matchgroup" style="display:none">
517 <fieldset class="rows">
518 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
519 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
520 <fieldset class="rows" id="mc_num_src_c_1">
521 <legend>Source (incoming) record check field</legend>
524 <label for="mc_num_src_c_1_tag">Tag: </label>
525 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
528 <label for="mc_num_src_c_1_subfields">Subfields: </label>
529 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
532 <label for="mc_num_src_c_1_offset">Offset: </label>
533 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
536 <label for="mc_num_src_c_1_length">Length: </label>
537 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
539 <li id="mc_num_src_c_1_n_1">
540 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
541 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
545 <fieldset class="rows" id="mc_num_tgt_c_1">
546 <legend>Target (database) record check field</legend>
549 <label for="mc_num_tgt_c_1_tag">Tag: </label>
550 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
553 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
554 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
557 <label for="mc_num_tgt_c_1_offset">Offset: </label>
558 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
561 <label for="mc_num_tgt_c_1_length">Length: </label>
562 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
564 <li id="mc_num_tgt_c_1_n_1">
565 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
566 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
571 <br style="clear:both;" />
576 </div> <!-- /.col-sm-10.col-sm-push-2 -->
578 <div class="col-sm-2 col-sm-pull-10">
580 [% INCLUDE 'admin-menu.inc' %]
582 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
583 </div> <!-- /.row -->
585 [% MACRO jsinclude BLOCK %]
586 [% Asset.js("js/admin-menu.js") | $raw %]
588 var maxMatchPoint = [% max_matchpoint | html %];
589 var maxMatchCheck = [% max_matchcheck | html %];
591 function InsertMatchpoint(loc, index) {
592 var original= $("#"+index);
593 var clone = original.clone();
596 // update IDs and form names
598 clone.attr('id', 'mp_' + maxMatchPoint);
599 $("span.counter",clone).html(maxMatchPoint);
600 $("label",clone).each(function(){
601 var s = $(this).attr("for");
602 if (s.match(/mp_num/)) {
603 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
607 $("div",clone).each(function(){
608 var s = $(this).attr("id");
609 if (s.match(/mp_num/)) {
610 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
613 $("input",clone).each(function(){
614 var s = $(this).attr("id");
615 if(s.match(/mp_num/)){
616 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
619 var s = $(this).attr("name");
620 if(s.match(/mp_num/)){
621 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
624 $("#match_points").append(clone);
627 function InsertMatchcheck(loc, index) {
628 var original= $("#"+index);
629 var clone = original.clone();
632 // update IDs and form names
634 clone.attr('id', 'mc_' + maxMatchCheck);
635 $("span.counter",clone).html(maxMatchCheck);
636 $("label",clone).each(function(){
637 var s = $(this).attr("for");
638 if (s.match(/mc_num/)) {
639 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
643 $("div",clone).each(function(){
644 var s = $(this).attr("id");
645 if (s.match(/mc_num/)) {
646 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
649 $("input",clone).each(function(){
650 var s = $(this).attr("id");
651 if(s.match(/mc_num/)){
652 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
655 var s = $(this).attr("name");
656 if(s.match(/mc_num/)){
657 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
660 $("#match_checks").append(clone);
663 function DeleteMatchpoint(loc) {
664 $(loc).parent().parent().parent().remove();
665 if($(".matchgroup",$("#match_points")).length == 0){
667 $("#addMatchPoint").show();
671 function DeleteMatchcheck(loc) {
672 $(loc).parent().parent().parent().remove();
673 if($(".matchgroup",$("#match_checks")).length == 0){
675 $("#addMatchCheck").show();
679 function DoCancel(f) {
681 document.Aform.submit();
684 function CheckMatchingRuleForm(f) {
688 if (f.code.value.length==0) {
689 _alertString += "\n- " + _("Matching rule code missing");
691 if (f.description.value.length==0) {
692 _alertString += "\n- " + _("Description missing");
694 if (f.threshold.value.length==0) {
695 _alertString += "\n- " + _("Threshold missing");
697 if (_alertString.length==0) {
698 document.Aform.submit();
700 alertString2 = _("Form not submitted because of the following problem(s)");
701 alertString2 += "\n------------------------------------------------------------------------------------\n";
702 alertString2 += _alertString;
707 function CheckRuleForm(f) {
711 if (f.sort_rule.value.length==0) {
712 _alertString += "\n- " + _("Filing rule code missing");
714 if (f.description.value.length==0) {
715 _alertString += "\n- " + _("Description missing");
717 if (f.sort_routine.value.length==0) {
718 _alertString += "\n- " + _("Sort routine missing");
720 if (_alertString.length==0) {
721 document.Aform.submit();
723 alertString2 = _("Form not submitted because of the following problem(s)");
724 alertString2 += "\n------------------------------------------------------------------------------------\n";
725 alertString2 += _alertString;
731 [% INCLUDE 'intranet-bottom.inc' %]