Bug 15758: Koha::Libraries - Remove GetBranchesLoop
[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   <div id="mc_[% matchcheck.mc_num %]" class="matchgroup">
368   <fieldset class="rows">
369     <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>
370     <input type="hidden" id="mc_[% matchcheck.mc_num %]_id" name="mc_[% matchcheck.mc_num %]_id" value="1" />
371       [% FOREACH src_component IN matchcheck.src_components %]
372       <fieldset class="rows" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]">
373         <legend>Source (incoming) record check field</legend>
374         <ol>
375           <li>
376             <label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
377             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
378                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag" 
379                    value="[% src_component.tag |html %]"
380                    size="3" maxlength="3" />
381           </li>
382           <li>
383             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
384             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
385                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields" 
386                    value="[% src_component.subfields |html %]"
387                    size="10" maxlength="40" />
388           </li>
389           <li>
390             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
391             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
392                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset" 
393                    value="[% src_component.offset |html %]"
394                    size="5" maxlength="5" />
395           </li>
396           <li>
397             <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
398             <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
399                    name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length" 
400                    value="[% src_component.length |html %]"
401                    size="5" maxlength="5" />
402           </li>
403           [% FOREACH norm IN src_component.norms %]
404             <li id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]">
405               <label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
406               <input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
407                      name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm" 
408                     value="[% norm.norm |html %]"
409                     size="20" maxlength="50" />
410             </li>
411           [% END %]
412         </ol>
413       </fieldset>
414       [% END %]
415       [% FOREACH tgt_component IN matchcheck.tgt_components %]
416       <fieldset class="rows" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
417         <legend>Target (database) record check field</legend>
418         <ol>
419           <li>
420             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
421             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
422                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag" 
423                    value="[% tgt_component.tag |html %]"
424                    size="3" maxlength="3" />
425           </li>
426           <li>
427             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
428             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
429                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields" 
430                    value="[% tgt_component.subfields |html %]"
431                    size="10" maxlength="40" />
432           </li>
433           <li>
434             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
435             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
436                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset" 
437                    value="[% tgt_component.offset |html %]"
438                    size="5" maxlength="5" />
439           </li>
440           <li>
441             <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
442             <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
443                    name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length" 
444                    value="[% tgt_component.length |html %]"
445                    size="5" maxlength="5" />
446           </li>
447           [% FOREACH norm IN tgt_component.norms %]
448             <li id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]">
449               <label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
450               <input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
451                      name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm" 
452                     value="[% norm.norm |html %]"
453                     size="20" maxlength="50" />
454             </li>
455           [% END %]
456         </ol>
457       </fieldset>
458       [% END %]
459   </fieldset>
460   <br style="clear:both;" />
461   </div>
462   [% END %]
463   [% ELSE %]
464   <div id="mc_1" class="matchgroup">
465   <fieldset class="rows">
466     <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>
467     <input type="hidden" id="mc_1_id" name="mc_1_id" value="1" />
468       <fieldset class="rows" id="mc_1_src_c_1">
469         <legend>Source (incoming) record check field</legend>
470         <ol>
471           <li>
472             <label for="mc_1_src_c_1_tag">Tag: </label>
473             <input type="text" id="mc_1_src_c_1_tag" name="mc_1_src_c_1_tag" size="3" maxlength="3" />
474           </li>
475           <li>
476             <label for="mc_1_src_c_1_subfields">Subfields: </label>
477             <input type="text" id="mc_1_src_c_1_subfields" name="mc_1_src_c_1_subfields" size="10" maxlength="40" />
478           </li>
479           <li>
480             <label for="mc_1_src_c_1_offset">Offset: </label>
481             <input type="text" id="mc_1_src_c_1_offset" name="mc_1_src_c_1_offset" size="5" maxlength="5" />
482           </li>
483           <li>
484             <label for="mc_1_src_c_1_length">Length: </label>
485             <input type="text" id="mc_1_src_c_1_length" name="mc_1_src_c_1_length" size="5" maxlength="5" />
486           </li>
487             <li id="mc_1_src_c_1_n_1">
488               <label for="mc_1_src_c_1_n_1_norm">Normalization rule: </label>
489               <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" />
490             </li>
491         </ol>
492       </fieldset>
493
494       <fieldset class="rows" id="mc_1_tgt_c_1">
495         <legend>Target (database) record check field</legend>
496         <ol>
497           <li>
498             <label for="mc_1_tgt_c_1_tag">Tag: </label>
499             <input type="text" id="mc_1_tgt_c_1_tag" name="mc_1_tgt_c_1_tag" size="3" maxlength="3" />
500           </li>
501           <li>
502             <label for="mc_1_tgt_c_1_subfields">Subfields: </label>
503             <input type="text" id="mc_1_tgt_c_1_subfields" name="mc_1_tgt_c_1_subfields" size="10" maxlength="40" />
504           </li>
505           <li>
506             <label for="mc_1_tgt_c_1_offset">Offset: </label>
507             <input type="text" id="mc_1_tgt_c_1_offset" name="mc_1_tgt_c_1_offset" size="5" maxlength="5" />
508           </li>
509           <li>
510             <label for="mc_1_tgt_c_1_length">Length: </label>
511             <input type="text" id="mc_1_tgt_c_1_length" name="mc_1_tgt_c_1_length" size="5" maxlength="5" />
512           </li>
513             <li id="mc_1_tgt_c_1_n_1">
514               <label for="mc_1_tgt_c_1_n_1_norm">Normalization rule: </label>
515               <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" />
516             </li>
517         </ol>
518       </fieldset>
519   </fieldset>
520   <br style="clear:both;" />
521   </div>
522   [% END %]
523   </fieldset>
524   <fieldset class="action">
525     [% IF ( edit_matching_rule ) %]
526     <input type="button" value="Save"
527            onclick="CheckMatchingRuleForm(this.form)" />
528     [% ELSE %]
529     <input type="button" value="Save"
530            onclick="CheckMatchingRuleForm(this.form)" />
531     [% END %]
532     <a class="cancel" href="/cgi-bin/koha/admin/matching-rules.pl">Cancel</a>
533   </fieldset>
534 </form>
535 [% END %]
536
537 [% IF ( delete_matching_rule_form ) %]
538     <div class="dialog alert">
539         <h3>Confirm deletion of record matching rule <span class="ex">'[% code %]' ([% description %])</span>?</h3>
540         <form action="[% script_name %]" name="Aform" method="post">
541             <input type="hidden" name="op" value="[% confirm_op %]" />
542             <input type="hidden" name="matcher_id" value="[% matcher_id %]" />
543             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete record matching rule</button>
544         </form>
545         <form action="[% script_name %]" method="get">
546             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
547         </form>
548     </div>
549 [% END %]
550
551 [% IF ( display_list ) %]
552
553 <div id="toolbar" class="btn-toolbar">
554     <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>
555 </div>
556
557 <h2>Record matching rules</h2>
558 [% IF ( added_matching_rule ) %]
559 <div class="dialog message">Added record matching rule &quot;[% added_matching_rule %]&quot;</div>
560 [% END %]
561 [% IF ( edited_matching_rule ) %]
562 <div class="dialog message">Modified record matching rule &quot;[% edited_matching_rule %]&quot;</div>
563 [% END %]
564 [% IF ( deleted_matching_rule ) %]
565 <div class="dialog message">Deleted record matching rule &quot;[% deleted_matching_rule %]&quot;</div>
566 [% END %]
567 [% IF ( available_matching_rules ) %]<table>
568   <tr>
569     <th>#</th>
570     <th>Code</th>
571     <th>Description</th>
572     <th>Actions</th>
573   </tr>
574   [% FOREACH available_matching_rule IN available_matching_rules %]
575   <tr>
576     <td>[% available_matching_rule.matcher_id %]</td>
577     <td>[% available_matching_rule.code %]</td>
578     <td>[% available_matching_rule.description %]</td>
579     <td class="actions">
580       <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>
581       <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>
582     </td>
583   </tr>
584   [% END %]
585 </table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
586
587 <div class="pages">[% pagination_bar %]</div>
588
589 [% END %]
590  [% IF ( matching_rule_form ) %]
591 <div id="mp_template" class="matchgroup" style="display:none;">
592   <fieldset class="rows">
593     <legend>Match point <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchpoint(this); return false;">Remove this match point</a></legend>
594     <ol>
595       <li>
596         <label for="mp_num_search_index">Search index: </label>
597         <input type ="text" id="mp_num_search_index" name="mp_num_search_index" size="20" 
598           maxlength="30" />
599       </li>
600       <li>
601         <label for="mp_num_score">Score: </label>
602         <input type ="text" id="mp_num_score" name="mp_num_score" size="5" maxlength="5" />
603       </li>
604     </ol>
605       <fieldset id="mp_num_c_1" class="rows">
606       <legend>Matchpoint components</legend>
607         <ol>
608           <li>
609             <label for="mp_num_c_1_tag">Tag: </label>
610             <input type="text" id="mp_num_c_1_tag" name="mp_num_c_1_tag" size="3" maxlength="3" />
611           </li>
612           <li>
613             <label for="mp_num_c_1_subfields">Subfields: </label>
614             <input type="text" id="mp_num_c_1_subfields" name="mp_num_c_1_subfields" size="10" maxlength="40" />
615           </li>
616           <li>
617             <label for="mp_num_c_1_offset">Offset: </label>
618             <input type="text" id="mp_num_c_1_offset" name="mp_num_c_1_offset" size="5" maxlength="5" />
619           </li>
620           <li>
621             <label for="mp_num_c_1_length">Length: </label>
622             <input type="text" id="mp_num_c_1_length" name="mp_num_c_1_length" size="5" maxlength="5" />
623           </li>
624             <li id="mp_num_c_1_n_1">
625               <label for="mp_num_c_1_n_1_norm">Normalization rule: </label>
626               <input type="text" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" size="20" maxlength="50" />
627             </li>
628         </ol>
629       </fieldset>
630   </fieldset>
631       <br style="clear:both;" />
632       </div>
633
634 <div id="mc_template" class="matchgroup" style="display:none">
635 <fieldset class="rows">
636   <legend>Match check <span class="counter"></span> | <a href="#" class="button" onclick="DeleteMatchcheck(this); return false;">Remove this match check</a></legend>
637   <input type="hidden" id="mc_num_id" name="mc_num_id" value="1" />
638     <fieldset class="rows" id="mc_num_src_c_1">
639       <legend>Source (incoming) record check field</legend>
640       <ol>
641         <li>
642           <label for="mc_num_src_c_1_tag">Tag: </label>
643           <input type="text" id="mc_num_src_c_1_tag" name="mc_num_src_c_1_tag" size="3" maxlength="3" />
644         </li>
645         <li>
646           <label for="mc_num_src_c_1_subfields">Subfields: </label>
647           <input type="text" id="mc_num_src_c_1_subfields" name="mc_num_src_c_1_subfields" size="10" maxlength="40" />
648         </li>
649         <li>
650           <label for="mc_num_src_c_1_offset">Offset: </label>
651           <input type="text" id="mc_num_src_c_1_offset" name="mc_num_src_c_1_offset" size="5" maxlength="5" />
652         </li>
653         <li>
654           <label for="mc_num_src_c_1_length">Length: </label>
655           <input type="text" id="mc_num_src_c_1_length" name="mc_num_src_c_1_length" size="5" maxlength="5" />
656         </li>
657           <li id="mc_num_src_c_1_n_1">
658             <label for="mc_num_src_c_1_n_1_norm">Normalization rule: </label>
659             <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" />
660           </li>
661       </ol>
662     </fieldset>
663     <fieldset class="rows" id="mc_num_tgt_c_1">
664       <legend>Target (database) record check field</legend>
665       <ol>
666         <li>
667           <label for="mc_num_tgt_c_1_tag">Tag: </label>
668           <input type="text" id="mc_num_tgt_c_1_tag" name="mc_num_tgt_c_1_tag" size="3" maxlength="3" />
669         </li>
670         <li>
671           <label for="mc_num_tgt_c_1_subfields">Subfields: </label>
672           <input type="text" id="mc_num_tgt_c_1_subfields" name="mc_num_tgt_c_1_subfields" size="10" maxlength="40" />
673         </li>
674         <li>
675           <label for="mc_num_tgt_c_1_offset">Offset: </label>
676           <input type="text" id="mc_num_tgt_c_1_offset" name="mc_num_tgt_c_1_offset" size="5" maxlength="5" />
677         </li>
678         <li>
679           <label for="mc_num_tgt_c_1_length">Length: </label>
680           <input type="text" id="mc_num_tgt_c_1_length" name="mc_num_tgt_c_1_length" size="5" maxlength="5" />
681         </li>
682           <li id="mc_num_tgt_c_1_n_1">
683             <label for="mc_num_tgt_c_1_n_1_norm">Normalization rule: </label>
684             <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" />
685           </li>
686       </ol>
687     </fieldset>
688 </fieldset>
689 <br style="clear:both;" />
690 </div>
691 [% END %]
692
693 </div>
694 </div>
695 <div class="yui-b">
696 [% INCLUDE 'admin-menu.inc' %]
697 </div>
698 </div>
699 [% INCLUDE 'intranet-bottom.inc' %]