Merge remote branch 'kc/new/enh/bug_5917' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / blinddetail-biblio-search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <Title>Koha -- Authority details</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5 //<![CDATA[
6     $(document).ready(function(){
7         var index_start = "[% index %]";
8         var whichfield;
9         try {
10             whichfield = opener.opener.document.getElementById(index_start);
11         } catch(e) {
12             return;
13         }
14         
15         // browse all its subfields
16         var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');
17         var re = /^tag_\d*_code_/;
18         for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
19             if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
20                 var code     = subfields[i];   // code is the first input 
21                 var subfield = subfields[i+1]; // subfield the second
22
23             [% IF ( clear ) %]
24                 if (subfield){subfield.value="" ;}
25             [% ELSE %]      
26               [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
27                 if (code.value == "[% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"){
28                         subfield.value = "[% SUBFIELD_LOO.marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
29                 }
30               [% END %]
31               if(code.value=='9'){
32                   subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
33               }
34             [% END %]
35             }
36         }
37         opener.close();
38         window.close();
39             
40         return false;
41     });
42 //]]>
43 </script>
44 </head>
45 <body>
46
47 <div id="doc" class="yui-t7">
48    <div id="bd">
49         <div class="yui-g">
50
51
52
53 </div>
54 </div>
55 </div>
56
57 [% INCLUDE 'popup-bottom.inc' %]