4 [% INCLUDE 'doc-head-open.inc' %]
6 Koha › Administration › Record matching rules
7 [% IF ( matching_rule_form ) %]
8 [% IF ( edit_matching_rule ) %]
9 › Modify record matching rule
11 › Add record matching rule
14 [% IF ( delete_matching_rule_form ) %]
15 › Confirm deletion of record matching rule "[% code | html %]"
18 [% INCLUDE 'doc-head-close.inc' %]
20 [% BLOCK norms_text %]
23 [% CASE 'remove_spaces' %]Remove spaces
24 [% CASE 'upper_case' %]Uppercase
25 [% CASE 'lower_case' %]Lowercase
26 [% CASE 'legacy_default' %]Legacy default
28 [% CASE %][% norm | html %]
32 [% BLOCK norms_options %]
33 [%# PARAMS: selected_norm %]
34 [% FOREACH norm IN valid_norms %]
35 [% IF ( norm == selected_norm ) %]
36 <option value="[% norm | html %]" selected="selected">[% PROCESS norms_text norm=norm %]</option>
38 <option value="[% norm | html %]">[% PROCESS norms_text norm=norm %]</option>
43 [% BLOCK norms_select %]
44 [%# PARAMS: selected_norm, id, name %]
45 [% UNLESS valid_norms.grep(selected_norm).size %]
46 [%# Fallback to 'none' %]
47 [% selected_norm = 'none' %]
49 <select id="[% id | html %]" name="[% name | html %]">
50 [% PROCESS norms_options selected_norm=selected_norm %]
55 fieldset.rows fieldset.rows { border-width : 0; }
56 fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
57 fieldset, fieldset.rows { width : 90%; padding: .3em .6em .3em .6em; }
58 fieldset.rows fieldset {font-size:100%;}
59 div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
62 <body id="admin_matching-rules" class="admin">
63 [% INCLUDE 'header.inc' %]
64 [% INCLUDE 'prefs-admin-search.inc' %]
66 <nav aria-label="Breadcrumb" class="breadcrumb">
69 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
72 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
75 [% IF ( matching_rule_form ) %]
77 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
80 <a href="#" aria-current="page">
81 [% IF ( edit_matching_rule ) %]
82 Modify record matching rule
84 Add record matching rule
89 [% ELSIF ( delete_matching_rule_form ) %]
91 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
94 <a href="#" aria-current="page">
95 Confirm deletion of record matching rule "[% code | html %]"
101 <a href="#" aria-current="page">
102 Record matching rules
107 </nav> <!-- /#breadcrumbs -->
109 <div class="main container-fluid">
111 <div class="col-sm-10 col-sm-push-2">
114 [% IF ( matching_rule_form ) %]
115 [% IF ( edit_matching_rule ) %]
116 <h2>Modify record matching rule</h2>
118 <h2>Add record matching rule</h2>
120 <form action="[% script_name | html %]" name="Aform" method="post">
121 <input type="hidden" name="op" value="[% confirm_op | html %]" />
122 <fieldset class="rows">
125 [% IF ( edit_matching_rule ) %]
126 <span class="label">Matching rule code: </span>
127 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
128 <input type="hidden" name="code" value="[% code | html %]" />
131 <label for="code" class="required">Matching rule code: </label>
132 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
136 <label for="description" class="required">Description: </label>
137 <input type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> <span class="required">Required</span>
140 <label for="threshold" class="required">Match threshold: </label>
141 <input type="text" id="threshold" name="threshold" size="5" maxlength="5" value="[% threshold | html %]" /> <span class="required">Required</span>
144 <label for="record_type" class="required">Record type: </label>
145 <select id="record_type" name="record_type">
146 [% IF ( record_type == "authority" ) %]
147 <option value="biblio">Bibliographic record</option>
148 <option value="authority" selected="selected">Authority record</option>
150 <option value="biblio" selected="selected">Bibliographic record</option>
151 <option value="authority">Authority record</option>
153 </select><span class="required">Required</span>
156 </fieldset> <!-- /.rows -->
158 <fieldset class="rows" id="match_points">
159 <h4>Match points</h4>
160 [% IF ( edit_matching_rule ) %]
161 [% IF ( matchpoints ) %]
162 <p id="addMatchPoint" style="display:none;">
164 <p id="addMatchPoint">
166 <a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a>
169 <p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">
174 [% IF ( edit_matching_rule ) %]
175 [% FOREACH matchpoint IN matchpoints %]
176 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
177 <fieldset class="rows">
178 <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>
181 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
182 <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" />
185 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
186 <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" />
189 [% FOREACH component IN matchpoint.components %]
190 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
191 <legend>Matchpoint components</legend>
194 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
195 <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" />
198 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
199 <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 %]"
200 size="10" maxlength="40" />
203 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
204 <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 %]"
205 size="5" maxlength="5" />
208 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
209 <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 %]"
210 size="5" maxlength="5" />
212 [% FOREACH norm IN component.norms %]
213 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
214 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
215 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
216 [% 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" %]
220 </fieldset> <!-- /#mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %] -->
221 [% END #/FOREACH component %]
222 </fieldset> <!-- /.rows -->
223 <br style="clear:both;" />
224 </div> <!-- /#mp_[% matchpoint.mp_num | html %] -->
225 [% END # /FOREACH matchpoint %]
226 [% ELSE # IF ( edit_matching_rule ) %]
227 <div id="mp_1" class="matchgroup">
228 <fieldset class="rows">
229 <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>
232 <label for="mp_1_search_index">Search index: </label>
233 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" maxlength="30" />
236 <label for="mp_1_score">Score: </label>
237 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
240 <fieldset class="rows" id="mp_1_c_1">
241 <legend>Matchpoint components</legend>
244 <label for="mp_1_c_1_tag">Tag: </label>
245 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
248 <label for="mp_1_c_1_subfields">Subfields: </label>
249 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
252 <label for="mp_1_c_1_offset">Offset: </label>
253 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
256 <label for="mp_1_c_1_length">Length: </label>
257 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
259 <li id="mp_1_c_1_n_1">
260 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
261 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
264 </fieldset> <!-- /#mp_1_c_1 -->
265 </fieldset> <!-- /.rows -->
266 <br style="clear:both;" />
267 </div> <!-- /#mp_1 -->
268 [% END # /IF ( edit_matching_rule ) %]
269 </fieldset> <!-- /#match_points -->
271 <fieldset class="rows" id="match_checks">
272 <h4>Required match checks</h4>
273 [% IF ( edit_matching_rule ) %]
274 [% IF ( matchchecks ) %]
275 <p id="addMatchCheck" style="display:none;">
277 <p id="addMatchCheck">
279 <a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
281 <p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
284 [% IF ( edit_matching_rule ) %]
285 [% FOREACH matchcheck IN matchchecks %]
286 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
287 <fieldset class="rows">
288 <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>
289 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
290 [% FOREACH src_component IN matchcheck.src_components %]
291 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
292 <legend>Source (incoming) record check field</legend>
295 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
296 <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" />
299 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
300 <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" />
303 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
304 <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" />
307 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length">Length: </label>
308 <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" />
310 [% FOREACH norm IN src_component.norms %]
311 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
312 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
313 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
314 [% 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" %]
318 </fieldset> <!-- /#mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %] -->
319 [% END # /FOREACH src_component %]
321 [% FOREACH tgt_component IN matchcheck.tgt_components %]
322 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
323 <legend>Target (database) record check field</legend>
326 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
327 <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" />
330 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
331 <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" />
334 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
335 <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" />
338 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
339 <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" />
341 [% FOREACH norm IN tgt_component.norms %]
342 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
343 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
344 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
345 [% 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" %]
349 </fieldset> <!-- /#mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %] -->
350 [% END # /FOREACH tgt_component %]
351 </fieldset> <!-- /.rows -->
352 <br style="clear:both;" />
353 </div> <!-- /#mc_[% matchcheck.mc_num | html %] -->
354 [% END # /FOREACH matchcheck %]
355 [% ELSE # IF ( edit_matching_rule ) %]
356 <div id="mc_1" class="matchgroup">
357 <fieldset class="rows">
358 <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>
359 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
360 <fieldset class="rows" id="mc_1_src_c_1">
361 <legend>Source (incoming) record check field</legend>
364 <label for="mc_1_src_c_1_tag">Tag: </label>
365 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
368 <label for="mc_1_src_c_1_subfields">Subfields: </label>
369 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
372 <label for="mc_1_src_c_1_offset">Offset: </label>
373 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
376 <label for="mc_1_src_c_1_length">Length: </label>
377 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
379 <li id="mc_1_src_c_1_n_1">
380 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
381 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
386 <fieldset class="rows" id="mc_1_tgt_c_1">
387 <legend>Target (database) record check field</legend>
390 <label for="mc_1_tgt_c_1_tag">Tag: </label>
391 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
394 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
395 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
398 <label for="mc_1_tgt_c_1_offset">Offset: </label>
399 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
402 <label for="mc_1_tgt_c_1_length">Length: </label>
403 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
405 <li id="mc_1_tgt_c_1_n_1">
406 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
407 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
410 </fieldset> <!-- /#mc_1_tgt_c_1 -->
411 </fieldset> <!-- /.rows -->
412 <br style="clear:both;" />
413 </div> <!-- /#mc_1 -->
414 [% END # /IF ( edit_matching_rule ) %]
416 <fieldset class="action">
417 [% IF ( edit_matching_rule ) %]
418 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
420 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
422 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
423 </fieldset> <!-- /.action -->
425 [% END # /IF ( matching_rule_form ) %]
427 [% IF ( delete_matching_rule_form ) %]
428 <div class="dialog alert">
429 <h3>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h3>
430 <form action="[% script_name | html %]" name="Aform" method="post">
431 <input type="hidden" name="op" value="[% confirm_op | html %]" />
432 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
433 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
435 <form action="[% script_name | html %]" method="get">
436 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
439 [% END # /IF ( delete_matching_rule_form ) %]
441 [% IF ( display_list ) %]
443 <div id="toolbar" class="btn-toolbar">
444 <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>
447 <h2>Record matching rules</h2>
449 [% IF ( added_matching_rule ) %]
450 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
452 [% IF ( edited_matching_rule ) %]
453 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
455 [% IF ( deleted_matching_rule ) %]
456 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
458 [% IF ( available_matching_rules ) %]
464 <th class="noExport">Actions</th>
466 [% FOREACH available_matching_rule IN available_matching_rules %]
468 <td>[% available_matching_rule.matcher_id | html %]</td>
469 <td>[% available_matching_rule.code | html %]</td>
470 <td>[% available_matching_rule.description | html %]</td>
472 <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>
473 <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>
479 <p>There are no saved matching rules.</p>
480 [% END # /IF ( available_matching_rules ) %]
482 <div class="pages">[% pagination_bar | $raw %]</div>
483 [% END # /IF ( display_list ) %]
485 [% IF ( matching_rule_form ) %]
486 <div id="mp_template" class="matchgroup" style="display:none;">
487 <fieldset class="rows">
488 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
491 <label for="mp_num_search_index">Search index: </label>
492 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" maxlength="30" />
495 <label for="mp_num_score">Score: </label>
496 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
499 <fieldset id="mp_num_c_1" class="rows">
500 <legend>Matchpoint components</legend>
503 <label for="mp_num_c_1_tag">Tag: </label>
504 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
507 <label for="mp_num_c_1_subfields">Subfields: </label>
508 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
511 <label for="mp_num_c_1_offset">Offset: </label>
512 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
515 <label for="mp_num_c_1_length">Length: </label>
516 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
518 <li id="mp_num_c_1_n_1">
519 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
520 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
523 </fieldset> <!-- /#mp_num_c_1 -->
524 </fieldset> <!-- /.rows -->
525 <br style="clear:both;" />
526 </div> <!-- /#mp_template -->
528 <div id="mc_template" class="matchgroup" style="display:none">
529 <fieldset class="rows">
530 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
531 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
532 <fieldset class="rows" id="mc_num_src_c_1">
533 <legend>Source (incoming) record check field</legend>
536 <label for="mc_num_src_c_1_tag">Tag: </label>
537 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
540 <label for="mc_num_src_c_1_subfields">Subfields: </label>
541 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
544 <label for="mc_num_src_c_1_offset">Offset: </label>
545 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
548 <label for="mc_num_src_c_1_length">Length: </label>
549 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
551 <li id="mc_num_src_c_1_n_1">
552 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
553 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
556 </fieldset> <!-- /#mc_num_src_c_1 -->
557 <fieldset class="rows" id="mc_num_tgt_c_1">
558 <legend>Target (database) record check field</legend>
561 <label for="mc_num_tgt_c_1_tag">Tag: </label>
562 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
565 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
566 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
569 <label for="mc_num_tgt_c_1_offset">Offset: </label>
570 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
573 <label for="mc_num_tgt_c_1_length">Length: </label>
574 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
576 <li id="mc_num_tgt_c_1_n_1">
577 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
578 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
581 </fieldset> <!-- #mc_num_tgt_c_1 -->
582 </fieldset> <!-- /.rows -->
583 <br style="clear:both;" />
584 </div> <!-- /#mc_template -->
585 [% END # /IF ( matching_rule_form ) %]
588 </div> <!-- /.col-sm-10.col-sm-push-2 -->
590 <div class="col-sm-2 col-sm-pull-10">
592 [% INCLUDE 'admin-menu.inc' %]
594 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
595 </div> <!-- /.row -->
597 [% MACRO jsinclude BLOCK %]
598 [% Asset.js("js/admin-menu.js") | $raw %]
600 var maxMatchPoint = [% max_matchpoint | html %];
601 var maxMatchCheck = [% max_matchcheck | html %];
603 function InsertMatchpoint(loc, index) {
604 var original= $("#"+index);
605 var clone = original.clone();
608 // update IDs and form names
610 clone.attr('id', 'mp_' + maxMatchPoint);
611 $("span.counter",clone).html(maxMatchPoint);
612 $("label",clone).each(function(){
613 var s = $(this).attr("for");
614 if (s.match(/mp_num/)) {
615 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
619 $("div",clone).each(function(){
620 var s = $(this).attr("id");
621 if (s.match(/mp_num/)) {
622 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
625 $("input",clone).each(function(){
626 var s = $(this).attr("id");
627 if(s.match(/mp_num/)){
628 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
631 var s = $(this).attr("name");
632 if(s.match(/mp_num/)){
633 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
636 $("#match_points").append(clone);
639 function InsertMatchcheck(loc, index) {
640 var original= $("#"+index);
641 var clone = original.clone();
644 // update IDs and form names
646 clone.attr('id', 'mc_' + maxMatchCheck);
647 $("span.counter",clone).html(maxMatchCheck);
648 $("label",clone).each(function(){
649 var s = $(this).attr("for");
650 if (s.match(/mc_num/)) {
651 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
655 $("div",clone).each(function(){
656 var s = $(this).attr("id");
657 if (s.match(/mc_num/)) {
658 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
661 $("input",clone).each(function(){
662 var s = $(this).attr("id");
663 if(s.match(/mc_num/)){
664 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
667 var s = $(this).attr("name");
668 if(s.match(/mc_num/)){
669 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
672 $("#match_checks").append(clone);
675 function DeleteMatchpoint(loc) {
676 $(loc).parent().parent().parent().remove();
677 if($(".matchgroup",$("#match_points")).length == 0){
679 $("#addMatchPoint").show();
683 function DeleteMatchcheck(loc) {
684 $(loc).parent().parent().parent().remove();
685 if($(".matchgroup",$("#match_checks")).length == 0){
687 $("#addMatchCheck").show();
691 function DoCancel(f) {
693 document.Aform.submit();
696 function CheckMatchingRuleForm(f) {
700 if (f.code.value.length==0) {
701 _alertString += "\n- " + _("Matching rule code missing");
703 if (f.description.value.length==0) {
704 _alertString += "\n- " + _("Description missing");
706 if (f.threshold.value.length==0) {
707 _alertString += "\n- " + _("Threshold missing");
709 if (_alertString.length==0) {
710 document.Aform.submit();
712 alertString2 = _("Form not submitted because of the following problem(s)");
713 alertString2 += "\n------------------------------------------------------------------------------------\n";
714 alertString2 += _alertString;
719 function CheckRuleForm(f) {
723 if (f.sort_rule.value.length==0) {
724 _alertString += "\n- " + _("Filing rule code missing");
726 if (f.description.value.length==0) {
727 _alertString += "\n- " + _("Description missing");
729 if (f.sort_routine.value.length==0) {
730 _alertString += "\n- " + _("Sort routine missing");
732 if (_alertString.length==0) {
733 document.Aform.submit();
735 alertString2 = _("Form not submitted because of the following problem(s)");
736 alertString2 += "\n------------------------------------------------------------------------------------\n";
737 alertString2 += _alertString;
743 [% INCLUDE 'intranet-bottom.inc' %]