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 %]
21 [% CASE 'none' %]<span>None</span>
22 [% CASE 'remove_spaces' %]<span>Remove spaces</span>
23 [% CASE 'upper_case' %]<span>Uppercase</span>
24 [% CASE 'lower_case' %]<span>Lowercase</span>
25 [% CASE 'legacy_default' %]<span>Legacy default</span>
26 [% CASE 'ISBN' %]<span>ISBN</span>
27 [% CASE %]<span>[% norm | html %]</span>
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 [% WRAPPER 'header.inc' %]
63 [% INCLUDE 'prefs-admin-search.inc' %]
66 [% WRAPPER 'sub-header.inc' %]
67 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
70 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
73 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
76 [% IF ( matching_rule_form ) %]
78 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
81 <a href="#" aria-current="page">
82 [% IF ( edit_matching_rule ) %]
83 Modify record matching rule
85 Add record matching rule
90 [% ELSIF ( delete_matching_rule_form ) %]
92 <a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>
95 <a href="#" aria-current="page">
96 Confirm deletion of record matching rule "[% code | html %]"
102 <a href="#" aria-current="page">
103 Record matching rules
108 </nav> <!-- /#breadcrumbs -->
112 <div class="main container-fluid">
114 <div class="col-sm-10 col-sm-push-2">
117 [% IF ( matching_rule_form ) %]
118 [% IF ( edit_matching_rule ) %]
119 <h1>Modify record matching rule</h1>
121 <h1>Add record matching rule</h1>
123 <form action="[% script_name | html %]" name="Aform" method="post">
124 <input type="hidden" name="op" value="[% confirm_op | html %]" />
125 <fieldset class="rows">
128 [% IF ( edit_matching_rule ) %]
129 <span class="label">Matching rule code: </span>
130 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
131 <input type="hidden" name="code" value="[% code | html %]" />
134 <label for="code" class="required focus">Matching rule code: </label>
135 <input type="text" id="code" name="code" size="10" maxlength="10" /> <span class="required">Required</span>
139 <label for="description" class="required">Description: </label>
140 <input type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> <span class="required">Required</span>
143 <label for="threshold" class="required">Match threshold: </label>
144 <input type="text" id="threshold" name="threshold" size="5" maxlength="5" value="[% threshold | html %]" /> <span class="required">Required</span>
147 <label for="record_type" class="required">Record type: </label>
148 <select id="record_type" name="record_type">
149 [% IF ( record_type == "authority" ) %]
150 <option value="biblio">Bibliographic record</option>
151 <option value="authority" selected="selected">Authority record</option>
153 <option value="biblio" selected="selected">Bibliographic record</option>
154 <option value="authority">Authority record</option>
156 </select><span class="required">Required</span>
159 </fieldset> <!-- /.rows -->
161 <fieldset class="rows" id="match_points">
162 <h4>Match points</h4>
163 [% IF ( edit_matching_rule ) %]
164 [% IF ( matchpoints ) %]
165 <p id="addMatchPoint" style="display:none;">
167 <p id="addMatchPoint">
169 <a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a>
172 <p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">
177 [% IF ( edit_matching_rule ) %]
178 [% FOREACH matchpoint IN matchpoints %]
179 <div id="mp_[% matchpoint.mp_num | html %]" class="matchgroup">
180 <fieldset class="rows">
181 <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>
184 <label for="mp_[% matchpoint.mp_num | html %]_search_index">Search index: </label>
185 <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" />
188 <label for="mp_[% matchpoint.mp_num | html %]_score">Score: </label>
189 <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" />
192 [% FOREACH component IN matchpoint.components %]
193 <fieldset class="rows" id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]">
194 <legend>Matchpoint components</legend>
197 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_tag">Tag: </label>
198 <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" />
201 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_subfields">Subfields: </label>
202 <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 %]"
203 size="10" maxlength="40" />
206 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_offset">Offset: </label>
207 <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 %]"
208 size="5" maxlength="5" />
211 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_length">Length: </label>
212 <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 %]"
213 size="5" maxlength="5" />
215 [% FOREACH norm IN component.norms %]
216 <li id="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n_[% norm.norm_num | html %]">
217 <label for="mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %]_n__[% norm.norm_num | html %]_norm">Normalization rule: </label>
218 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
219 [% 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" %]
223 </fieldset> <!-- /#mp_[% matchpoint.mp_num | html %]_c_[% component.comp_num | html %] -->
224 [% END #/FOREACH component %]
225 </fieldset> <!-- /.rows -->
226 <br style="clear:both;" />
227 </div> <!-- /#mp_[% matchpoint.mp_num | html %] -->
228 [% END # /FOREACH matchpoint %]
229 [% ELSE # IF ( edit_matching_rule ) %]
230 <div id="mp_1" class="matchgroup">
231 <fieldset class="rows">
232 <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>
235 <label for="mp_1_search_index">Search index: </label>
236 <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" maxlength="30" />
239 <label for="mp_1_score">Score: </label>
240 <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
243 <fieldset class="rows" id="mp_1_c_1">
244 <legend>Matchpoint components</legend>
247 <label for="mp_1_c_1_tag">Tag: </label>
248 <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
251 <label for="mp_1_c_1_subfields">Subfields: </label>
252 <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
255 <label for="mp_1_c_1_offset">Offset: </label>
256 <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
259 <label for="mp_1_c_1_length">Length: </label>
260 <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
262 <li id="mp_1_c_1_n_1">
263 <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
264 [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
267 </fieldset> <!-- /#mp_1_c_1 -->
268 </fieldset> <!-- /.rows -->
269 <br style="clear:both;" />
270 </div> <!-- /#mp_1 -->
271 [% END # /IF ( edit_matching_rule ) %]
272 </fieldset> <!-- /#match_points -->
274 <fieldset class="rows" id="match_checks">
275 <h4>Required match checks</h4>
276 [% IF ( edit_matching_rule ) %]
277 [% IF ( matchchecks ) %]
278 <p id="addMatchCheck" style="display:none;">
280 <p id="addMatchCheck">
282 <a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
284 <p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
287 [% IF ( edit_matching_rule ) %]
288 [% FOREACH matchcheck IN matchchecks %]
289 <div id="mc_[% matchcheck.mc_num | html %]" class="matchgroup">
290 <fieldset class="rows">
291 <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>
292 <input type="hidden" id="mc_[% matchcheck.mc_num | html %]_id" name="mc_[% matchcheck.mc_num | html %]_id" value="1" />
293 [% FOREACH src_component IN matchcheck.src_components %]
294 <fieldset class="rows" id="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]">
295 <legend>Source (incoming) record check field</legend>
298 <label for="mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %]_tag">Tag: </label>
299 <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" />
302 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_subfields">Subfields: </label>
303 <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" />
306 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_offset">Offset: </label>
307 <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" />
310 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_length">Length: </label>
311 <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" />
313 [% FOREACH norm IN src_component.norms %]
314 <li id="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]">
315 <label for="mc_[% matchcheck.mc_num | html %]_src_c_[% src_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
316 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
317 [% 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" %]
321 </fieldset> <!-- /#mc_[% src_component.mc_num | html %]_src_c_[% src_component.comp_num | html %] -->
322 [% END # /FOREACH src_component %]
324 [% FOREACH tgt_component IN matchcheck.tgt_components %]
325 <fieldset class="rows" id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]">
326 <legend>Target (database) record check field</legend>
329 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_tag">Tag: </label>
330 <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" />
333 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_subfields">Subfields: </label>
334 <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" />
337 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_offset">Offset: </label>
338 <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" />
341 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_length">Length: </label>
342 <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" />
344 [% FOREACH norm IN tgt_component.norms %]
345 <li id="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]">
346 <label for="mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %]_n_[% norm.norm_num | html %]_norm">Normalization rule: </label>
347 [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %]
348 [% 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" %]
352 </fieldset> <!-- /#mc_[% matchcheck.mc_num | html %]_tgt_c_[% tgt_component.comp_num | html %] -->
353 [% END # /FOREACH tgt_component %]
354 </fieldset> <!-- /.rows -->
355 <br style="clear:both;" />
356 </div> <!-- /#mc_[% matchcheck.mc_num | html %] -->
357 [% END # /FOREACH matchcheck %]
358 [% ELSE # IF ( edit_matching_rule ) %]
359 <div id="mc_1" class="matchgroup">
360 <fieldset class="rows">
361 <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>
362 <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
363 <fieldset class="rows" id="mc_1_src_c_1">
364 <legend>Source (incoming) record check field</legend>
367 <label for="mc_1_src_c_1_tag">Tag: </label>
368 <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
371 <label for="mc_1_src_c_1_subfields">Subfields: </label>
372 <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
375 <label for="mc_1_src_c_1_offset">Offset: </label>
376 <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
379 <label for="mc_1_src_c_1_length">Length: </label>
380 <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
382 <li id="mc_1_src_c_1_n_1">
383 <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
384 [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
389 <fieldset class="rows" id="mc_1_tgt_c_1">
390 <legend>Target (database) record check field</legend>
393 <label for="mc_1_tgt_c_1_tag">Tag: </label>
394 <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
397 <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
398 <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
401 <label for="mc_1_tgt_c_1_offset">Offset: </label>
402 <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
405 <label for="mc_1_tgt_c_1_length">Length: </label>
406 <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
408 <li id="mc_1_tgt_c_1_n_1">
409 <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
410 [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
413 </fieldset> <!-- /#mc_1_tgt_c_1 -->
414 </fieldset> <!-- /.rows -->
415 <br style="clear:both;" />
416 </div> <!-- /#mc_1 -->
417 [% END # /IF ( edit_matching_rule ) %]
419 <fieldset class="action">
420 [% IF ( edit_matching_rule ) %]
421 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
423 <input type="button" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
425 <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
426 </fieldset> <!-- /.action -->
428 [% END # /IF ( matching_rule_form ) %]
430 [% IF ( delete_matching_rule_form ) %]
431 <div class="dialog alert">
432 <h1>Confirm deletion of record matching rule <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h1>
433 <form action="[% script_name | html %]" name="Aform" method="post">
434 <input type="hidden" name="op" value="[% confirm_op | html %]" />
435 <input type="hidden" name="matcher_id" value="[% matcher_id | html %]" />
436 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
438 <form action="[% script_name | html %]" method="get">
439 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
442 [% END # /IF ( delete_matching_rule_form ) %]
444 [% IF ( display_list ) %]
446 <div id="toolbar" class="btn-toolbar">
447 <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>
450 <h1>Record matching rules</h1>
452 [% IF ( added_matching_rule ) %]
453 <div class="dialog message">Added record matching rule "[% added_matching_rule | html %]"</div>
455 [% IF ( edited_matching_rule ) %]
456 <div class="dialog message">Modified record matching rule "[% edited_matching_rule | html %]"</div>
458 [% IF ( deleted_matching_rule ) %]
459 <div class="dialog message">Deleted record matching rule "[% deleted_matching_rule | html %]"</div>
461 [% IF ( available_matching_rules ) %]
467 <th class="noExport">Actions</th>
469 [% FOREACH available_matching_rule IN available_matching_rules %]
471 <td>[% available_matching_rule.matcher_id | html %]</td>
472 <td>[% available_matching_rule.code | html %]</td>
473 <td>[% available_matching_rule.description | html %]</td>
475 <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>
476 <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>
482 <p>There are no saved matching rules.</p>
483 [% END # /IF ( available_matching_rules ) %]
485 <div class="pages">[% pagination_bar | $raw %]</div>
486 [% END # /IF ( display_list ) %]
488 [% IF ( matching_rule_form ) %]
489 <div id="mp_template" class="matchgroup" style="display:none;">
490 <fieldset class="rows">
491 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
494 <label for="mp_num_search_index">Search index: </label>
495 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" maxlength="30" />
498 <label for="mp_num_score">Score: </label>
499 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
502 <fieldset id="mp_num_c_1" class="rows">
503 <legend>Matchpoint components</legend>
506 <label for="mp_num_c_1_tag">Tag: </label>
507 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
510 <label for="mp_num_c_1_subfields">Subfields: </label>
511 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
514 <label for="mp_num_c_1_offset">Offset: </label>
515 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
518 <label for="mp_num_c_1_length">Length: </label>
519 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
521 <li id="mp_num_c_1_n_1">
522 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
523 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
526 </fieldset> <!-- /#mp_num_c_1 -->
527 </fieldset> <!-- /.rows -->
528 <br style="clear:both;" />
529 </div> <!-- /#mp_template -->
531 <div id="mc_template" class="matchgroup" style="display:none">
532 <fieldset class="rows">
533 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
534 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
535 <fieldset class="rows" id="mc_num_src_c_1">
536 <legend>Source (incoming) record check field</legend>
539 <label for="mc_num_src_c_1_tag">Tag: </label>
540 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
543 <label for="mc_num_src_c_1_subfields">Subfields: </label>
544 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
547 <label for="mc_num_src_c_1_offset">Offset: </label>
548 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
551 <label for="mc_num_src_c_1_length">Length: </label>
552 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
554 <li id="mc_num_src_c_1_n_1">
555 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
556 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
559 </fieldset> <!-- /#mc_num_src_c_1 -->
560 <fieldset class="rows" id="mc_num_tgt_c_1">
561 <legend>Target (database) record check field</legend>
564 <label for="mc_num_tgt_c_1_tag">Tag: </label>
565 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
568 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
569 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
572 <label for="mc_num_tgt_c_1_offset">Offset: </label>
573 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
576 <label for="mc_num_tgt_c_1_length">Length: </label>
577 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
579 <li id="mc_num_tgt_c_1_n_1">
580 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
581 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
584 </fieldset> <!-- #mc_num_tgt_c_1 -->
585 </fieldset> <!-- /.rows -->
586 <br style="clear:both;" />
587 </div> <!-- /#mc_template -->
588 [% END # /IF ( matching_rule_form ) %]
591 </div> <!-- /.col-sm-10.col-sm-push-2 -->
593 <div class="col-sm-2 col-sm-pull-10">
595 [% INCLUDE 'admin-menu.inc' %]
597 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
598 </div> <!-- /.row -->
600 [% MACRO jsinclude BLOCK %]
601 [% Asset.js("js/admin-menu.js") | $raw %]
603 var maxMatchPoint = [% max_matchpoint | html %];
604 var maxMatchCheck = [% max_matchcheck | html %];
606 function InsertMatchpoint(loc, index) {
607 var original= $("#"+index);
608 var clone = original.clone();
611 // update IDs and form names
613 clone.attr('id', 'mp_' + maxMatchPoint);
614 $("span.counter",clone).html(maxMatchPoint);
615 $("label",clone).each(function(){
616 var s = $(this).attr("for");
617 if (s.match(/mp_num/)) {
618 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
622 $("div",clone).each(function(){
623 var s = $(this).attr("id");
624 if (s.match(/mp_num/)) {
625 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
628 $("input",clone).each(function(){
629 var s = $(this).attr("id");
630 if(s.match(/mp_num/)){
631 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
634 var s = $(this).attr("name");
635 if(s.match(/mp_num/)){
636 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
639 $("#match_points").append(clone);
642 function InsertMatchcheck(loc, index) {
643 var original= $("#"+index);
644 var clone = original.clone();
647 // update IDs and form names
649 clone.attr('id', 'mc_' + maxMatchCheck);
650 $("span.counter",clone).html(maxMatchCheck);
651 $("label",clone).each(function(){
652 var s = $(this).attr("for");
653 if (s.match(/mc_num/)) {
654 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
658 $("div",clone).each(function(){
659 var s = $(this).attr("id");
660 if (s.match(/mc_num/)) {
661 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
664 $("input",clone).each(function(){
665 var s = $(this).attr("id");
666 if(s.match(/mc_num/)){
667 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
670 var s = $(this).attr("name");
671 if(s.match(/mc_num/)){
672 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
675 $("#match_checks").append(clone);
678 function DeleteMatchpoint(loc) {
679 $(loc).parent().parent().parent().remove();
680 if($(".matchgroup",$("#match_points")).length == 0){
682 $("#addMatchPoint").show();
686 function DeleteMatchcheck(loc) {
687 $(loc).parent().parent().parent().remove();
688 if($(".matchgroup",$("#match_checks")).length == 0){
690 $("#addMatchCheck").show();
694 function DoCancel(f) {
696 document.Aform.submit();
699 function CheckMatchingRuleForm(f) {
703 if (f.code.value.length==0) {
704 _alertString += "\n- " + _("Matching rule code missing");
706 if (f.description.value.length==0) {
707 _alertString += "\n- " + _("Description missing");
709 if (f.threshold.value.length==0) {
710 _alertString += "\n- " + _("Threshold missing");
712 if (_alertString.length==0) {
713 document.Aform.submit();
715 alertString2 = _("Form not submitted because of the following problem(s)");
716 alertString2 += "\n------------------------------------------------------------------------------------\n";
717 alertString2 += _alertString;
722 function CheckRuleForm(f) {
726 if (f.sort_rule.value.length==0) {
727 _alertString += "\n- " + _("Filing rule code missing");
729 if (f.description.value.length==0) {
730 _alertString += "\n- " + _("Description missing");
732 if (f.sort_routine.value.length==0) {
733 _alertString += "\n- " + _("Sort routine missing");
735 if (_alertString.length==0) {
736 document.Aform.submit();
738 alertString2 = _("Form not submitted because of the following problem(s)");
739 alertString2 += "\n------------------------------------------------------------------------------------\n";
740 alertString2 += _alertString;
746 [% INCLUDE 'intranet-bottom.inc' %]