Authority tables are modified to be compatible with new MARC frameworks. This change...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / authorities / blinddetail-linker.tmpl
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3 <html>
4 <body>
5 <script language="JavaScript" type="text/javascript">
6
7 function go()
8 {
9 var index_start = <!-- TMPL_VAR NAME="index" -->;
10 var whichfield = opener.opener.document.f.tag[index_start].value;
11 i=index_start
12 //try to fill authid as linkid to be used for linking authorities
13 //opener.opener.document.f.linkid.value="<!-- TMPL_VAR NAME="authid"-->";
14
15 // go forward, until reaching the end of the field.
16 while (i<=opener.opener.document.f.field_value.length) {
17         
18         <!-- TMPL_LOOP NAME="0XX" -->
19                 <!-- TMPL_LOOP NAME="subfield" -->
20                         if (opener.opener.document.f.tag[i].value == <!--TMPL_VAR NAME="linkidfield"--> && opener.opener.document.f.subfield[i].value == '<!-- TMPL_VAR NAME="linkidsubfield" -->') 
21                         {
22                                 opener.opener.document.f.field_value[i].value = "<!-- TMPL_VAR NAME="authid" -->";
23                         }
24                         if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == '<!-- TMPL_VAR NAME="marc_subfield" -->') 
25                         {
26                                 opener.opener.document.f.field_value[i].value = "<!-- TMPL_VAR NAME="marc_value" -->";
27                         }
28                 <!-- /TMPL_LOOP -->
29         <!-- /TMPL_LOOP -->
30         if (opener.opener.document.f.tag[i].value != whichfield) {
31                 i=opener.opener.document.f.field_value.length;
32         }
33         i++;
34 }
35 // go backward until the beginning of the field
36 i=index_start
37 while (i>=0) {
38         
39         <!-- TMPL_LOOP NAME="0XX" -->
40                 <!-- TMPL_LOOP NAME="subfield" -->
41                         if (opener.opener.document.f.tag[i].value == <!--TMPL_VAR NAME="linkidfield"--> && opener.opener.document.f.subfield[i].value == '<!-- TMPL_VAR NAME="linkidsubfield" -->') 
42                         {
43                                 opener.opener.document.f.field_value[i].value = "<!-- TMPL_VAR NAME="authid" -->";
44                         }
45                         if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == '<!-- TMPL_VAR NAME="marc_subfield" -->') 
46                         {
47                                 opener.opener.document.f.field_value[i].value = "<!-- TMPL_VAR NAME="marc_value" -->";
48                         }
49                 <!-- /TMPL_LOOP -->
50         <!-- /TMPL_LOOP -->
51         if (opener.opener.document.f.tag[i].value != whichfield) {
52                 i=0;
53         }
54         i--;
55 }
56         opener.close();
57         self.close();
58         return false;
59
60
61 }
62 </script>
63 <script language="javascript" type="text/javascript">
64 window.onload = go();
65 </script>
66 </body>
67 </html>