Bug 5917 / Bug 6085 : Fixing not being able to change language
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / matching-rules.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Record Matching Rules
3 <!-- TMPL_IF name="matching_rule_form" -->
4   <!-- TMPL_IF name="edit_matching_rule" -->
5     &rsaquo; Modify record matching rule
6   <!-- TMPL_ELSE -->
7     &rsaquo; Add record matching rule
8   <!-- /TMPL_IF -->
9 <!-- /TMPL_IF -->
10 <!-- TMPL_IF name="delete_matching_rule_form" -->
11   &rsaquo; Confirm deletion of record matching rule &quot;<!-- TMPL_VAR name="code" -->&quot;
12 <!-- /TMPL_IF -->
13 </title>
14 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
15
16 <script type="text/javascript">
17 //<![CDATA[
18
19 var maxMatchPoint = <!-- TMPL_VAR name="max_matchpoint" -->;
20 var maxMatchCheck = <!-- TMPL_VAR name="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>
172 <!-- TMPL_INCLUDE NAME="header.inc" -->
173 <!-- TMPL_INCLUDE NAME="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; <!-- TMPL_IF name="display_list" -->Record Matching Rules<!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/matching-rules.pl">Record Matching Rules</a><!-- /TMPL_IF -->
176 <!-- TMPL_IF name="matching_rule_form" -->
177   <!-- TMPL_IF name="edit_matching_rule" -->
178     &rsaquo; Modify record matching rule
179   <!-- TMPL_ELSE -->
180     &rsaquo; Add record matching rule
181   <!-- /TMPL_IF -->
182 <!-- /TMPL_IF -->
183 <!-- TMPL_IF name="delete_matching_rule_form" -->
184   &rsaquo; Confirm deletion of record matching rule &quot;<!-- TMPL_VAR name="code" -->&quot;
185 <!-- /TMPL_IF -->
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 <!-- TMPL_IF name="matching_rule_form" -->
195   <!-- TMPL_IF name="edit_matching_rule" -->
196 <h2>Modify record matching rule</h2>
197   <!-- TMPL_ELSE -->
198 <h2>Add record matching rule</h2>
199   <!-- /TMPL_IF -->
200 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
201   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
202   <fieldset class="rows">
203     <ol>
204       <li>
205           <!-- TMPL_IF name="edit_matching_rule" -->
206                   <span class="label">Matching rule code: </span>
207             <input type="hidden" name="matcher_id" value="<!-- TMPL_VAR name="matcher_id" -->" />
208             <input type="hidden" name="code" value="<!-- TMPL_VAR name="code" -->" />
209             <!-- TMPL_VAR name="code" -->
210           <!-- TMPL_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           <!-- /TMPL_IF -->
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="<!-- TMPL_VAR name="description" escape="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="<!-- TMPL_VAR name="threshold" escape="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   <!-- TMPL_IF name="edit_matching_rule" -->
229   <!-- TMPL_IF NAME="matchpoints" --><p id="addMatchPoint" style="display:none;"><!-- TMPL_ELSE --><p id="addMatchPoint"><!-- /TMPL_IF --><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p>
230   <!-- TMPL_ELSE --><p id="addMatchPoint" style="display:none;"><a href="#" class="button" onclick="InsertMatchpoint('mp_1', 'mp_template'); return false;">Add match point</a></p><!-- /TMPL_IF -->
231   <!-- TMPL_IF name="edit_matching_rule" -->
232   <!-- TMPL_LOOP name="matchpoints" -->
233   <div id="mp_<!-- TMPL_VAR name="mp_num" -->" class="matchgroup">
234   <fieldset class="rows">
235     <legend>Match Point <!-- TMPL_VAR NAME="mp_num" --> | <a href="#" class="button" onclick="InsertMatchpoint('mp_<!-- TMPL_VAR NAME="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_<!-- TMPL_VAR name="mp_num" -->_search_index">Search index: </label>
239         <input type ="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_search_index" 
240                name="mp_<!-- TMPL_VAR name="mp_num" -->_search_index" size="20" 
241                value="<!-- TMPL_VAR name="index" escape="HTML" -->"
242           maxlength="30" />
243       </li>
244       <li>
245         <label for="mp_<!-- TMPL_VAR name="mp_num" -->_score">Score: </label>
246         <input type ="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_score" 
247                name="mp_<!-- TMPL_VAR name="mp_num" -->_score" size="5"
248                value="<!-- TMPL_VAR name="score" escape="HTML" -->" 
249                maxlength="5" />
250       </li>
251       </ol>
252       <!-- TMPL_LOOP name="components" -->
253       <fieldset class="rows" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->">
254       <legend>Matchpoint components</legend>
255         <ol>
256           <li>
257             <label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
258             <input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
259                    name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
260                    value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
261                    size="3" maxlength="3" />
262           </li>
263           <li>
264             <label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
265             <input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
266                    name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
267                    value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
268                    size="10" maxlength="40" />
269           </li>
270           <li>
271             <label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
272             <input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
273                    name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
274                    value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
275                    size="5" maxlength="5" />
276           </li>
277           <li>
278             <label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
279             <input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length" 
280                    name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_length" 
281                    value="<!-- TMPL_VAR name="length" escape="HTML" -->"
282                    size="5" maxlength="5" />
283           </li>
284               <!-- TMPL_LOOP name="norms" -->
285               <li id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num"-->">
286                 <label for="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n__<!-- TMPL_VAR name="norm_num"-->_norm">Normalization rule: </label>
287                 <input type="text" id="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n__<!-- TMPL_VAR name="norm_num"-->_norm" 
288                        name="mp_<!-- TMPL_VAR name="mp_num" -->_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num"-->_norm" 
289                        value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
290                        size="20" maxlength="50" />
291               </li>
292               <!-- /TMPL_LOOP -->
293         </ol>
294       </fieldset>
295       <!-- /TMPL_LOOP -->
296       </fieldset>
297       <br style="clear:both;" />
298       </div>
299   </fieldset>
300
301   <!-- /TMPL_LOOP -->
302   <!-- TMPL_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   <!-- /TMPL_IF -->
348
349   <fieldset class="rows" id="match_checks">
350   <h4>Required match checks</h4>
351   <!-- TMPL_IF name="edit_matching_rule" -->
352   <!-- TMPL_IF NAME="matchchecks" --><p id="addMatchCheck" style="display:none;"><!-- TMPL_ELSE --><p id="addMatchCheck"><!-- /TMPL_IF --><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p>
353   <!-- TMPL_ELSE --><p id="addMatchCheck" style="display:none;"><a href="#" class="button" onclick="InsertMatchcheck('mc_1', 'mc_template'); return false;">Add match check</a></p><!-- /TMPL_IF -->
354   <!-- TMPL_IF name="edit_matching_rule" -->
355   <!-- TMPL_LOOP name="matchchecks" -->
356   <fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->">
357     <legend>Match check <!-- TMPL_VAR NAME="mc_num" --><a href="#" class="button" onclick="InsertMatchcheck('mc_<!-- TMPL_VAR NAME="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_<!-- TMPL_VAR name="mc_num" -->_id" name="mc_<!-- TMPL_VAR name="mc_num" -->_id" value="1" />
359       <!-- TMPL_LOOP name="src_components" -->
360       <fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->">
361         <legend>Source (incoming) record check field</legend>
362         <ol>
363           <li>
364             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
365             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
366                    name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
367                    value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
368                    size="3" maxlength="3" />
369           </li>
370           <li>
371             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
372             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
373                    name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
374                    value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
375                    size="10" maxlength="40" />
376           </li>
377           <li>
378             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
379             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
380                    name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
381                    value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
382                    size="5" maxlength="5" />
383           </li>
384           <li>
385             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
386             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length" 
387                    name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_length" 
388                    value="<!-- TMPL_VAR name="length" escape="HTML" -->"
389                    size="5" maxlength="5" />
390           </li>
391           <!-- TMPL_LOOP name="norms" -->
392             <li id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->">
393               <label for="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm">Normalization rule: </label>
394               <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm" 
395                      name="mc_<!-- TMPL_VAR name="mc_num" -->_src_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm" 
396                     value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
397                     size="20" maxlength="50" />
398             </li>
399           <!-- /TMPL_LOOP -->
400         </ol>
401       </fieldset>
402       <!-- /TMPL_LOOP -->
403       <!-- TMPL_LOOP name="tgt_components" -->
404       <fieldset class="rows" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->">
405         <legend>Target (database) record check field</legend>
406         <ol>
407           <li>
408             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag">Tag: </label>
409             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
410                    name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_tag" 
411                    value="<!-- TMPL_VAR name="tag" escape="HTML" -->"
412                    size="3" maxlength="3" />
413           </li>
414           <li>
415             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields">Subfields: </label>
416             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
417                    name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_subfields" 
418                    value="<!-- TMPL_VAR name="subfields" escape="HTML" -->"
419                    size="10" maxlength="40" />
420           </li>
421           <li>
422             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset">Offset: </label>
423             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
424                    name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_offset" 
425                    value="<!-- TMPL_VAR name="offset" escape="HTML" -->"
426                    size="5" maxlength="5" />
427           </li>
428           <li>
429             <label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length">Length: </label>
430             <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length" 
431                    name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_length" 
432                    value="<!-- TMPL_VAR name="length" escape="HTML" -->"
433                    size="5" maxlength="5" />
434           </li>
435           <!-- TMPL_LOOP name="norms" -->
436             <li id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->">
437               <label for="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm">Normalization rule: </label>
438               <input type="text" id="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm" 
439                      name="mc_<!-- TMPL_VAR name="mc_num" -->_tgt_c_<!-- TMPL_VAR name="comp_num" -->_n_<!-- TMPL_VAR name="norm_num" -->_norm" 
440                     value="<!-- TMPL_VAR name="norm" escape="HTML" -->"
441                     size="20" maxlength="50" />
442             </li>
443           <!-- /TMPL_LOOP -->
444         </ol>
445       </fieldset>
446       <!-- /TMPL_LOOP -->
447   </fieldset>
448   <!-- /TMPL_LOOP -->
449   <!-- TMPL_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   <!-- /TMPL_IF -->
509   </fieldset>
510   <fieldset class="action">
511     <!-- TMPL_IF name="edit_matching_rule" -->
512     <input type="button" value="Save"
513            onclick="CheckMatchingRuleForm(this.form)" />
514     <!-- TMPL_ELSE -->
515     <input type="button" value="Save"
516            onclick="CheckMatchingRuleForm(this.form)" />
517     <!-- /TMPL_IF-->
518     <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
519   </fieldset>
520 </form>
521 <!-- /TMPL_IF -->
522
523 <!-- TMPL_IF name="delete_matching_rule_form" -->
524 <div class="dialog alert"><h3>Confirm deletion of record matching rule <span class="ex">'<!-- TMPL_VAR name="code" -->' (<!-- TMPL_VAR name="description" -->)</span>?</h3>
525 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
526   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
527   <input type="hidden" name="matcher_id" value="<!-- TMPL_VAR name="matcher_id" -->" />
528     <input type="submit" value="Delete record matching rule" class="approve" /></form>
529         <form action="<!-- TMPL_VAR name="script_name" -->" method="get">
530     <input type="submit" value="No, Do Not Delete" class="deny" />
531 </form></div>
532 <!-- /TMPL_IF -->
533
534 <!-- TMPL_IF name="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="<!-- TMPL_VAR name="script_name" -->?op=add_matching_rule">New Record Matching Rule</a></li>
550 </ul></div>
551
552 <h2>Record Matching Rules</h2>
553 <!-- TMPL_IF name="added_matching_rule" -->
554 <div class="dialog message">Added record matching rule &quot;<!-- TMPL_VAR name="added_matching_rule" -->&quot;</div>
555 <!-- /TMPL_IF -->
556 <!-- TMPL_IF name="edited_matching_rule" -->
557 <div class="dialog message">Modified record matching rule &quot;<!-- TMPL_VAR name="edited_matching_rule" -->&quot;</div>
558 <!-- /TMPL_IF -->
559 <!-- TMPL_IF name="deleted_matching_rule" -->
560 <div class="dialog message">Deleted record matching rule &quot;<!-- TMPL_VAR name="deleted_matching_rule" -->&quot;</div>
561 <!-- /TMPL_IF -->
562 <!-- TMPL_IF NAME="available_matching_rules" --><table>
563   <tr>
564     <th>#</th>
565     <th>Code</th>
566     <th>Description</th>
567     <th>Actions</th>
568   </tr>
569   <!-- TMPL_LOOP name="available_matching_rules" -->
570   <tr>
571     <td><!-- TMPL_VAR name="matcher_id" --></td>
572     <td><!-- TMPL_VAR name="code" --></td>
573     <td><!-- TMPL_VAR name="description" --></td>
574     <td>
575       <a href="<!-- TMPL_VAR name="script_name" -->?op=edit_matching_rule&amp;matcher_id=<!-- TMPL_VAR name="matcher_id" escape="HTML" -->">Edit</a>
576       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_matching_rule&amp;matcher_id=<!-- TMPL_VAR name="matcher_id" escape="HTML" -->">Delete</a>
577     </td>
578   </tr>
579   <!-- /TMPL_LOOP -->
580 </table><!-- TMPL_ELSE --><p>There are no saved matching rules.</p><!-- /TMPL_IF -->
581
582 <div class="pages"><!-- TMPL_VAR NAME="pagination_bar" --></div>
583
584 <!-- /TMPL_IF -->
585  <!-- TMPL_IF name="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 <!-- /TMPL_IF -->
687
688 </div>
689 </div>
690 <div class="yui-b">
691 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
692 </div>
693 </div>
694 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->