1 [% INCLUDE 'doc-head-open.inc' %]
2 <Title>Koha -- Authority details</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
6 $(document).ready(function(){
7 var index_start = "[% index %]";
10 whichfield = opener.opener.document.getElementById(index_start);
15 var field_start = whichfield.parentNode.parentNode;
17 // browse all its subfields (clear and $9)
18 var subfields = field_start.getElementsByTagName('input');
19 var re = /^tag_\d*_code_/;
20 for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
21 if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
22 var code = subfields[i]; // code is the first input
23 var subfield = subfields[i+1]; // subfield the second
26 if (subfield){subfield.value="" ;}
29 subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
35 // Sets the good number of form fields for the specified subfield
36 // Returns false if the cloning failed
37 function SetSubfieldNumber(subfield_name, nb) {
38 // Nothing to do if we only have one value
43 // Find the subfield we want to clone
44 var re = new RegExp('^subfield' + subfield_name,'g');
45 var subfields = $(field_start).children('div').filter( function() {
46 return this.id.match(re);
49 // Try to add as many clones as needed
51 for(var i=0; i<nb-subfields.length; i++) {
52 window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'));
61 // Fills the subfield with the values entered in argument
62 function SetSubfieldValues() {
64 var subfield_name = arguments[0];
65 var values = new Array();
66 for(var i=1; i<arguments.length; i++) {
67 values.push(arguments[i]);
70 // Create the correct number of form fields for all values
71 // If the field cloning failed, only the first value will be added to the form.
72 SetSubfieldNumber(subfield_name, values.length);
74 // Find the subfields where we will add the new values
75 var re = new RegExp('^subfield' + subfield_name,'g');
76 var subfields = $(field_start).children('div').filter( function() {
77 return this.id.match(re);
80 // Add the new values to those subfields, empty the additional fields
82 subfields.each(function() {
84 this.getElementsByTagName('input')[1].value = values[i];
87 this.getElementsByTagName('input')[1].value = "";
93 [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
95 "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
96 [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
97 ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
110 <body id="auth_blinddetail-biblio-search" class="auth">
112 <div id="doc" class="yui-t7">
122 [% INCLUDE 'popup-bottom.inc' %]