Bug 16456: Reintroduce wording "Delete tag"
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / matching-rules.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Record matching rules
3 [% IF ( matching_rule_form ) %]
4   [% IF ( edit_matching_rule ) %]
5     &rsaquo; Modify record matching rule
6   [% ELSE %]
7     &rsaquo; Add record matching rule
8   [% END %]
9 [% END %]
10 [% IF ( delete_matching_rule_form ) %]
11   &rsaquo; Confirm deletion of record matching rule &quot;[% code %]&quot;
12 [% END %]
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15
16 <script type="text/javascript">
17 //<![CDATA[
18
19 var maxMatchPoint = [% max_matchpoint %];
20 var maxMatchCheck = [% max_matchcheck %];
21
22 function InsertMatchpoint(loc, index) {
23     var original= $("#"+index);
24     var clone = original.clone();
25     clone.show();
26
27     // update IDs and form names
28     maxMatchPoint++;
29     clone.attr('id', 'mp_' + maxMatchPoint);
30     $("span.counter",clone).html(maxMatchPoint);
31     $("label",clone).each(function(){
32       var s = $(this).attr("for");
33         if (s.match(/mp_num/)) {
34             $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
35         }
36     });
37
38     $("div",clone).each(function(){
39       var s = $(this).attr("id");
40         if (s.match(/mp_num/)) {
41             $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
42         }
43     });
44     $("input",clone).each(function(){
45         var s = $(this).attr("id");
46         if(s.match(/mp_num/)){
47           $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
48         }
49
50         var s = $(this).attr("name");
51         if(s.match(/mp_num/)){
52           $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
53         }
54     });
55     $("#match_points").append(clone);
56 }
57
58 function InsertMatchcheck(loc, index) {
59     var original= $("#"+index);
60     var clone = original.clone();
61     clone.show();
62
63     // update IDs and form names
64     maxMatchCheck++;
65     clone.attr('id', 'mc_' + maxMatchCheck);
66     $("span.counter",clone).html(maxMatchCheck);
67     $("label",clone).each(function(){
68       var s = $(this).attr("for");
69         if (s.match(/mc_num/)) {
70             $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
71         }
72     });
73
74     $("div",clone).each(function(){
75       var s = $(this).attr("id");
76         if (s.match(/mc_num/)) {
77             $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
78         }
79     });
80     $("input",clone).each(function(){
81         var s = $(this).attr("id");
82         if(s.match(/mc_num/)){
83           $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
84         }
85
86         var s = $(this).attr("name");
87         if(s.match(/mc_num/)){
88           $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
89         }
90     });
91     $("#match_checks").append(clone);
92 }
93
94 function DeleteMatchpoint(loc) {
95     $(loc).parent().parent().parent().remove();
96     if($(".matchgroup",$("#match_points")).length == 0){
97       maxMatchPoint = 0;
98       $("#addMatchPoint").show();
99     }
100 }
101
102 function DeleteMatchcheck(loc) {
103     $(loc).parent().parent().parent().remove();
104     if($(".matchgroup",$("#match_checks")).length == 0){
105       maxMatchCheck = 0;
106       $("#addMatchCheck").show();
107     }
108 }
109
110 function DoCancel(f) {
111   f.op.value='';
112   document.Aform.submit();
113 }
114
115 function CheckMatchingRuleForm(f) {
116     var ok=1;
117     var _alertString="";
118     var alertString2;
119     if (f.code.value.length==0) {
120         _alertString += "\n- " + _("Matching rule code missing");
121     }
122     if (f.description.value.length==0) {
123         _alertString += "\n- " + _("Description missing");
124     }
125     if (f.threshold.value.length==0) {
126         _alertString += "\n- " + _("Threshold missing");
127     }
128     if (_alertString.length==0) {
129         document.Aform.submit();
130     } else {
131         alertString2  = _("Form not submitted because of the following problem(s)");
132         alertString2 += "\n------------------------------------------------------------------------------------\n";
133         alertString2 += _alertString;
134         alert(alertString2);
135     }
136 }
137
138 function CheckRuleForm(f) {
139     var ok=1;
140     var _alertString="";
141     var alertString2;
142     if (f.sort_rule.value.length==0) {
143         _alertString += "\n- " + _("Filing rule code missing");
144     }
145     if (f.description.value.length==0) {
146         _alertString += "\n- " + _("Description missing");
147     }
148     if (f.sort_routine.value.length==0) {
149         _alertString += "\n- " + _("Sort routine missing");
150     }
151     if (_alertString.length==0) {
152         document.Aform.submit();
153     } else {
154         alertString2  = _("Form not submitted because of the following problem(s)");
155         alertString2 += "\n------------------------------------------------------------------------------------\n";
156         alertString2 += _alertString;
157         alert(alertString2);
158     }
159 }
160
161 //]]>
162 </script>
163 <style type="text/css">
164   fieldset.rows fieldset.rows { border-width : 0; }
165   fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
166   fieldset, fieldset.rows { width : 90%; padding: .3em .6em .3em .6em; }
167         fieldset.rows fieldset {font-size:100%;}
168   div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
169 </style>
170 </head>
171 <body id="admin_matching-rules" class="admin">
172 [% INCLUDE 'header.inc' %]
173 [% INCLUDE 'cat-search.inc' %]
174
175 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( display_list ) %]Record matching rules[% ELSE %]<a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a>[% END %]
176 [% IF ( matching_rule_form ) %]
177   [% IF ( edit_matching_rule ) %]
178     &rsaquo; Modify record matching rule
179   [% ELSE %]
180     &rsaquo; Add record matching rule
181   [% END %]
182 [% END %]
183 [% IF ( delete_matching_rule_form ) %]
184   &rsaquo; Confirm deletion of record matching rule &quot;[% code %]&quot;
185 [% END %]
186 </div>
187
188 <div id="doc3" class="yui-t2">
189
190    <div id="bd">
191     <div id="yui-main">
192     <div class="yui-b">
193
194 [% IF ( matching_rule_form ) %]
195   [% IF ( edit_matching_rule ) %]
196 <h2>Modify record matching rule</h2>
197   [% ELSE %]
198 <h2>Add record matching rule</h2>
199   [% END %]
200 <form action="[% script_name %]" name="Aform" method="post">
201   <input type="hidden" name="op" value="[% confirm_op %]" />
202   <fieldset class="rows">
203     <ol>
204       <li>
205           [% IF ( edit_matching_rule ) %]
206                   <span class="label">Matching rule code: </span>
207             <input type="hidden" name="matcher_id" value="[% matcher_id %]" />
208             <input type="hidden" name="code" value="[% code %]" />
209             [% code %]
210           [% ELSE %]
211                   <label for="code" class="required">Matching rule code: </label>
212             <input type="text" id="code" name="code"  size="10" maxlength="10" /> <span class="required">Required</span>
213           [% END %]
214        </li>
215        <li><label for="description" class="required">Description: </label>
216            <input type="text" id="description" name="description" size="50" maxlength="250" 
217                   value="[% description |html %]" /> <span class="required">Required</span>
218        </li>
219        <li><label for="threshold" class="required">Match threshold: </label>
220            <input type="text" id="threshold" name="threshold" size="5" maxlength="5" 
221                   value="[% threshold |html %]" /> <span class="required">Required</span>
222        </li>
223        <li><label for="record_type" class="required">Record type: </label>
224            <select id="record_type" name="record_type">
225                [% IF ( record_type == "authority" ) %]
226                    <option value="biblio">Bibliographic record</option>
227                    <option value="authority" selected="selected">Authority record</option>
228                [% ELSE %]
229                    <option value="biblio" selected="selected">Bibliographic record</option>
230                    <option value="authority">Authority record</option>
231                [% END %]
232            </select><span class="required">Required</span>
233        </li>
234     </ol>
235   </fieldset>
236
237   <fieldset class="rows" id="match_points">
238   <h4>Match points</h4>
239   [% IF ( edit_matching_rule ) %]
240   [% IF ( matchpoints ) %]<p id="addMatchPoint" style="display:none;">[% ELSE %]<p id="addMatchPoint">[% END %]<a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>
241   [% ELSE %]<p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>[% END %]
242   [% IF ( edit_matching_rule ) %]
243   [% FOREACH matchpoint IN matchpoints %]
244   <div id="mp_[% matchpoint.mp_num %]" class="matchgroup">
245   <fieldset class="rows">
246     <legend>Match point [% matchpoint.mp_num %] | <a href="#" class="button" onclick="InsertMatchpoint('mp_[% matchpoint.mp_num %]', 'mp_template'); return false;">Add match point</a> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
247     <ol>
248       <li>
249         <label for="mp_[% matchpoint.mp_num %]_search_index">Search index: </label>
250         <input type ="text" id="mp_[% matchpoint.mp_num %]_search_index" 
251                name="mp_[% matchpoint.mp_num %]_search_index" size="20" 
252                value="[% matchpoint.index |html %]"
253           maxlength="30" />
254       </li>
255       <li>
256         <label for="mp_[% matchpoint.mp_num %]_score">Score: </label>
257         <input type ="text" id="mp_[% matchpoint.mp_num %]_score" 
258                name="mp_[% matchpoint.mp_num %]_score" size="5"
259                value="[% matchpoint.score |html %]" 
260                maxlength="5" />
261       </li>
262       </ol>
263       [% FOREACH component IN matchpoint.components %]
264       <fieldset class="rows" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]">
265       <legend>Matchpoint components</legend>
266         <ol>
267           <li>
268             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
269             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
270                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
271                    value="[% component.tag |html %]"
272                    size="3" maxlength="3" />
273           </li>
274           <li>
275             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
276             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
277                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
278                    value="[% component.subfields |html %]"
279                    size="10" maxlength="40" />
280           </li>
281           <li>
282             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
283             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
284                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
285                    value="[% component.offset |html %]"
286                    size="5" maxlength="5" />
287           </li>
288           <li>
289             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
290             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
291                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
292                    value="[% component.length |html %]"
293                    size="5" maxlength="5" />
294           </li>
295               [% FOREACH norm IN component.norms %]
296               <li id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]">
297                 <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
298                 <input type="text" id="mp_[% norm.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm" 
299                        name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]_norm" 
300                        value="[% norm.norm |html %]"
301                        size="20" maxlength="50" />
302               </li>
303               [% END %]
304         </ol>
305       </fieldset>
306       [% END %]
307       </fieldset>
308       <br style="clear:both;" />
309       </div>
310   </fieldset>
311
312   [% END %]
313   [% ELSE %]
314   <div id="mp_1" class="matchgroup">
315   <fieldset class="rows">
316     <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>
317     <ol>
318       <li>
319         <label for="mp_1_search_index">Search index: </label>
320         <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" 
321           maxlength="30" />
322       </li>
323       <li>
324         <label for="mp_1_score">Score: </label>
325         <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
326       </li>
327     </ol>
328     <fieldset class="rows" id="mp_1_c_1">
329       <legend>Matchpoint components</legend>
330         <ol>
331           <li>
332             <label for="mp_1_c_1_tag">Tag: </label>
333             <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
334           </li>
335           <li>
336             <label for="mp_1_c_1_subfields">Subfields: </label>
337             <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
338           </li>
339           <li>
340             <label for="mp_1_c_1_offset">Offset: </label>
341             <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
342           </li>
343           <li>
344             <label for="mp_1_c_1_length">Length: </label>
345             <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
346           </li>
347             <li id="mp_1_c_1_n_1">
348               <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
349               <input type="text" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" size="20" maxlength="50" />
350             </li>
351         </ol>
352     </fieldset>
353     </fieldset>
354       <br style="clear:both;" />
355       </div>
356
357   </fieldset>
358   [% END %]
359
360   <fieldset class="rows" id="match_checks">
361   <h4>Required match checks</h4>
362   [% IF ( edit_matching_rule ) %]
363   [% IF ( matchchecks ) %]<p id="addMatchCheck" style="display:none;">[% ELSE %]<p id="addMatchCheck">[% END %]<a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
364   [% ELSE %]<p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>[% END %]
365   [% IF ( edit_matching_rule ) %]
366   [% FOREACH matchcheck IN matchchecks %]
367   <fieldset class="rows" id="mc_[% matchcheck.mc_num %]">
368     <legend>Match check [% matchcheck.mc_num %]<a href="#" class="button" onclick="InsertMatchcheck('mc_[% matchcheck.mc_num %]', 'mc_template'); return false;">Add match check</a> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
369     <input type="hidden" id="mc_[% matchcheck.mc_num %]_id" name="mc_[% matchcheck.mc_num %]_id" value="1" />
370       [% FOREACH src_component IN matchcheck.src_components %]
371       <fieldset class="rows" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]">
372         <legend>Source (incoming) record check field</legend>
373         <ol>
374           <li>
375             <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
376             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
377                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
378                    value="[% src_component.tag |html %]"
379                    size="3" maxlength="3" />
380           </li>
381           <li>
382             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
383             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
384                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
385                    value="[% src_component.subfields |html %]"
386                    size="10" maxlength="40" />
387           </li>
388           <li>
389             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
390             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
391                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
392                    value="[% src_component.offset |html %]"
393                    size="5" maxlength="5" />
394           </li>
395           <li>
396             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
397             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
398                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
399                    value="[% src_component.length |html %]"
400                    size="5" maxlength="5" />
401           </li>
402           [% FOREACH norm IN src_component.norms %]
403             <li id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]">
404               <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
405               <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
406                      name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
407                     value="[% norm.norm |html %]"
408                     size="20" maxlength="50" />
409             </li>
410           [% END %]
411         </ol>
412       </fieldset>
413       [% END %]
414       [% FOREACH tgt_component IN matchcheck.tgt_components %]
415       <fieldset class="rows" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
416         <legend>Target (database) record check field</legend>
417         <ol>
418           <li>
419             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
420             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
421                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
422                    value="[% tgt_component.tag |html %]"
423                    size="3" maxlength="3" />
424           </li>
425           <li>
426             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
427             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
428                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
429                    value="[% tgt_component.subfields |html %]"
430                    size="10" maxlength="40" />
431           </li>
432           <li>
433             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
434             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
435                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
436                    value="[% tgt_component.offset |html %]"
437                    size="5" maxlength="5" />
438           </li>
439           <li>
440             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
441             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
442                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
443                    value="[% tgt_component.length |html %]"
444                    size="5" maxlength="5" />
445           </li>
446           [% FOREACH norm IN tgt_component.norms %]
447             <li id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]">
448               <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
449               <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
450                      name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
451                     value="[% norm.norm |html %]"
452                     size="20" maxlength="50" />
453             </li>
454           [% END %]
455         </ol>
456       </fieldset>
457       [% END %]
458   </fieldset>
459   [% END %]
460   [% ELSE %]
461   <div id="mc_1" class="matchgroup">
462   <fieldset class="rows">
463     <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>
464     <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
465       <fieldset class="rows" id="mc_1_src_c_1">
466         <legend>Source (incoming) record check field</legend>
467         <ol>
468           <li>
469             <label for="mc_1_src_c_1_tag">Tag: </label>
470             <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
471           </li>
472           <li>
473             <label for="mc_1_src_c_1_subfields">Subfields: </label>
474             <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
475           </li>
476           <li>
477             <label for="mc_1_src_c_1_offset">Offset: </label>
478             <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
479           </li>
480           <li>
481             <label for="mc_1_src_c_1_length">Length: </label>
482             <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
483           </li>
484             <li id="mc_1_src_c_1_n_1">
485               <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
486               <input type="text" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" size="20" maxlength="50" />
487             </li>
488         </ol>
489       </fieldset>
490
491       <fieldset class="rows" id="mc_1_tgt_c_1">
492         <legend>Target (database) record check field</legend>
493         <ol>
494           <li>
495             <label for="mc_1_tgt_c_1_tag">Tag: </label>
496             <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
497           </li>
498           <li>
499             <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
500             <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
501           </li>
502           <li>
503             <label for="mc_1_tgt_c_1_offset">Offset: </label>
504             <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
505           </li>
506           <li>
507             <label for="mc_1_tgt_c_1_length">Length: </label>
508             <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
509           </li>
510             <li id="mc_1_tgt_c_1_n_1">
511               <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
512               <input type="text" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" size="20" maxlength="50" />
513             </li>
514         </ol>
515       </fieldset>
516   </fieldset>
517   <br style="clear:both;" />
518   </div>
519   [% END %]
520   </fieldset>
521   <fieldset class="action">
522     [% IF ( edit_matching_rule ) %]
523     <input type="button" value="Save"
524            onclick="CheckMatchingRuleForm(this.form)" />
525     [% ELSE %]
526     <input type="button" value="Save"
527            onclick="CheckMatchingRuleForm(this.form)" />
528     [% END %]
529     <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
530   </fieldset>
531 </form>
532 [% END %]
533
534 [% IF ( delete_matching_rule_form ) %]
535     <div class="dialog alert">
536         <h3>Confirm deletion of record matching rule <span class="ex">'[% code %]' ([% description %])</span>?</h3>
537         <form action="[% script_name %]" name="Aform" method="post">
538             <input type="hidden" name="op" value="[% confirm_op %]" />
539             <input type="hidden" name="matcher_id" value="[% matcher_id %]" />
540             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
541         </form>
542         <form action="[% script_name %]" method="get">
543             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
544         </form>
545     </div>
546 [% END %]
547
548 [% IF ( display_list ) %]
549
550 <div id="toolbar" class="btn-toolbar">
551     <a class="btn btn-small" id="newrule" href="[% script_name %]?op=add_matching_rule"><i class="fa fa-plus"></i> New record matching rule</a>
552 </div>
553
554 <h2>Record matching rules</h2>
555 [% IF ( added_matching_rule ) %]
556 <div class="dialog message">Added record matching rule &quot;[% added_matching_rule %]&quot;</div>
557 [% END %]
558 [% IF ( edited_matching_rule ) %]
559 <div class="dialog message">Modified record matching rule &quot;[% edited_matching_rule %]&quot;</div>
560 [% END %]
561 [% IF ( deleted_matching_rule ) %]
562 <div class="dialog message">Deleted record matching rule &quot;[% deleted_matching_rule %]&quot;</div>
563 [% END %]
564 [% IF ( available_matching_rules ) %]<table>
565   <tr>
566     <th>#</th>
567     <th>Code</th>
568     <th>Description</th>
569     <th>Actions</th>
570   </tr>
571   [% FOREACH available_matching_rule IN available_matching_rules %]
572   <tr>
573     <td>[% available_matching_rule.matcher_id %]</td>
574     <td>[% available_matching_rule.code %]</td>
575     <td>[% available_matching_rule.description %]</td>
576     <td class="actions">
577       <a class="btn btn-mini" href="[% available_matching_rule.script_name %]?op=edit_matching_rule&amp;matcher_id=[% available_matching_rule.matcher_id |html %]"><i class="fa fa-pencil"></i> Edit</a>
578       <a class="btn btn-mini" href="[% available_matching_rule.script_name %]?op=delete_matching_rule&amp;matcher_id=[% available_matching_rule.matcher_id |html %]"><i class="fa fa-trash"></i> Delete</a>
579     </td>
580   </tr>
581   [% END %]
582 </table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
583
584 <div class="pages">[% pagination_bar %]</div>
585
586 [% END %]
587  [% IF ( matching_rule_form ) %]
588 <div id="mp_template" class="matchgroup" style="display:none;">
589   <fieldset class="rows">
590     <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
591     <ol>
592       <li>
593         <label for="mp_num_search_index">Search index: </label>
594         <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" 
595           maxlength="30" />
596       </li>
597       <li>
598         <label for="mp_num_score">Score: </label>
599         <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
600       </li>
601     </ol>
602       <fieldset id="mp_num_c_1" class="rows">
603       <legend>Matchpoint components</legend>
604         <ol>
605           <li>
606             <label for="mp_num_c_1_tag">Tag: </label>
607             <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
608           </li>
609           <li>
610             <label for="mp_num_c_1_subfields">Subfields: </label>
611             <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
612           </li>
613           <li>
614             <label for="mp_num_c_1_offset">Offset: </label>
615             <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
616           </li>
617           <li>
618             <label for="mp_num_c_1_length">Length: </label>
619             <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
620           </li>
621             <li id="mp_num_c_1_n_1">
622               <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
623               <input type="text" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" size="20" maxlength="50" />
624             </li>
625         </ol>
626       </fieldset>
627   </fieldset>
628       <br style="clear:both;" />
629       </div>
630
631 <div id="mc_template" class="matchgroup" style="display:none">
632 <fieldset class="rows">
633   <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
634   <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
635     <fieldset class="rows" id="mc_num_src_c_1">
636       <legend>Source (incoming) record check field</legend>
637       <ol>
638         <li>
639           <label for="mc_num_src_c_1_tag">Tag: </label>
640           <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
641         </li>
642         <li>
643           <label for="mc_num_src_c_1_subfields">Subfields: </label>
644           <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
645         </li>
646         <li>
647           <label for="mc_num_src_c_1_offset">Offset: </label>
648           <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
649         </li>
650         <li>
651           <label for="mc_num_src_c_1_length">Length: </label>
652           <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
653         </li>
654           <li id="mc_num_src_c_1_n_1">
655             <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
656             <input type="text" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" size="20" maxlength="50" />
657           </li>
658       </ol>
659     </fieldset>
660     <fieldset class="rows" id="mc_num_tgt_c_1">
661       <legend>Target (database) record check field</legend>
662       <ol>
663         <li>
664           <label for="mc_num_tgt_c_1_tag">Tag: </label>
665           <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
666         </li>
667         <li>
668           <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
669           <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
670         </li>
671         <li>
672           <label for="mc_num_tgt_c_1_offset">Offset: </label>
673           <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
674         </li>
675         <li>
676           <label for="mc_num_tgt_c_1_length">Length: </label>
677           <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
678         </li>
679           <li id="mc_num_tgt_c_1_n_1">
680             <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
681             <input type="text" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" size="20" maxlength="50" />
682           </li>
683       </ol>
684     </fieldset>
685 </fieldset>
686 <br style="clear:both;" />
687 </div>
688 [% END %]
689
690 </div>
691 </div>
692 <div class="yui-b">
693 [% INCLUDE 'admin-menu.inc' %]
694 </div>
695 </div>
696 [% INCLUDE 'intranet-bottom.inc' %]