2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Authority details</title>
4 [% INCLUDE 'doc-head-close.inc' %]
7 <body id="auth_blinddetail-biblio-search" class="auth">
9 <div class="main container-fluid">
11 <div class="col-md-8 col-md-offset-2">
13 <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
19 [% MACRO jsinclude BLOCK %]
20 <script type="text/javascript">
21 $(document).ready(function(){
22 [% IF tag_number == 'rancor' %]
23 function RancorReplaceField( new_text, ind_1, ind_2 ){
24 var cur_field = opener.opener.jQuery(".CodeMirror")[0].CodeMirror.marceditor.getCurrentField();
25 cur_field.setText(new_text);
26 cur_field.setIndicator1(ind_1);
27 cur_field.setIndicator2(ind_2);
34 [%- FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP -%]‡
35 [%- SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r ') -%]
36 [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
37 [%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') -%]
39 [%- END -%]‡9[% authid %]";
41 RancorReplaceField( new_line, "[% indicator1 %]", "[% indicator2 %]" );
43 var index_start = "[% index %]";
46 whichfield = opener.opener.document.getElementById(index_start);
51 var field_start = whichfield.parentNode.parentNode;
53 // Sets the good number of form fields for the specified subfield
54 // Returns false if the cloning failed
55 function SetSubfieldNumber(subfield_name, nb) {
56 // Nothing to do if we only have one value
61 // Find the subfield we want to clone
62 var re = new RegExp('^subfield' + subfield_name,'g');
63 var subfields = $(field_start).children('div').filter( function() {
64 return this.id.match(re);
67 // Try to add as many clones as needed
69 for(var i=0; i<nb-subfields.length; i++) {
70 window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'),'[% advancedMARCEditor %]');
79 // Fills the subfield with the values entered in argument
80 function SetSubfieldValues() {
82 var subfield_name = arguments[0];
83 var values = new Array();
84 for(var i=1; i<arguments.length; i++) {
85 values.push(arguments[i]);
88 // Create the correct number of form fields for all values
89 // If the field cloning failed, only the first value will be added to the form.
90 SetSubfieldNumber(subfield_name, values.length);
92 // Find the subfields where we will add the new values
93 var re = new RegExp('^subfield' + subfield_name,'g');
94 var subfields = $(field_start).children('div').filter( function() {
95 return this.id.match(re);
98 // Add the new values to those subfields, empty the additional fields
100 subfields.each(function() {
102 this.getElementsByTagName('input')[1].value = values[i];
105 this.getElementsByTagName('input')[1].value = "";
111 [% UNLESS ( clear ) %]
112 [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
114 "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
115 [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
116 ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
121 var indicators = field_start.getElementsByClassName('indicator flat');
123 indicators[0].value="[% indicator1 %]";
126 indicators[1].value="[% indicator2 %]";
130 // browse all its subfields (clear and $9)
131 var subfields = field_start.getElementsByTagName('input');
132 var re = /^tag_\d*_code_/;
133 for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
134 if(subfields[i].hasAttribute('name') == 0 ) {continue; } // div elements specific to Select2
135 if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
136 var code = subfields[i]; // code is the first input
137 var subfield = subfields[i+1]; // subfield the second
140 if (subfield){subfield.value="" ;}
143 subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
158 [% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]