4 [% INCLUDE 'doc-head-open.inc' %]
6 [% IF ( matching_rule_form ) %]
7 [% IF ( edit_matching_rule ) %]
8 Modify record matching rule › [% ELSE %]
9 Add record matching rule › [% END %]
12 [% IF ( delete_matching_rule_form ) %]
13 Confirm deletion of record matching rule "[% code | html %]" › [% END %]
15 Record matching rules › Administration › Koha
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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
68 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
71 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
74 [% IF ( matching_rule_form ) %]
76 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
79 <a href="#" aria-current="page">
80 [% IF ( edit_matching_rule ) %]
81 Modify record matching rule
83 Add record matching rule
88 [% ELSIF ( delete_matching_rule_form ) %]
90 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
93 <a href="#" aria-current="page">
94 Confirm deletion of record matching rule "[% code | html %]"
100 <a href="#" aria-current="page">
101 Record matching rules
106 </nav> <!-- /#breadcrumbs -->
108 <div class="main container-fluid">
110 <div class="col-sm-10 col-sm-push-2">
113 [% IF ( matching_rule_form ) %]
114 [% IF ( edit_matching_rule ) %]
115 <h2>Modify record matching rule</h2>
117 <h2>Add record matching rule</h2>
119 <form action="[% script_name | html %]" name="Aform" method="post">
120 <input type="hidden" name="op" value="[% confirm_op | html %]" />
121 <fieldset class="rows">
124 [% IF ( edit_matching_rule ) %]
125 <span class="label">Matching rule code: </span>
126 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
127 <input type="hidden" name="code" value="[% code | html %]" />
130 <label for="code" class="required">Matching rule code: </label>
131 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
135 <label for="description" class="required">Description: </label>
136 <input type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> <span class="required">Required</span>
139 <label for="threshold" class="required">Match threshold: </label>
140 <input type="text" id="threshold" name="threshold" size="5" maxlength="5" value="[% threshold | html %]" /> <span class="required">Required</span>
143 <label for="record_type" class="required">Record type: </label>
144 <select id="record_type" name="record_type">
145 [% IF ( record_type == "authority" ) %]
146 <option value="biblio">Bibliographic record</option>
147 <option value="authority" selected="selected">Authority record</option>
149 <option value="biblio" selected="selected">Bibliographic record</option>
150 <option value="authority">Authority record</option>
152 </select><span class="required">Required</span>
155 </fieldset> <!-- /.rows -->
157 <fieldset class="rows" id="match_points">
158 <h4>Match points</h4>
159 [% IF ( edit_matching_rule ) %]
160 [% IF ( matchpoints ) %]
161 <p id="addMatchPoint" style="display:none;">
163 <p id="addMatchPoint">
165 <a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a>
168 <p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">
173 [% IF ( edit_matching_rule ) %]
174 [% FOREACH matchpoint IN matchpoints %]
175 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
176 <fieldset class="rows">
177 <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>
180 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
181 <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" />
184 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
185 <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" />
188 [% FOREACH component IN matchpoint.components %]
189 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
190 <legend>Matchpoint components</legend>
193 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
194 <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" />
197 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
198 <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 %]"
199 size="10" maxlength="40" />
202 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
203 <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 %]"
204 size="5" maxlength="5" />
207 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
208 <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 %]"
209 size="5" maxlength="5" />
211 [% FOREACH norm IN component.norms %]
212 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
213 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
214 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
215 [% 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" %]
219 </fieldset> <!-- /#mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %] -->
220 [% END #/FOREACH component %]
221 </fieldset> <!-- /.rows -->
222 <br style="clear:both;" />
223 </div> <!-- /#mp_[% matchpoint.mp_num | html %] -->
224 [% END # /FOREACH matchpoint %]
225 [% ELSE # IF ( edit_matching_rule ) %]
226 <div id="mp_1" class="matchgroup">
227 <fieldset class="rows">
228 <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>
231 <label for="mp_1_search_index">Search index: </label>
232 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" maxlength="30" />
235 <label for="mp_1_score">Score: </label>
236 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
239 <fieldset class="rows" id="mp_1_c_1">
240 <legend>Matchpoint components</legend>
243 <label for="mp_1_c_1_tag">Tag: </label>
244 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
247 <label for="mp_1_c_1_subfields">Subfields: </label>
248 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
251 <label for="mp_1_c_1_offset">Offset: </label>
252 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
255 <label for="mp_1_c_1_length">Length: </label>
256 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
258 <li id="mp_1_c_1_n_1">
259 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
260 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
263 </fieldset> <!-- /#mp_1_c_1 -->
264 </fieldset> <!-- /.rows -->
265 <br style="clear:both;" />
266 </div> <!-- /#mp_1 -->
267 [% END # /IF ( edit_matching_rule ) %]
268 </fieldset> <!-- /#match_points -->
270 <fieldset class="rows" id="match_checks">
271 <h4>Required match checks</h4>
272 [% IF ( edit_matching_rule ) %]
273 [% IF ( matchchecks ) %]
274 <p id="addMatchCheck" style="display:none;">
276 <p id="addMatchCheck">
278 <a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
280 <p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
283 [% IF ( edit_matching_rule ) %]
284 [% FOREACH matchcheck IN matchchecks %]
285 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
286 <fieldset class="rows">
287 <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>
288 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
289 [% FOREACH src_component IN matchcheck.src_components %]
290 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
291 <legend>Source (incoming) record check field</legend>
294 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
295 <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" />
298 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
299 <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" />
302 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
303 <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" />
306 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length">Length: </label>
307 <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" />
309 [% FOREACH norm IN src_component.norms %]
310 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
311 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
312 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
313 [% 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" %]
317 </fieldset> <!-- /#mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %] -->
318 [% END # /FOREACH src_component %]
320 [% FOREACH tgt_component IN matchcheck.tgt_components %]
321 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
322 <legend>Target (database) record check field</legend>
325 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
326 <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" />
329 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
330 <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" />
333 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
334 <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" />
337 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
338 <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" />
340 [% FOREACH norm IN tgt_component.norms %]
341 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
342 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
343 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
344 [% 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" %]
348 </fieldset> <!-- /#mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %] -->
349 [% END # /FOREACH tgt_component %]
350 </fieldset> <!-- /.rows -->
351 <br style="clear:both;" />
352 </div> <!-- /#mc_[% matchcheck.mc_num | html %] -->
353 [% END # /FOREACH matchcheck %]
354 [% ELSE # IF ( edit_matching_rule ) %]
355 <div id="mc_1" class="matchgroup">
356 <fieldset class="rows">
357 <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>
358 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
359 <fieldset class="rows" id="mc_1_src_c_1">
360 <legend>Source (incoming) record check field</legend>
363 <label for="mc_1_src_c_1_tag">Tag: </label>
364 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
367 <label for="mc_1_src_c_1_subfields">Subfields: </label>
368 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
371 <label for="mc_1_src_c_1_offset">Offset: </label>
372 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
375 <label for="mc_1_src_c_1_length">Length: </label>
376 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
378 <li id="mc_1_src_c_1_n_1">
379 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
380 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
385 <fieldset class="rows" id="mc_1_tgt_c_1">
386 <legend>Target (database) record check field</legend>
389 <label for="mc_1_tgt_c_1_tag">Tag: </label>
390 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
393 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
394 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
397 <label for="mc_1_tgt_c_1_offset">Offset: </label>
398 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
401 <label for="mc_1_tgt_c_1_length">Length: </label>
402 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
404 <li id="mc_1_tgt_c_1_n_1">
405 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
406 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
409 </fieldset> <!-- /#mc_1_tgt_c_1 -->
410 </fieldset> <!-- /.rows -->
411 <br style="clear:both;" />
412 </div> <!-- /#mc_1 -->
413 [% END # /IF ( edit_matching_rule ) %]
415 <fieldset class="action">
416 [% IF ( edit_matching_rule ) %]
417 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
419 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
421 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
422 </fieldset> <!-- /.action -->
424 [% END # /IF ( matching_rule_form ) %]
426 [% IF ( delete_matching_rule_form ) %]
427 <div class="dialog alert">
428 <h3>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h3>
429 <form action="[% script_name | html %]" name="Aform" method="post">
430 <input type="hidden" name="op" value="[% confirm_op | html %]" />
431 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
432 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
434 <form action="[% script_name | html %]" method="get">
435 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
438 [% END # /IF ( delete_matching_rule_form ) %]
440 [% IF ( display_list ) %]
442 <div id="toolbar" class="btn-toolbar">
443 <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>
446 <h2>Record matching rules</h2>
448 [% IF ( added_matching_rule ) %]
449 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
451 [% IF ( edited_matching_rule ) %]
452 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
454 [% IF ( deleted_matching_rule ) %]
455 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
457 [% IF ( available_matching_rules ) %]
463 <th class="noExport">Actions</th>
465 [% FOREACH available_matching_rule IN available_matching_rules %]
467 <td>[% available_matching_rule.matcher_id | html %]</td>
468 <td>[% available_matching_rule.code | html %]</td>
469 <td>[% available_matching_rule.description | html %]</td>
471 <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>
472 <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>
478 <p>There are no saved matching rules.</p>
479 [% END # /IF ( available_matching_rules ) %]
481 <div class="pages">[% pagination_bar | $raw %]</div>
482 [% END # /IF ( display_list ) %]
484 [% IF ( matching_rule_form ) %]
485 <div id="mp_template" class="matchgroup" style="display:none;">
486 <fieldset class="rows">
487 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
490 <label for="mp_num_search_index">Search index: </label>
491 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" maxlength="30" />
494 <label for="mp_num_score">Score: </label>
495 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
498 <fieldset id="mp_num_c_1" class="rows">
499 <legend>Matchpoint components</legend>
502 <label for="mp_num_c_1_tag">Tag: </label>
503 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
506 <label for="mp_num_c_1_subfields">Subfields: </label>
507 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
510 <label for="mp_num_c_1_offset">Offset: </label>
511 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
514 <label for="mp_num_c_1_length">Length: </label>
515 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
517 <li id="mp_num_c_1_n_1">
518 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
519 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
522 </fieldset> <!-- /#mp_num_c_1 -->
523 </fieldset> <!-- /.rows -->
524 <br style="clear:both;" />
525 </div> <!-- /#mp_template -->
527 <div id="mc_template" class="matchgroup" style="display:none">
528 <fieldset class="rows">
529 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
530 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
531 <fieldset class="rows" id="mc_num_src_c_1">
532 <legend>Source (incoming) record check field</legend>
535 <label for="mc_num_src_c_1_tag">Tag: </label>
536 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
539 <label for="mc_num_src_c_1_subfields">Subfields: </label>
540 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
543 <label for="mc_num_src_c_1_offset">Offset: </label>
544 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
547 <label for="mc_num_src_c_1_length">Length: </label>
548 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
550 <li id="mc_num_src_c_1_n_1">
551 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
552 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
555 </fieldset> <!-- /#mc_num_src_c_1 -->
556 <fieldset class="rows" id="mc_num_tgt_c_1">
557 <legend>Target (database) record check field</legend>
560 <label for="mc_num_tgt_c_1_tag">Tag: </label>
561 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
564 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
565 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
568 <label for="mc_num_tgt_c_1_offset">Offset: </label>
569 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
572 <label for="mc_num_tgt_c_1_length">Length: </label>
573 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
575 <li id="mc_num_tgt_c_1_n_1">
576 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
577 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
580 </fieldset> <!-- #mc_num_tgt_c_1 -->
581 </fieldset> <!-- /.rows -->
582 <br style="clear:both;" />
583 </div> <!-- /#mc_template -->
584 [% END # /IF ( matching_rule_form ) %]
587 </div> <!-- /.col-sm-10.col-sm-push-2 -->
589 <div class="col-sm-2 col-sm-pull-10">
591 [% INCLUDE 'admin-menu.inc' %]
593 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
594 </div> <!-- /.row -->
596 [% MACRO jsinclude BLOCK %]
597 [% Asset.js("js/admin-menu.js") | $raw %]
599 var maxMatchPoint = [% max_matchpoint | html %];
600 var maxMatchCheck = [% max_matchcheck | html %];
602 function InsertMatchpoint(loc, index) {
603 var original= $("#"+index);
604 var clone = original.clone();
607 // update IDs and form names
609 clone.attr('id', 'mp_' + maxMatchPoint);
610 $("span.counter",clone).html(maxMatchPoint);
611 $("label",clone).each(function(){
612 var s = $(this).attr("for");
613 if (s.match(/mp_num/)) {
614 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
618 $("div",clone).each(function(){
619 var s = $(this).attr("id");
620 if (s.match(/mp_num/)) {
621 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
624 $("input",clone).each(function(){
625 var s = $(this).attr("id");
626 if(s.match(/mp_num/)){
627 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
630 var s = $(this).attr("name");
631 if(s.match(/mp_num/)){
632 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
635 $("#match_points").append(clone);
638 function InsertMatchcheck(loc, index) {
639 var original= $("#"+index);
640 var clone = original.clone();
643 // update IDs and form names
645 clone.attr('id', 'mc_' + maxMatchCheck);
646 $("span.counter",clone).html(maxMatchCheck);
647 $("label",clone).each(function(){
648 var s = $(this).attr("for");
649 if (s.match(/mc_num/)) {
650 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
654 $("div",clone).each(function(){
655 var s = $(this).attr("id");
656 if (s.match(/mc_num/)) {
657 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
660 $("input",clone).each(function(){
661 var s = $(this).attr("id");
662 if(s.match(/mc_num/)){
663 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
666 var s = $(this).attr("name");
667 if(s.match(/mc_num/)){
668 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
671 $("#match_checks").append(clone);
674 function DeleteMatchpoint(loc) {
675 $(loc).parent().parent().parent().remove();
676 if($(".matchgroup",$("#match_points")).length == 0){
678 $("#addMatchPoint").show();
682 function DeleteMatchcheck(loc) {
683 $(loc).parent().parent().parent().remove();
684 if($(".matchgroup",$("#match_checks")).length == 0){
686 $("#addMatchCheck").show();
690 function DoCancel(f) {
692 document.Aform.submit();
695 function CheckMatchingRuleForm(f) {
699 if (f.code.value.length==0) {
700 _alertString += "\n- " + _("Matching rule code missing");
702 if (f.description.value.length==0) {
703 _alertString += "\n- " + _("Description missing");
705 if (f.threshold.value.length==0) {
706 _alertString += "\n- " + _("Threshold 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;
718 function CheckRuleForm(f) {
722 if (f.sort_rule.value.length==0) {
723 _alertString += "\n- " + _("Filing rule code missing");
725 if (f.description.value.length==0) {
726 _alertString += "\n- " + _("Description missing");
728 if (f.sort_routine.value.length==0) {
729 _alertString += "\n- " + _("Sort routine missing");
731 if (_alertString.length==0) {
732 document.Aform.submit();
734 alertString2 = _("Form not submitted because of the following problem(s)");
735 alertString2 += "\n------------------------------------------------------------------------------------\n";
736 alertString2 += _alertString;
742 [% INCLUDE 'intranet-bottom.inc' %]