Merge remote-tracking branch 'origin/new/bug_6634'
[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     </ol>
224   </fieldset>
225
226   <fieldset class="rows" id="match_points">
227   <h4>Match points</h4>
228   [% IF ( edit_matching_rule ) %]
229   [% 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>
230   [% 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 %]
231   [% IF ( edit_matching_rule ) %]
232   [% FOREACH matchpoint IN matchpoints %]
233   <div id="mp_[% matchpoint.mp_num %]" class="matchgroup">
234   <fieldset class="rows">
235     <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>
236     <ol>
237       <li>
238         <label for="mp_[% matchpoint.mp_num %]_search_index">Search index: </label>
239         <input type ="text" id="mp_[% matchpoint.mp_num %]_search_index" 
240                name="mp_[% matchpoint.mp_num %]_search_index" size="20" 
241                value="[% matchpoint.index |html %]"
242           maxlength="30" />
243       </li>
244       <li>
245         <label for="mp_[% matchpoint.mp_num %]_score">Score: </label>
246         <input type ="text" id="mp_[% matchpoint.mp_num %]_score" 
247                name="mp_[% matchpoint.mp_num %]_score" size="5"
248                value="[% matchpoint.score |html %]" 
249                maxlength="5" />
250       </li>
251       </ol>
252       [% FOREACH component IN matchpoint.components %]
253       <fieldset class="rows" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]">
254       <legend>Matchpoint components</legend>
255         <ol>
256           <li>
257             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
258             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
259                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag" 
260                    value="[% component.tag |html %]"
261                    size="3" maxlength="3" />
262           </li>
263           <li>
264             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
265             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
266                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields" 
267                    value="[% component.subfields |html %]"
268                    size="10" maxlength="40" />
269           </li>
270           <li>
271             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
272             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
273                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset" 
274                    value="[% component.offset |html %]"
275                    size="5" maxlength="5" />
276           </li>
277           <li>
278             <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
279             <input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
280                    name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length" 
281                    value="[% component.length |html %]"
282                    size="5" maxlength="5" />
283           </li>
284               [% FOREACH norm IN component.norms %]
285               <li id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]">
286                 <label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
287                 <input type="text" id="mp_[% norm.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm" 
288                        name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]_norm" 
289                        value="[% norm.norm |html %]"
290                        size="20" maxlength="50" />
291               </li>
292               [% END %]
293         </ol>
294       </fieldset>
295       [% END %]
296       </fieldset>
297       <br style="clear:both;" />
298       </div>
299   </fieldset>
300
301   [% END %]
302   [% ELSE %]
303   <div id="mp_1" class="matchgroup">
304   <fieldset class="rows">
305     <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>
306     <ol>
307       <li>
308         <label for="mp_1_search_index">Search index: </label>
309         <input type ="text" id="mp_1_search_index" name="mp_1_search_index" size="20" 
310           maxlength="30" />
311       </li>
312       <li>
313         <label for="mp_1_score">Score: </label>
314         <input type ="text" id="mp_1_score" name="mp_1_score" size="5" maxlength="5" />
315       </li>
316     </ol>
317     <fieldset class="rows" id="mp_1_c_1">
318       <legend>Matchpoint components</legend>
319         <ol>
320           <li>
321             <label for="mp_1_c_1_tag">Tag: </label>
322             <input type="text" id="mp_1_c_1_tag" name="mp_1_c_1_tag" size="3" maxlength="3" />
323           </li>
324           <li>
325             <label for="mp_1_c_1_subfields">Subfields: </label>
326             <input type="text" id="mp_1_c_1_subfields" name="mp_1_c_1_subfields" size="10" maxlength="40" />
327           </li>
328           <li>
329             <label for="mp_1_c_1_offset">Offset: </label>
330             <input type="text" id="mp_1_c_1_offset" name="mp_1_c_1_offset" size="5" maxlength="5" />
331           </li>
332           <li>
333             <label for="mp_1_c_1_length">Length: </label>
334             <input type="text" id="mp_1_c_1_length" name="mp_1_c_1_length" size="5" maxlength="5" />
335           </li>
336             <li id="mp_1_c_1_n_1">
337               <label for="mp_1_c_1_n_1_norm">Normalization rule: </label>
338               <input type="text" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" size="20" maxlength="50" />
339             </li>
340         </ol>
341     </fieldset>
342     </fieldset>
343       <br style="clear:both;" />
344       </div>
345
346   </fieldset>
347   [% END %]
348
349   <fieldset class="rows" id="match_checks">
350   <h4>Required match checks</h4>
351   [% IF ( edit_matching_rule ) %]
352   [% 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>
353   [% 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 %]
354   [% IF ( edit_matching_rule ) %]
355   [% FOREACH matchcheck IN matchchecks %]
356   <fieldset class="rows" id="mc_[% matchcheck.mc_num %]">
357     <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>
358     <input type="hidden" id="mc_[% matchcheck.mc_num %]_id" name="mc_[% matchcheck.mc_num %]_id" value="1" />
359       [% FOREACH src_component IN matchcheck.src_components %]
360       <fieldset class="rows" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]">
361         <legend>Source (incoming) record check field</legend>
362         <ol>
363           <li>
364             <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
365             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
366                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
367                    value="[% src_component.tag |html %]"
368                    size="3" maxlength="3" />
369           </li>
370           <li>
371             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
372             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
373                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
374                    value="[% src_component.subfields |html %]"
375                    size="10" maxlength="40" />
376           </li>
377           <li>
378             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
379             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
380                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
381                    value="[% src_component.offset |html %]"
382                    size="5" maxlength="5" />
383           </li>
384           <li>
385             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
386             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
387                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
388                    value="[% src_component.length |html %]"
389                    size="5" maxlength="5" />
390           </li>
391           [% FOREACH norm IN src_component.norms %]
392             <li id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]">
393               <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
394               <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
395                      name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
396                     value="[% norm.norm |html %]"
397                     size="20" maxlength="50" />
398             </li>
399           [% END %]
400         </ol>
401       </fieldset>
402       [% END %]
403       [% FOREACH tgt_component IN matchcheck.tgt_components %]
404       <fieldset class="rows" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
405         <legend>Target (database) record check field</legend>
406         <ol>
407           <li>
408             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
409             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
410                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
411                    value="[% tgt_component.tag |html %]"
412                    size="3" maxlength="3" />
413           </li>
414           <li>
415             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
416             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
417                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
418                    value="[% tgt_component.subfields |html %]"
419                    size="10" maxlength="40" />
420           </li>
421           <li>
422             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
423             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
424                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
425                    value="[% tgt_component.offset |html %]"
426                    size="5" maxlength="5" />
427           </li>
428           <li>
429             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
430             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
431                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
432                    value="[% tgt_component.length |html %]"
433                    size="5" maxlength="5" />
434           </li>
435           [% FOREACH norm IN tgt_component.norms %]
436             <li id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]">
437               <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
438               <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
439                      name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
440                     value="[% norm.norm |html %]"
441                     size="20" maxlength="50" />
442             </li>
443           [% END %]
444         </ol>
445       </fieldset>
446       [% END %]
447   </fieldset>
448   [% END %]
449   [% ELSE %]
450   <div id="mc_1" class="matchgroup">
451   <fieldset class="rows">
452     <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>
453     <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
454       <fieldset class="rows" id="mc_1_src_c_1">
455         <legend>Source (incoming) record check field</legend>
456         <ol>
457           <li>
458             <label for="mc_1_src_c_1_tag">Tag: </label>
459             <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
460           </li>
461           <li>
462             <label for="mc_1_src_c_1_subfields">Subfields: </label>
463             <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
464           </li>
465           <li>
466             <label for="mc_1_src_c_1_offset">Offset: </label>
467             <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
468           </li>
469           <li>
470             <label for="mc_1_src_c_1_length">Length: </label>
471             <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
472           </li>
473             <li id="mc_1_src_c_1_n_1">
474               <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
475               <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" />
476             </li>
477         </ol>
478       </fieldset>
479
480       <fieldset class="rows" id="mc_1_tgt_c_1">
481         <legend>Target (database) record check field</legend>
482         <ol>
483           <li>
484             <label for="mc_1_tgt_c_1_tag">Tag: </label>
485             <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
486           </li>
487           <li>
488             <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
489             <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
490           </li>
491           <li>
492             <label for="mc_1_tgt_c_1_offset">Offset: </label>
493             <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
494           </li>
495           <li>
496             <label for="mc_1_tgt_c_1_length">Length: </label>
497             <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
498           </li>
499             <li id="mc_1_tgt_c_1_n_1">
500               <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
501               <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" />
502             </li>
503         </ol>
504       </fieldset>
505   </fieldset>
506   <br style="clear:both;" />
507   </div>
508   [% END %]
509   </fieldset>
510   <fieldset class="action">
511     [% IF ( edit_matching_rule ) %]
512     <input type="button" value="Save"
513            onclick="CheckMatchingRuleForm(this.form)" />
514     [% ELSE %]
515     <input type="button" value="Save"
516            onclick="CheckMatchingRuleForm(this.form)" />
517     [% END %]
518     <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
519   </fieldset>
520 </form>
521 [% END %]
522
523 [% IF ( delete_matching_rule_form ) %]
524 <div class="dialog alert"><h3>Confirm deletion of record matching rule <span class="ex">'[% code %]' ([% description %])</span>?</h3>
525 <form action="[% script_name %]" name="Aform" method="post">
526   <input type="hidden" name="op" value="[% confirm_op %]" />
527   <input type="hidden" name="matcher_id" value="[% matcher_id %]" />
528     <input type="submit" value="Delete record matching rule" class="approve" /></form>
529         <form action="[% script_name %]" method="get">
530     <input type="submit" value="No, Do Not Delete" class="deny" />
531 </form></div>
532 [% END %]
533
534 [% IF ( display_list ) %]
535
536 <div id="toolbar">
537         <script type="text/javascript">
538         //<![CDATA[
539         // prepare DOM for YUI Toolbar
540          $(document).ready(function() {
541             yuiToolbar();
542          });
543         // YUI Toolbar Functions
544         function yuiToolbar() {
545             new YAHOO.widget.Button("newrule");
546         }       //]]>
547         </script>
548         <ul class="toolbar">
549     <li><a id="newrule" href="[% script_name %]?op=add_matching_rule">New record matching rule</a></li>
550 </ul></div>
551
552 <h2>Record matching rules</h2>
553 [% IF ( added_matching_rule ) %]
554 <div class="dialog message">Added record matching rule &quot;[% added_matching_rule %]&quot;</div>
555 [% END %]
556 [% IF ( edited_matching_rule ) %]
557 <div class="dialog message">Modified record matching rule &quot;[% edited_matching_rule %]&quot;</div>
558 [% END %]
559 [% IF ( deleted_matching_rule ) %]
560 <div class="dialog message">Deleted record matching rule &quot;[% deleted_matching_rule %]&quot;</div>
561 [% END %]
562 [% IF ( available_matching_rules ) %]<table>
563   <tr>
564     <th>#</th>
565     <th>Code</th>
566     <th>Description</th>
567     <th>Actions</th>
568   </tr>
569   [% FOREACH available_matching_rule IN available_matching_rules %]
570   <tr>
571     <td>[% available_matching_rule.matcher_id %]</td>
572     <td>[% available_matching_rule.code %]</td>
573     <td>[% available_matching_rule.description %]</td>
574     <td>
575       <a href="[% available_matching_rule.script_name %]?op=edit_matching_rule&amp;matcher_id=[% available_matching_rule.matcher_id |html %]">Edit</a>
576       <a href="[% available_matching_rule.script_name %]?op=delete_matching_rule&amp;matcher_id=[% available_matching_rule.matcher_id |html %]">Delete</a>
577     </td>
578   </tr>
579   [% END %]
580 </table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
581
582 <div class="pages">[% pagination_bar %]</div>
583
584 [% END %]
585  [% IF ( matching_rule_form ) %]
586 <div id="mp_template" class="matchgroup" style="display:none;">
587   <fieldset class="rows">
588     <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
589     <ol>
590       <li>
591         <label for="mp_num_search_index">Search index: </label>
592         <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" 
593           maxlength="30" />
594       </li>
595       <li>
596         <label for="mp_num_score">Score: </label>
597         <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
598       </li>
599     </ol>
600       <fieldset id="mp_num_c_1" class="rows">
601       <legend>Matchpoint components</legend>
602         <ol>
603           <li>
604             <label for="mp_num_c_1_tag">Tag: </label>
605             <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
606           </li>
607           <li>
608             <label for="mp_num_c_1_subfields">Subfields: </label>
609             <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
610           </li>
611           <li>
612             <label for="mp_num_c_1_offset">Offset: </label>
613             <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
614           </li>
615           <li>
616             <label for="mp_num_c_1_length">Length: </label>
617             <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
618           </li>
619             <li id="mp_num_c_1_n_1">
620               <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
621               <input type="text" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" size="20" maxlength="50" />
622             </li>
623         </ol>
624       </fieldset>
625   </fieldset>
626       <br style="clear:both;" />
627       </div>
628
629 <div id="mc_template" class="matchgroup" style="display:none">
630 <fieldset class="rows">
631   <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
632   <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
633     <fieldset class="rows" id="mc_num_src_c_1">
634       <legend>Source (incoming) record check field</legend>
635       <ol>
636         <li>
637           <label for="mc_num_src_c_1_tag">Tag: </label>
638           <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
639         </li>
640         <li>
641           <label for="mc_num_src_c_1_subfields">Subfields: </label>
642           <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
643         </li>
644         <li>
645           <label for="mc_num_src_c_1_offset">Offset: </label>
646           <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
647         </li>
648         <li>
649           <label for="mc_num_src_c_1_length">Length: </label>
650           <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
651         </li>
652           <li id="mc_num_src_c_1_n_1">
653             <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
654             <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" />
655           </li>
656       </ol>
657     </fieldset>
658     <fieldset class="rows" id="mc_num_tgt_c_1">
659       <legend>Target (database) record check field</legend>
660       <ol>
661         <li>
662           <label for="mc_num_tgt_c_1_tag">Tag: </label>
663           <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
664         </li>
665         <li>
666           <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
667           <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
668         </li>
669         <li>
670           <label for="mc_num_tgt_c_1_offset">Offset: </label>
671           <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
672         </li>
673         <li>
674           <label for="mc_num_tgt_c_1_length">Length: </label>
675           <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
676         </li>
677           <li id="mc_num_tgt_c_1_n_1">
678             <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
679             <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" />
680           </li>
681       </ol>
682     </fieldset>
683 </fieldset>
684 <br style="clear:both;" />
685 </div>
686 [% END %]
687
688 </div>
689 </div>
690 <div class="yui-b">
691 [% INCLUDE 'admin-menu.inc' %]
692 </div>
693 </div>
694 [% INCLUDE 'intranet-bottom.inc' %]