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">Home</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" class="btn btn-primary" value="Save" onclick="CheckMatchingRuleForm(this.form)" />
423 <input type="button" class="btn btn-primary" 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 ) %]
462 <div class="page-section">
468 <th class="noExport">Actions</th>
470 [% FOREACH available_matching_rule IN available_matching_rules %]
472 <td>[% available_matching_rule.matcher_id | html %]</td>
473 <td>[% available_matching_rule.code | html %]</td>
474 <td>[% available_matching_rule.description | html %]</td>
476 <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>
477 <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 </div> <!-- /.page-section -->
484 <p>There are no saved matching rules.</p>
485 [% END # /IF ( available_matching_rules ) %]
487 <div class="pages">[% pagination_bar | $raw %]</div>
488 [% END # /IF ( display_list ) %]
490 [% IF ( matching_rule_form ) %]
491 <div id="mp_template" class="matchgroup" style="display:none;">
492 <fieldset class="rows">
493 <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
496 <label for="mp_num_search_index">Search index: </label>
497 <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" maxlength="30" />
500 <label for="mp_num_score">Score: </label>
501 <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
504 <fieldset id="mp_num_c_1" class="rows">
505 <legend>Matchpoint components</legend>
508 <label for="mp_num_c_1_tag">Tag: </label>
509 <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
512 <label for="mp_num_c_1_subfields">Subfields: </label>
513 <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
516 <label for="mp_num_c_1_offset">Offset: </label>
517 <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
520 <label for="mp_num_c_1_length">Length: </label>
521 <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
523 <li id="mp_num_c_1_n_1">
524 <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
525 [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
528 </fieldset> <!-- /#mp_num_c_1 -->
529 </fieldset> <!-- /.rows -->
530 <br style="clear:both;" />
531 </div> <!-- /#mp_template -->
533 <div id="mc_template" class="matchgroup" style="display:none">
534 <fieldset class="rows">
535 <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
536 <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
537 <fieldset class="rows" id="mc_num_src_c_1">
538 <legend>Source (incoming) record check field</legend>
541 <label for="mc_num_src_c_1_tag">Tag: </label>
542 <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
545 <label for="mc_num_src_c_1_subfields">Subfields: </label>
546 <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
549 <label for="mc_num_src_c_1_offset">Offset: </label>
550 <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
553 <label for="mc_num_src_c_1_length">Length: </label>
554 <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
556 <li id="mc_num_src_c_1_n_1">
557 <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
558 [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
561 </fieldset> <!-- /#mc_num_src_c_1 -->
562 <fieldset class="rows" id="mc_num_tgt_c_1">
563 <legend>Target (database) record check field</legend>
566 <label for="mc_num_tgt_c_1_tag">Tag: </label>
567 <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
570 <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
571 <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
574 <label for="mc_num_tgt_c_1_offset">Offset: </label>
575 <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
578 <label for="mc_num_tgt_c_1_length">Length: </label>
579 <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
581 <li id="mc_num_tgt_c_1_n_1">
582 <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
583 [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
586 </fieldset> <!-- #mc_num_tgt_c_1 -->
587 </fieldset> <!-- /.rows -->
588 <br style="clear:both;" />
589 </div> <!-- /#mc_template -->
590 [% END # /IF ( matching_rule_form ) %]
593 </div> <!-- /.col-sm-10.col-sm-push-2 -->
595 <div class="col-sm-2 col-sm-pull-10">
597 [% INCLUDE 'admin-menu.inc' %]
599 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
600 </div> <!-- /.row -->
602 [% MACRO jsinclude BLOCK %]
603 [% Asset.js("js/admin-menu.js") | $raw %]
605 var maxMatchPoint = [% max_matchpoint | html %];
606 var maxMatchCheck = [% max_matchcheck | html %];
608 function InsertMatchpoint(loc, index) {
609 var original= $("#"+index);
610 var clone = original.clone();
613 // update IDs and form names
615 clone.attr('id', 'mp_' + maxMatchPoint);
616 $("span.counter",clone).html(maxMatchPoint);
617 $("label",clone).each(function(){
618 var s = $(this).attr("for");
619 if (s.match(/mp_num/)) {
620 $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
624 $("div",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 $("input",clone).each(function(){
631 var s = $(this).attr("id");
632 if(s.match(/mp_num/)){
633 $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
636 var s = $(this).attr("name");
637 if(s.match(/mp_num/)){
638 $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
641 $("#match_points").append(clone);
644 function InsertMatchcheck(loc, index) {
645 var original= $("#"+index);
646 var clone = original.clone();
649 // update IDs and form names
651 clone.attr('id', 'mc_' + maxMatchCheck);
652 $("span.counter",clone).html(maxMatchCheck);
653 $("label",clone).each(function(){
654 var s = $(this).attr("for");
655 if (s.match(/mc_num/)) {
656 $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
660 $("div",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 $("input",clone).each(function(){
667 var s = $(this).attr("id");
668 if(s.match(/mc_num/)){
669 $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
672 var s = $(this).attr("name");
673 if(s.match(/mc_num/)){
674 $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
677 $("#match_checks").append(clone);
680 function DeleteMatchpoint(loc) {
681 $(loc).parent().parent().parent().remove();
682 if($(".matchgroup",$("#match_points")).length == 0){
684 $("#addMatchPoint").show();
688 function DeleteMatchcheck(loc) {
689 $(loc).parent().parent().parent().remove();
690 if($(".matchgroup",$("#match_checks")).length == 0){
692 $("#addMatchCheck").show();
696 function DoCancel(f) {
698 document.Aform.submit();
701 function CheckMatchingRuleForm(f) {
705 if (f.code.value.length==0) {
706 _alertString += "\n- " + _("Matching rule code missing");
708 if (f.description.value.length==0) {
709 _alertString += "\n- " + _("Description missing");
711 if (f.threshold.value.length==0) {
712 _alertString += "\n- " + _("Threshold missing");
714 if (_alertString.length==0) {
715 document.Aform.submit();
717 alertString2 = _("Form not submitted because of the following problem(s)");
718 alertString2 += "\n------------------------------------------------------------------------------------\n";
719 alertString2 += _alertString;
724 function CheckRuleForm(f) {
728 if (f.sort_rule.value.length==0) {
729 _alertString += "\n- " + _("Filing rule code missing");
731 if (f.description.value.length==0) {
732 _alertString += "\n- " + _("Description missing");
734 if (f.sort_routine.value.length==0) {
735 _alertString += "\n- " + _("Sort routine missing");
737 if (_alertString.length==0) {
738 document.Aform.submit();
740 alertString2 = _("Form not submitted because of the following problem(s)");
741 alertString2 += "\n------------------------------------------------------------------------------------\n";
742 alertString2 += _alertString;
748 [% INCLUDE 'intranet-bottom.inc' %]