| 
      
            Lines 2-37
          
      
      
        Link Here
      
     | 
  
        
          | 2 | 
          <title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>  | 
          2 | 
          <title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>  | 
        
        
          | 3 | 
          [% INCLUDE 'doc-head-close.inc' %]  | 
          3 | 
          [% INCLUDE 'doc-head-close.inc' %]  | 
        
        
          | 4 | 
          <script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>  | 
          4 | 
          <script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>  | 
        
            
               | 
               | 
              5 | 
              <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>  | 
            
        
          | 5 | 
           | 
          6 | 
           | 
        
        
          | 6 | 
          <script type="text/javascript">  | 
          7 | 
          <script type="text/javascript">  | 
        
        
          | 7 | 
          //<![CDATA[  | 
          8 | 
          //<![CDATA[  | 
        
        
          | 8 | 
           | 
          9 | 
           | 
        
            
              | 9 | 
                   var fields_in_use = {}; | 
               | 
               | 
            
        
          | 10 | 
          	 $(document).ready(function() { | 
          10 | 
          	 $(document).ready(function() { | 
        
        
          | 11 | 
                  $('#authoritytabs').tabs(); | 
          11 | 
                  $('#authoritytabs').tabs(); | 
        
          
            
              | 12 | 
                      $('.tag').each(function() { | 
              12 | 
               | 
            
            
              | 13 | 
                          var field_id = this.getAttribute('id').substring(0, 7); | 
               | 
               | 
            
            
              | 14 | 
                          if (field_id in fields_in_use) { | 
            
            
              | 15 | 
                              fields_in_use[field_id]++;  | 
            
            
              | 16 | 
                          } else { | 
            
            
              | 17 | 
                              fields_in_use[field_id] = 1;  | 
            
            
              | 18 | 
                          }  | 
            
            
              | 19 | 
                      });  | 
            
            
              | 20 | 
                      $('.subfield_line').each(function() { | 
            
            
              | 21 | 
                          var field_id = this.getAttribute('id').substring(0, 12); | 
            
            
              | 22 | 
                          if (field_id in fields_in_use) { | 
            
            
              | 23 | 
                              fields_in_use[field_id]++;  | 
            
            
              | 24 | 
                          } else { | 
            
            
              | 25 | 
                              fields_in_use[field_id] = 1;  | 
            
            
              | 26 | 
                          }  | 
            
            
              | 27 | 
                      });  | 
            
        
          | 28 | 
          		$("#f").submit(function(){ | 
          13 | 
          		$("#f").submit(function(){ | 
        
        
          | 29 | 
          			return $(this).Check();  | 
          14 | 
          			return $(this).Check();  | 
        
        
          | 30 | 
          		});  | 
          15 | 
          		});  | 
        
        
          | 31 | 
          	 });  | 
          16 | 
          	 });  | 
        
        
          | 32 | 
           | 
          17 | 
           | 
        
        
          | 33 | 
          /**  | 
          18 | 
          /**  | 
        
          
            
              | 34 | 
               * check if mandatory subfields are writed  | 
              19 | 
               * check if mandatory subfields are written  | 
            
        
          | 35 | 
           */  | 
          20 | 
           */  | 
        
        
          | 36 | 
          function AreMandatoriesNotOk(){ | 
          21 | 
          function AreMandatoriesNotOk(){ | 
        
        
          | 37 | 
              var mandatories = new Array();  | 
          22 | 
              var mandatories = new Array();  | 
        
  
    | 
      
            Lines 75-81
          function AreMandatoriesNotOk(){
      
      
        Link Here
      
     | 
  
        
          | 75 | 
          	    	for(var j=0,len2=eleminputs.length; j<len2; j++){ | 
          60 | 
          	    	for(var j=0,len2=eleminputs.length; j<len2; j++){ | 
        
        
          | 76 | 
          	  | 
          61 | 
          	  | 
        
        
          | 77 | 
          	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ | 
          62 | 
          	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ | 
        
            
              | 78 | 
              					/* tag_801_subfield_c_841304_545657 */  | 
               | 
               | 
            
        
          | 79 | 
          					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); | 
          63 | 
          					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); | 
        
        
          | 80 | 
          					  | 
          64 | 
          					  | 
        
        
          | 81 | 
          					for( var k=0; k<len2; k++){ | 
          65 | 
          					for( var k=0; k<len2; k++){ | 
        
  
    | 
      
            Lines 118-161
          function Check(){
      
      
        Link Here
      
     | 
  
        
          | 118 | 
              }  | 
          102 | 
              }  | 
        
        
          | 119 | 
          }  | 
          103 | 
          }  | 
        
        
          | 120 | 
           | 
          104 | 
           | 
        
            
              | 121 | 
               | 
               | 
               | 
            
            
              | 122 | 
              // returns the subfieldcode based upon subfieldid writing  | 
            
            
              | 123 | 
              function getSubfieldcode(tagsubfieldid){ | 
            
            
              | 124 | 
                  // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0    | 
            
            
              | 125 | 
                  return tagsubfieldid.substr(3+3+4+8-1,1);  | 
            
            
              | 126 | 
              }  | 
            
            
              | 127 | 
               | 
            
            
              | 128 | 
              // Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)  | 
            
            
              | 129 | 
              // returns the filter  | 
            
            
              | 130 | 
              function getTagInputnameFilter(tagsubfieldid){ | 
            
            
              | 131 | 
                  var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));   | 
            
            
              | 132 | 
                  var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_")); | 
            
            
              | 133 | 
                  tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_")); | 
            
            
              | 134 | 
                  tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_")); | 
            
            
              | 135 | 
                  tagsubfield=tagsubfield+"_."+tagcode;  | 
            
            
              | 136 | 
                  return tagsubfield;    | 
            
            
              | 137 | 
              }  | 
            
            
              | 138 | 
               | 
            
            
              | 139 | 
              function openAuth(tagsubfieldid,authtype) { | 
            
            
              | 140 | 
                  // let's take the base of tagsubfield information (removing the indexes and the codes  | 
            
            
              | 141 | 
                  var element=document.getElementById(tagsubfieldid);  | 
            
            
              | 142 | 
                  var tagsubfield=getTagInputnameFilter(tagsubfieldid);  | 
            
            
              | 143 | 
                  var elementsubfcode=getSubfieldcode(element.name);  | 
            
            
              | 144 | 
                  var mainmainstring=element.value;  | 
            
            
              | 145 | 
                  var mainstring="";    | 
            
            
              | 146 | 
                  var inputs = element.parentNode.parentNode.getElementsByTagName("input"); | 
            
            
              | 147 | 
               | 
            
            
              | 148 | 
                  for (var myindex =0; myindex<inputs.length;myindex++){ | 
            
            
              | 149 | 
                      if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){ | 
            
            
              | 150 | 
                          var subfieldcode=getSubfieldcode(inputs[myindex].name);  | 
            
            
              | 151 | 
                          if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){ | 
            
            
              | 152 | 
                              mainstring=inputs[myindex].value+" "+mainstring;  | 
            
            
              | 153 | 
                          }        | 
            
            
              | 154 | 
                      }  | 
            
            
              | 155 | 
                  }             | 
            
            
              | 156 | 
              	newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); | 
            
            
              | 157 | 
              }  | 
            
            
              | 158 | 
               | 
            
        
          | 159 | 
          function AddField(field,cntrepeatfield) { | 
          105 | 
          function AddField(field,cntrepeatfield) { | 
        
        
          | 160 | 
              document.forms['f'].op.value = "addfield";  | 
          106 | 
              document.forms['f'].op.value = "addfield";  | 
        
        
          | 161 | 
              document.forms['f'].addfield_field.value=field;  | 
          107 | 
              document.forms['f'].addfield_field.value=field;  | 
        
  
    | 
      
            Lines 163-497
          function AddField(field,cntrepeatfield) {
      
      
        Link Here
      
     | 
  
        
          | 163 | 
              document.f.submit();  | 
          109 | 
              document.f.submit();  | 
        
        
          | 164 | 
          }  | 
          110 | 
          }  | 
        
        
          | 165 | 
           | 
          111 | 
           | 
        
            
              | 166 | 
               | 
               | 
               | 
            
            
              | 167 | 
              function ExpandField(index) { | 
            
            
              | 168 | 
                  var original = document.getElementById(index); //original <div>  | 
            
            
              | 169 | 
                  var divs = original.getElementsByTagName('div'); | 
            
            
              | 170 | 
                  for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div | 
            
            
              | 171 | 
                      if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield | 
            
            
              | 172 | 
                          if (divs[i].style.display == 'block') { | 
            
            
              | 173 | 
                              divs[i].style.display = 'none';  | 
            
            
              | 174 | 
                          } else { | 
            
            
              | 175 | 
                              divs[i].style.display = 'block';  | 
            
            
              | 176 | 
                          }  | 
            
            
              | 177 | 
                      }  | 
            
            
              | 178 | 
                  }  | 
            
            
              | 179 | 
              }  | 
            
            
              | 180 | 
               | 
            
            
              | 181 | 
              /**  | 
            
            
              | 182 | 
               * To clone a field or a subfield by clickink on '+' button  | 
            
            
              | 183 | 
               */   | 
            
            
              | 184 | 
              function CloneField(index) { | 
            
            
              | 185 | 
                  var original = document.getElementById(index); //original <div>  | 
            
            
              | 186 | 
                  fields_in_use[index.substr(0, 7)]++;  | 
            
            
              | 187 | 
                  var clone = original.cloneNode(true);  | 
            
            
              | 188 | 
                  var new_key = CreateKey();  | 
            
            
              | 189 | 
                  var new_id  = original.getAttribute('id')+new_key; | 
            
            
              | 190 | 
                    | 
            
            
              | 191 | 
                  clone.setAttribute('id',new_id); // setting a new id for the parent div | 
            
            
              | 192 | 
                    | 
            
            
              | 193 | 
                  var divs = clone.getElementsByTagName('div'); | 
            
            
              | 194 | 
                    | 
            
            
              | 195 | 
                  [% UNLESS ( hide_marc ) %] // No indicator if hide_marc  | 
            
            
              | 196 | 
                      // setting a new name for the new indicator  | 
            
            
              | 197 | 
                      for(var i=0; i < 2; i++) { | 
            
            
              | 198 | 
                          var indicator = clone.getElementsByTagName('input')[i]; | 
            
            
              | 199 | 
                          indicator.setAttribute('name',indicator.getAttribute('name')+new_key); | 
            
            
              | 200 | 
                      }  | 
            
            
              | 201 | 
                  [% END %]  | 
            
            
              | 202 | 
                        | 
            
            
              | 203 | 
                  // settings all subfields  | 
            
            
              | 204 | 
                  for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div | 
            
            
              | 205 | 
                      if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield | 
            
            
              | 206 | 
                            | 
            
            
              | 207 | 
                          // set the attribute for the new 'div' subfields  | 
            
            
              | 208 | 
                          divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key); | 
            
            
              | 209 | 
                            | 
            
            
              | 210 | 
                          var inputs   = divs[i].getElementsByTagName('input'); | 
            
            
              | 211 | 
                          var id_input = "";  | 
            
            
              | 212 | 
                            | 
            
            
              | 213 | 
                          inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key); | 
            
            
              | 214 | 
                          inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key); | 
            
            
              | 215 | 
                          var id_input;  | 
            
            
              | 216 | 
                          try { | 
            
            
              | 217 | 
                            id_input = inputs[1].getAttribute('id')+new_key; | 
            
            
              | 218 | 
                              inputs[1].setAttribute('id',id_input); | 
            
            
              | 219 | 
                              inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key); | 
            
            
              | 220 | 
                          } catch(e) { | 
            
            
              | 221 | 
                            try{ // it s a select if it is not an input | 
            
            
              | 222 | 
                                  var selects = divs[i].getElementsByTagName('select'); | 
            
            
              | 223 | 
                                  id_input = selects[0].getAttribute('id')+new_key; | 
            
            
              | 224 | 
                                  selects[0].setAttribute('id',id_input); | 
            
            
              | 225 | 
                                  selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key); | 
            
            
              | 226 | 
                              }catch(e2){ // it is a textarea if it s not a select or an input | 
            
            
              | 227 | 
                                var textaeras = divs[i].getElementsByTagName('textarea'); | 
            
            
              | 228 | 
                                id_input = textaeras[0].getAttribute('id')+new_key; | 
            
            
              | 229 | 
                                textaeras[0].setAttribute('id',id_input); | 
            
            
              | 230 | 
                                  textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key); | 
            
            
              | 231 | 
                              }  | 
            
            
              | 232 | 
                          }  | 
            
            
              | 233 | 
                            | 
            
            
              | 234 | 
                          [% UNLESS ( advancedMARCEditor ) %]  | 
            
            
              | 235 | 
                          // when cloning a subfield, re set its label too.  | 
            
            
              | 236 | 
                          var labels = divs[i].getElementsByTagName('label'); | 
            
            
              | 237 | 
                          labels[0].setAttribute('for',id_input); | 
            
            
              | 238 | 
                          [% END %]  | 
            
            
              | 239 | 
                            | 
            
            
              | 240 | 
                          [% UNLESS ( hide_marc ) %]  | 
            
            
              | 241 | 
                              // updating javascript parameters on button up  | 
            
            
              | 242 | 
                              var imgs = divs[i].getElementsByTagName('img'); | 
            
            
              | 243 | 
                              imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');"); | 
            
            
              | 244 | 
                          [% END %]  | 
            
            
              | 245 | 
                            | 
            
            
              | 246 | 
                          // setting its '+' and '-' buttons  | 
            
            
              | 247 | 
                          try { | 
            
            
              | 248 | 
                              var spans = divs[i].getElementsByTagName('span'); | 
            
            
              | 249 | 
                              for (var j = 0; j < spans.length; j++) { | 
            
            
              | 250 | 
                                  if(spans[j].getAttribute('class') == 'buttonPlus'){ | 
            
            
              | 251 | 
                                      spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')"); | 
            
            
              | 252 | 
                                  } else if (spans[j].getAttribute('class') == 'buttonMinus') { | 
            
            
              | 253 | 
                                      spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')"); | 
            
            
              | 254 | 
                                  }  | 
            
            
              | 255 | 
                              }  | 
            
            
              | 256 | 
                          }  | 
            
            
              | 257 | 
                          catch(e){ | 
            
            
              | 258 | 
                              // do nothig if ButtonPlus & CloneButtonPlus don t exist.  | 
            
            
              | 259 | 
                          }  | 
            
            
              | 260 | 
                            | 
            
            
              | 261 | 
                          // button ...  | 
            
            
              | 262 | 
                          var spans=0;  | 
            
            
              | 263 | 
                          try { | 
            
            
              | 264 | 
                              spans = divs[i].getElementsByTagName('span'); | 
            
            
              | 265 | 
                          } catch(e) { | 
            
            
              | 266 | 
                              // no spans  | 
            
            
              | 267 | 
                          }  | 
            
            
              | 268 | 
                          if(spans){ | 
            
            
              | 269 | 
                              var buttonDot;  | 
            
            
              | 270 | 
                              if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus) | 
            
            
              | 271 | 
                                  buttonDot = spans[0];  | 
            
            
              | 272 | 
                                  if(buttonDot){ | 
            
            
              | 273 | 
                                      // 2 possibilities :  | 
            
            
              | 274 | 
                                      try{ | 
            
            
              | 275 | 
                                          var buttonDotOnClick = buttonDot.getAttribute('onclick'); | 
            
            
              | 276 | 
                                          if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin | 
            
            
              | 277 | 
                                              var re = /\('.*'\)/i; | 
            
            
              | 278 | 
                                              buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')"); | 
            
            
              | 279 | 
                                              if(buttonDotOnClick){ | 
            
            
              | 280 | 
                                                  buttonDot.setAttribute('onclick',buttonDotOnClick); | 
            
            
              | 281 | 
                                              }  | 
            
            
              | 282 | 
                                          } else { | 
            
            
              | 283 | 
                                              if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value | 
            
            
              | 284 | 
                                                    | 
            
            
              | 285 | 
                                                  var re1 = /&index=.*',/;  | 
            
            
              | 286 | 
                                                  var re2 = /,.*\)/;  | 
            
            
              | 287 | 
               | 
            
            
              | 288 | 
                                                  buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',"); | 
            
            
              | 289 | 
                                                  buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')"); | 
            
            
              | 290 | 
                                                    | 
            
            
              | 291 | 
                                                  if(buttonDotOnClick){ | 
            
            
              | 292 | 
                                                          buttonDot.setAttribute('onclick',buttonDotOnClick); | 
            
            
              | 293 | 
                                                  }  | 
            
            
              | 294 | 
                                              }  | 
            
            
              | 295 | 
                                          }  | 
            
            
              | 296 | 
                                          try { | 
            
            
              | 297 | 
                                            // do not copy the script section.  | 
            
            
              | 298 | 
                                            var script = spans[0].getElementsByTagName('script')[0]; | 
            
            
              | 299 | 
                                            spans[0].removeChild(script);  | 
            
            
              | 300 | 
                                          } catch(e) { | 
            
            
              | 301 | 
                                            // do nothing if there is no script  | 
            
            
              | 302 | 
                                          }  | 
            
            
              | 303 | 
                                    }catch(e){} | 
            
            
              | 304 | 
                                }  | 
            
            
              | 305 | 
                              }  | 
            
            
              | 306 | 
                          }  | 
            
            
              | 307 | 
                          [% UNLESS ( hide_marc ) %]  | 
            
            
              | 308 | 
                              var buttonUp = divs[i].getElementsByTagName('img')[0]; | 
            
            
              | 309 | 
                              buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')"); | 
            
            
              | 310 | 
                          [% END %]  | 
            
            
              | 311 | 
                            | 
            
            
              | 312 | 
                      } else { // it's a indicator div | 
            
            
              | 313 | 
                          if(divs[i].getAttribute('name') == 'div_indicator'){ | 
            
            
              | 314 | 
                              var inputs = divs[i].getElementsByTagName('input'); | 
            
            
              | 315 | 
                              inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key); | 
            
            
              | 316 | 
                              inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key); | 
            
            
              | 317 | 
                                | 
            
            
              | 318 | 
                              var CloneButtonPlus;  | 
            
            
              | 319 | 
                              try { | 
            
            
              | 320 | 
                                  var anchors = divs[i].getElementsByTagName('span'); | 
            
            
              | 321 | 
                                  for (var j = 0; j < anchors.length; j++) { | 
            
            
              | 322 | 
                                      if (anchors[j].getAttribute('class') == 'buttonPlus') { | 
            
            
              | 323 | 
                                          anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')"); | 
            
            
              | 324 | 
                                      } else if (anchors[j].getAttribute('class') == 'buttonMinus') { | 
            
            
              | 325 | 
                                          anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')"); | 
            
            
              | 326 | 
                                      }  | 
            
            
              | 327 | 
                                  }  | 
            
            
              | 328 | 
                              }  | 
            
            
              | 329 | 
                              catch(e){ | 
            
            
              | 330 | 
                                  // do nothig CloneButtonPlus doesn't exist.  | 
            
            
              | 331 | 
                              }  | 
            
            
              | 332 | 
                                | 
            
            
              | 333 | 
                              // setting its 'Expand' property  | 
            
            
              | 334 | 
                              var ExpandFieldA=0;  | 
            
            
              | 335 | 
                              try { | 
            
            
              | 336 | 
                                  ExpandFieldA = divs[i].getElementsByTagName('a')[0]; | 
            
            
              | 337 | 
                                  ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')"); | 
            
            
              | 338 | 
                              }  | 
            
            
              | 339 | 
                              catch(e){ | 
            
            
              | 340 | 
                                  // do nothig if ButtonPlus & CloneButtonPlus don t exist.  | 
            
            
              | 341 | 
                              }  | 
            
            
              | 342 | 
                                | 
            
            
              | 343 | 
                          }  | 
            
            
              | 344 | 
                      }  | 
            
            
              | 345 | 
                  }  | 
            
            
              | 346 | 
                    | 
            
            
              | 347 | 
                  // insert this line on the page  | 
            
            
              | 348 | 
                  original.parentNode.insertBefore(clone,original.nextSibling);  | 
            
            
              | 349 | 
              }  | 
            
            
              | 350 | 
               | 
            
            
              | 351 | 
              function CloneSubfield(index){ | 
            
            
              | 352 | 
                  var original = document.getElementById(index); //original <div>  | 
            
            
              | 353 | 
                  fields_in_use[index.substr(0, 12)]++;  | 
            
            
              | 354 | 
                  var clone = original.cloneNode(true);  | 
            
            
              | 355 | 
                  var new_key = CreateKey();  | 
            
            
              | 356 | 
                  var new_id  = original.getAttribute('id')+new_key; | 
            
            
              | 357 | 
                    | 
            
            
              | 358 | 
                  // set the attribute for the new 'div' subfields  | 
            
            
              | 359 | 
                  var inputs     = clone.getElementsByTagName('input'); | 
            
            
              | 360 | 
                  var selects    = clone.getElementsByTagName('select'); | 
            
            
              | 361 | 
                  var textareas  = clone.getElementsByTagName('textarea'); | 
            
            
              | 362 | 
                        | 
            
            
              | 363 | 
                  // input  | 
            
            
              | 364 | 
                  var id_input = "";  | 
            
            
              | 365 | 
                  for(var i=0,len=inputs.length; i<len ; i++ ){ | 
            
            
              | 366 | 
                      id_input = inputs[i].getAttribute('id')+new_key; | 
            
            
              | 367 | 
                      inputs[i].setAttribute('id',id_input); | 
            
            
              | 368 | 
                      inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key); | 
            
            
              | 369 | 
                  }  | 
            
            
              | 370 | 
                    | 
            
            
              | 371 | 
                  // select   | 
            
            
              | 372 | 
                  for(var i=0,len=selects.length; i<len ; i++ ){ | 
            
            
              | 373 | 
                      id_input = selects[i].getAttribute('id')+new_key; | 
            
            
              | 374 | 
                      selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key); | 
            
            
              | 375 | 
                      selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key); | 
            
            
              | 376 | 
                  }  | 
            
            
              | 377 | 
                    | 
            
            
              | 378 | 
                  // textarea  | 
            
            
              | 379 | 
                  for(var i=0,len=textareas.length; i<len ; i++ ){ | 
            
            
              | 380 | 
                      id_input = textareas[i].getAttribute('id')+new_key; | 
            
            
              | 381 | 
                      textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key); | 
            
            
              | 382 | 
                      textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key); | 
            
            
              | 383 | 
                  }  | 
            
            
              | 384 | 
                    | 
            
            
              | 385 | 
                  [% UNLESS ( advancedMARCEditor ) %]  | 
            
            
              | 386 | 
                  // when cloning a subfield, reset its label too.  | 
            
            
              | 387 | 
                  var label = clone.getElementsByTagName('label')[0]; | 
            
            
              | 388 | 
                  label.setAttribute('for',id_input); | 
            
            
              | 389 | 
                  [% END %]  | 
            
            
              | 390 | 
                    | 
            
            
              | 391 | 
                  // setting a new if for the parent div  | 
            
            
              | 392 | 
                  clone.setAttribute('id',new_id); | 
            
            
              | 393 | 
                    | 
            
            
              | 394 | 
                  try { | 
            
            
              | 395 | 
                    var buttonUp = clone.getElementsByTagName('img')[0]; | 
            
            
              | 396 | 
                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')"); | 
            
            
              | 397 | 
                    var spans = clone.getElementsByTagName('span'); | 
            
            
              | 398 | 
                    if(spans.length){ | 
            
            
              | 399 | 
                        for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){ | 
            
            
              | 400 | 
                          if(spans[i].getAttribute('class') == 'buttonPlus'){ | 
            
            
              | 401 | 
                                  spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')"); | 
            
            
              | 402 | 
                              } else if (spans[i].getAttribute('class') == 'buttonMinus') { | 
            
            
              | 403 | 
                                  spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')"); | 
            
            
              | 404 | 
                              }  | 
            
            
              | 405 | 
                          }  | 
            
            
              | 406 | 
                      }  | 
            
            
              | 407 | 
                  }  | 
            
            
              | 408 | 
                  catch(e){ | 
            
            
              | 409 | 
                      // do nothig if ButtonPlus & CloneButtonPlus don't exist.  | 
            
            
              | 410 | 
                  }  | 
            
            
              | 411 | 
                  // insert this line on the page  | 
            
            
              | 412 | 
                  original.parentNode.insertBefore(clone,original.nextSibling);  | 
            
            
              | 413 | 
              }  | 
            
            
              | 414 | 
               | 
            
            
              | 415 | 
               /**  | 
            
            
              | 416 | 
               * This function removes or clears unwanted subfields  | 
            
            
              | 417 | 
               */  | 
            
            
              | 418 | 
              function UnCloneField(index) { | 
            
            
              | 419 | 
                  var original = document.getElementById(index);  | 
            
            
              | 420 | 
                  var field_id;  | 
            
            
              | 421 | 
                  if (index.match("tag")) { | 
            
            
              | 422 | 
                      field_id = index.substr(0, 7);  | 
            
            
              | 423 | 
                  } else { | 
            
            
              | 424 | 
                      field_id = index.substr(0, 12);  | 
            
            
              | 425 | 
                  }  | 
            
            
              | 426 | 
                  if (1 == fields_in_use[field_id]) { | 
            
            
              | 427 | 
                      // clear inputs, but don't delete  | 
            
            
              | 428 | 
                      $(":input.input_marceditor", original).each(function(){ | 
            
            
              | 429 | 
                          // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for  | 
            
            
              | 430 | 
                          // hint about clearing selects correctly  | 
            
            
              | 431 | 
                          var type = this.type;  | 
            
            
              | 432 | 
                          var tag = this.tagName.toLowerCase();  | 
            
            
              | 433 | 
                          if (type == 'text' || type == 'password' || tag == 'textarea') { | 
            
            
              | 434 | 
                              this.value = "";  | 
            
            
              | 435 | 
                          } else if (type == 'checkbox' || type == 'radio') { | 
            
            
              | 436 | 
                              this.checked = false;  | 
            
            
              | 437 | 
                          } else if (tag == 'select') { | 
            
            
              | 438 | 
                              this.selectedIndex = -1;  | 
            
            
              | 439 | 
                          }  | 
            
            
              | 440 | 
                      });  | 
            
            
              | 441 | 
                      $(":input.indicator", original).val(""); | 
            
            
              | 442 | 
                  } else { | 
            
            
              | 443 | 
                      original.parentNode.removeChild(original);  | 
            
            
              | 444 | 
                      fields_in_use[field_id]--;  | 
            
            
              | 445 | 
                  }  | 
            
            
              | 446 | 
              }  | 
            
            
              | 447 | 
               | 
            
            
              | 448 | 
               | 
            
            
              | 449 | 
              /**  | 
            
            
              | 450 | 
               * This function create a random number  | 
            
            
              | 451 | 
               */  | 
            
            
              | 452 | 
              function CreateKey(){ | 
            
            
              | 453 | 
                  return parseInt(Math.random() * 100000);  | 
            
            
              | 454 | 
              }  | 
            
            
              | 455 | 
               | 
            
            
              | 456 | 
              /**  | 
            
            
              | 457 | 
               * This function allows to move a subfield up by clickink on the 'up' button .  | 
            
            
              | 458 | 
               */  | 
            
            
              | 459 | 
              function upSubfield(index) { | 
            
            
              | 460 | 
                  try{ | 
            
            
              | 461 | 
                      var line = document.getElementById(index); // get the line where the user has clicked.  | 
            
            
              | 462 | 
                  } catch(e) { | 
            
            
              | 463 | 
                      return; // this line doesn't exist...  | 
            
            
              | 464 | 
                  }  | 
            
            
              | 465 | 
                  var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")  | 
            
            
              | 466 | 
                    | 
            
            
              | 467 | 
                  // getting all subfields for this tag  | 
            
            
              | 468 | 
                  var subfields = tag.getElementsByTagName('div'); | 
            
            
              | 469 | 
                  var subfieldsLength = subfields.length;  | 
            
            
              | 470 | 
                    | 
            
            
              | 471 | 
                  if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.  | 
            
            
              | 472 | 
                    | 
            
            
              | 473 | 
                  // among all subfields   | 
            
            
              | 474 | 
                  for(var i=0;i<subfieldsLength;i++){  | 
            
            
              | 475 | 
                      if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked : | 
            
            
              | 476 | 
                          if(i==1){ // if the clicked subfield is on the top | 
            
            
              | 477 | 
                              tag.appendChild(subfields[1]);  | 
            
            
              | 478 | 
                              return;  | 
            
            
              | 479 | 
                          } else { | 
            
            
              | 480 | 
                              var lineAbove = subfields[i-1];  | 
            
            
              | 481 | 
                              tag.insertBefore(line,lineAbove);  | 
            
            
              | 482 | 
                              return;  | 
            
            
              | 483 | 
                          }  | 
            
            
              | 484 | 
                      }  | 
            
            
              | 485 | 
                  }  | 
            
            
              | 486 | 
              }  | 
            
            
              | 487 | 
               | 
            
            
              | 488 | 
              function unHideSubfield(index,labelindex) { // FIXME :: is it used ? | 
            
            
              | 489 | 
                  subfield = document.getElementById(index);  | 
            
            
              | 490 | 
                  subfield.style.display = 'block';  | 
            
            
              | 491 | 
                  label = document.getElementById(labelindex);  | 
            
            
              | 492 | 
                  label.style.display='none';   | 
            
            
              | 493 | 
              }  | 
            
            
              | 494 | 
               | 
            
        
          | 495 | 
          function addauthority() { | 
          112 | 
          function addauthority() { | 
        
        
          | 496 | 
              X = document.forms[0].authtype.value;  | 
          113 | 
              X = document.forms[0].authtype.value;  | 
        
        
          | 497 | 
              window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;  | 
          114 | 
              window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;  | 
        
  
    | 
      
            Lines 591-740
          function searchauthority() {
      
      
        Link Here
      
     | 
  
        
          | 591 | 
          	<ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>  | 
          208 | 
          	<ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>  | 
        
        
          | 592 | 
           | 
          209 | 
           | 
        
        
          | 593 | 
          <div id="authoritytabs" class="toptabs numbered">  | 
          210 | 
          <div id="authoritytabs" class="toptabs numbered">  | 
        
          
            
              | 594 | 
                     <ul> [% FOREACH BIG_LOO IN BIG_LOOP %]  | 
              211 | 
                  <ul>  | 
            
            
              | 595 | 
                          <li>[% IF ( BIG_LOO.number ) %]  | 
              212 | 
                      [% FOREACH BIG_LOO IN BIG_LOOP %]  | 
            
            
              | 596 | 
                              <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>  | 
              213 | 
                      <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>  | 
            
            
              | 597 | 
                          [% ELSE %]  | 
              214 | 
                      [% END %]  | 
            
            
              | 598 | 
                              <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>  | 
              215 | 
                  </ul>  | 
            
            
              | 599 | 
                          [% END %]</li>  | 
               | 
               | 
            
            
              | 600 | 
                      [% END %]</ul>  | 
            
        
          | 601 | 
           | 
          216 | 
           | 
        
        
          | 602 | 
          [% FOREACH BIG_LOO IN BIG_LOOP %]  | 
          217 | 
          [% FOREACH BIG_LOO IN BIG_LOOP %]  | 
        
          
            
              | 603 | 
                  <!-- hide every tab except the 1st -->  | 
              218 | 
                  <div id="tab[% BIG_LOO.number %]XX">  | 
            
            
              | 604 | 
                          [% IF ( BIG_LOO.number ) %]  | 
              219 | 
               | 
            
            
              | 605 | 
                              <div id="tab[% BIG_LOO.number %]XX">  | 
              220 | 
                  [% FOREACH innerloo IN BIG_LOO.innerloop %]  | 
            
            
               | 
               | 
              221 | 
                  [% IF ( innerloo.tag ) %]  | 
            
            
              | 222 | 
                  <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">  | 
            
            
              | 223 | 
                      <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">  | 
            
            
              | 224 | 
                      [% UNLESS hide_marc %]  | 
            
            
              | 225 | 
                          [% IF advancedMARCEditor %]  | 
            
            
              | 226 | 
                              <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a> | 
            
        
          | 606 | 
                      [% ELSE %]  | 
          227 | 
                      [% ELSE %]  | 
        
          
            
              | 607 | 
                              <div id="tab[% BIG_LOO.number %]XX">  | 
              228 | 
                              <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>  | 
            
        
          | 608 | 
                      [% END %]  | 
          229 | 
                      [% END %]  | 
        
          
            
              | 609 | 
                        | 
              230 | 
                              [% IF ( innerloo.fixedfield ) %]  | 
            
            
              | 610 | 
                      [% FOREACH innerloo IN BIG_LOO.innerloop %]  | 
              231 | 
                                  <input type="text"  | 
            
            
              | 611 | 
                          [% IF ( innerloo.tag ) %]  | 
              232 | 
                                      tabindex="1"  | 
            
            
              | 612 | 
                              <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">  | 
              233 | 
                                      class="indicator flat"  | 
            
            
              | 613 | 
                              <div class="tag_title" name="div_indicator">  | 
              234 | 
                                      style="display:none;"  | 
            
            
              | 614 | 
                              [% UNLESS ( innerloo.hide_marc ) %]  | 
              235 | 
                                      name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 615 | 
              		    [% IF ( innerloo.advancedMARCEditor ) %]  | 
              236 | 
                                      size="1"  | 
            
            
              | 616 | 
                                  <a class="tagnum" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag %]</a> | 
              237 | 
                                      maxlength="1"  | 
            
            
              | 617 | 
              		    [% ELSE %]  | 
              238 | 
                                      value="[% innerloo.indicator1 %]" />  | 
            
            
              | 618 | 
                                  <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>  | 
              239 | 
                                  <input type="text"  | 
            
            
              | 619 | 
              		    [% END %]  | 
              240 | 
                                      tabindex="1"  | 
            
            
              | 620 | 
                                  [% IF ( innerloo.fixedfield ) %]  | 
              241 | 
                                      class="indicator flat"  | 
            
            
              | 621 | 
                                  <input class="indicator flat"  | 
              242 | 
                                      style="display:none;"  | 
            
            
              | 622 | 
                                              type="text"  | 
              243 | 
                                      name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 623 | 
                                              style="display:none;"  | 
              244 | 
                                      size="1"  | 
            
            
              | 624 | 
                                              name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
              245 | 
                                      maxlength="1"  | 
            
            
              | 625 | 
                                              size="1"  | 
              246 | 
                                      value="[% innerloo.indicator2 %]" />  | 
            
            
              | 626 | 
                                              maxlength="1"  | 
               | 
               | 
            
            
              | 627 | 
                                              value="[% innerloo.indicator1 %]" />  | 
            
            
              | 628 | 
                                  <input class="indicator flat"  | 
            
            
              | 629 | 
                                              type="text"  | 
            
            
              | 630 | 
                                              style="display:none;"  | 
            
            
              | 631 | 
                                              name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 632 | 
                                              size="1"  | 
            
            
              | 633 | 
                                              maxlength="1"  | 
            
            
              | 634 | 
                                              value="[% innerloo.indicator2 %]" />  | 
            
            
              | 635 | 
                                  [% ELSE %]  | 
            
            
              | 636 | 
                                  <input class="indicator flat"  | 
            
            
              | 637 | 
                                              type="text"  | 
            
            
              | 638 | 
                                              name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 639 | 
                                              size="1"  | 
            
            
              | 640 | 
                                              maxlength="1"  | 
            
            
              | 641 | 
                                              value="[% innerloo.indicator1 %]" />  | 
            
            
              | 642 | 
                                  <input class="indicator flat"  | 
            
            
              | 643 | 
                                              type="text"  | 
            
            
              | 644 | 
                                              name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 645 | 
                                              size="1"  | 
            
            
              | 646 | 
                                              maxlength="1"  | 
            
            
              | 647 | 
                                              value="[% innerloo.indicator2 %]" />  | 
            
            
              | 648 | 
                                  [% END %] -  | 
            
        
          | 649 | 
                          [% ELSE %]  | 
          247 | 
                          [% ELSE %]  | 
        
          
            
              | 650 | 
                                  [% IF ( innerloo.fixedfield ) %]  | 
              248 | 
                                  <input type="text"  | 
            
            
              | 651 | 
                                      <input type="hidden"  | 
              249 | 
                                      tabindex="1"  | 
            
            
              | 652 | 
                                          name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"  | 
              250 | 
                                      class="indicator flat"  | 
            
            
              | 653 | 
                                          value="[% innerloo.indicator1 %][% innerloo.random %]" />  | 
              251 | 
                                      name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 654 | 
                                      <input type="hidden"  | 
              252 | 
                                      size="1"  | 
            
            
              | 655 | 
                                          name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"  | 
              253 | 
                                      maxlength="1"  | 
            
            
              | 656 | 
                                          value="[% innerloo.indicator2 %][% innerloo.random %]" />  | 
              254 | 
                                      value="[% innerloo.indicator1 %]" />  | 
            
            
              | 657 | 
                                  [% ELSE %]  | 
              255 | 
                                  <input type="text"  | 
            
            
              | 658 | 
                                      <input type="hidden"  | 
              256 | 
                                      tabindex="1"  | 
            
            
              | 659 | 
                                          name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"  | 
              257 | 
                                      class="indicator flat"  | 
            
            
              | 660 | 
                                          value="[% innerloo.indicator1 %][% innerloo.random %]" />  | 
              258 | 
                                      name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 661 | 
                                      <input type="hidden"  | 
              259 | 
                                      size="1"  | 
            
            
              | 662 | 
                                          name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"  | 
              260 | 
                                      maxlength="1"  | 
            
            
              | 663 | 
                                          value="[% innerloo.indicator2 %][% innerloo.random %]" />  | 
              261 | 
                                      value="[% innerloo.indicator2 %]" />  | 
            
            
              | 664 | 
                                  [% END %]  | 
              262 | 
                              [% END %] -  | 
            
            
              | 665 | 
                              [% END %]  | 
              263 | 
                      [% ELSE %]  | 
            
            
              | 666 | 
                    | 
              264 | 
                              [% IF ( innerloo.fixedfield ) %]  | 
            
            
              | 667 | 
                              [% UNLESS ( innerloo.advancedMARCEditor ) %]  | 
              265 | 
                                  <input type="hidden"  | 
            
            
              | 668 | 
                                  <a onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag_lib %]</a> | 
              266 | 
                                      tabindex="1"  | 
            
            
               | 
               | 
              267 | 
                                      name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 268 | 
                                      value="[% innerloo.indicator1 %]" />  | 
            
            
              | 269 | 
                                  <input type="hidden"  | 
            
            
              | 270 | 
                                      tabindex="1"  | 
            
            
              | 271 | 
                                      name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 272 | 
                                      value="[% innerloo.indicator2 %]" />  | 
            
            
              | 273 | 
                              [% ELSE %]  | 
            
            
              | 274 | 
                                  <input type="hidden"  | 
            
            
              | 275 | 
                                      tabindex="1"  | 
            
            
              | 276 | 
                                      name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 277 | 
                                      value="[% innerloo.indicator1 %]" />  | 
            
            
              | 278 | 
                                  <input type="hidden"  | 
            
            
              | 279 | 
                                      tabindex="1"  | 
            
            
              | 280 | 
                                      name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"  | 
            
            
              | 281 | 
                                      value="[% innerloo.indicator2 %]" />  | 
            
        
          | 669 | 
                          [% END %]  | 
          282 | 
                          [% END %]  | 
        
            
               | 
               | 
              283 | 
                      [% END %]  | 
            
            
              | 284 | 
               | 
            
            
              | 285 | 
                          [% UNLESS advancedMARCEditor %]  | 
            
            
              | 286 | 
                              <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a> | 
            
            
              | 287 | 
                          [% END %]  | 
            
            
              | 288 | 
                              <span class="field_controls">  | 
            
        
          | 670 | 
                          [% IF ( innerloo.repeatable ) %]  | 
          289 | 
                          [% IF ( innerloo.repeatable ) %]  | 
        
          
            
              | 671 | 
                                  <span class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">+</span> | 
              290 | 
                                  <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag"> | 
            
            
               | 
               | 
              291 | 
                                      <img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />  | 
            
            
              | 292 | 
                                  </a>  | 
            
        
          | 672 | 
                          [% END %]  | 
          293 | 
                          [% END %]  | 
        
          
            
              | 673 | 
                              [% UNLESS ( innerloo.mandatory ) %]  | 
              294 | 
                                  <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag"> | 
            
            
              | 674 | 
                                  <span class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">−</span> | 
              295 | 
                                      <img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />  | 
            
            
               | 
               | 
              296 | 
                                  </a>  | 
            
            
              | 297 | 
                              </span>  | 
            
            
              | 298 | 
               | 
            
            
              | 299 | 
                      </div>  | 
            
            
              | 300 | 
               | 
            
            
              | 301 | 
                      [% FOREACH subfield_loo IN innerloo.subfield_loop %]  | 
            
            
              | 302 | 
                          <!--  One line on the marc editor -->  | 
            
            
              | 303 | 
                          <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">  | 
            
            
              | 304 | 
               | 
            
            
              | 305 | 
                              [% UNLESS advancedMARCEditor %]  | 
            
            
              | 306 | 
                                  [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">  | 
            
            
              | 307 | 
                                  [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">  | 
            
            
              | 308 | 
                                  [% END %]  | 
            
        
          | 675 | 
                          [% END %]  | 
          309 | 
                          [% END %]  | 
        
        
          | 676 | 
                            | 
          310 | 
                            | 
        
          
            
              | 677 | 
                          </div>  | 
              311 | 
                              [% UNLESS hide_marc %]  | 
            
            
              | 678 | 
                    | 
              312 | 
                              <span class="subfieldcode">  | 
            
            
              | 679 | 
                          [% FOREACH subfield_loo IN innerloo.subfield_loop %]  | 
               | 
               | 
            
            
              | 680 | 
                              <!--  One line on the marc editor -->  | 
            
            
              | 681 | 
                              <div name="line" class="subfield_line" style="[% subfield_loo.visibility %];" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %]">  | 
            
            
              | 682 | 
                                | 
            
            
              | 683 | 
                                  [% UNLESS ( subfield_loo.advancedMARCEditor ) %]  | 
            
            
              | 684 | 
                                      [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield" >  | 
            
            
              | 685 | 
                                      [% ELSE %] <label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield" >[% END %]  | 
            
            
              | 686 | 
                                  [% END %]   | 
            
            
              | 687 | 
                                    | 
            
            
              | 688 | 
                                  [% UNLESS ( subfield_loo.hide_marc ) %]  | 
            
        
          | 689 | 
                              [% IF ( subfield_loo.fixedfield ) %]  | 
          313 | 
                              [% IF ( subfield_loo.fixedfield ) %]  | 
        
          
            
              | 690 | 
                                      <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" /> | 
              314 | 
                                      <img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" /> | 
            
            
              | 691 | 
                                  [% ELSE %]  | 
               | 
               | 
            
            
              | 692 | 
                                      <img class="buttonUp"  src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" /> | 
            
            
              | 693 | 
                                      [% END %]  | 
            
            
              | 694 | 
                                          <input title="[% subfield_loo.marc_lib_plain %]"  | 
            
            
              | 695 | 
                                              style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text"  | 
            
            
              | 696 | 
                                              name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"  | 
            
            
              | 697 | 
                                              value="[% subfield_loo.subfield %]"  | 
            
            
              | 698 | 
                                              size="1"  | 
            
            
              | 699 | 
                                              maxlength="1"  | 
            
            
              | 700 | 
                                              class="flat"  | 
            
            
              | 701 | 
                                              tabindex="0" />  | 
            
        
          | 702 | 
                              [% ELSE %]  | 
          315 | 
                              [% ELSE %]  | 
        
          
            
              | 703 | 
                                      <input type="hidden"  | 
              316 | 
                                      <img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" /> | 
            
            
              | 704 | 
                                          name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"  | 
               | 
               | 
            
            
              | 705 | 
                                          value="[% subfield_loo.subfield %]"/>  | 
            
        
          | 706 | 
                              [% END %]  | 
          317 | 
                              [% END %]  | 
        
            
               | 
               | 
              318 | 
                                      <input type="text"  | 
            
            
              | 319 | 
                                          title="[% subfield_loo.marc_lib_plain %]"  | 
            
            
              | 320 | 
                                          style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"  | 
            
            
              | 321 | 
                                          name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"  | 
            
            
              | 322 | 
                                          value="[% subfield_loo.subfield %]"  | 
            
            
              | 323 | 
                                          size="1"  | 
            
            
              | 324 | 
                                          maxlength="1"  | 
            
            
              | 325 | 
                                          class="flat"  | 
            
            
              | 326 | 
                                          tabindex="0" />  | 
            
            
              | 327 | 
                              </span>  | 
            
            
              | 328 | 
                              [% ELSE %]  | 
            
            
              | 329 | 
                                  <input type="hidden"  | 
            
            
              | 330 | 
                                      name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"  | 
            
            
              | 331 | 
                                      value="[% subfield_loo.subfield %]" />  | 
            
            
              | 332 | 
                              [% END %]  | 
            
            
              | 333 | 
               | 
            
            
              | 334 | 
                              [% UNLESS advancedMARCEditor %]  | 
            
            
              | 335 | 
                                  [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]  | 
            
            
              | 336 | 
                                      [% subfield_loo.marc_lib_plain %]  | 
            
            
              | 337 | 
                                      [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]  | 
            
            
              | 338 | 
                                  </span>  | 
            
            
              | 339 | 
                                  </label>  | 
            
            
              | 340 | 
                              [% END %]  | 
            
        
          | 707 | 
                            | 
          341 | 
                            | 
        
          
            
              | 708 | 
                                  [% UNLESS ( subfield_loo.advancedMARCEditor ) %]  | 
              342 | 
                              [% subfield_loo.marc_value %]  | 
            
            
              | 709 | 
                                      [% IF ( subfield_loo.mandatory ) %]<span class="subfield_mandatory">[% END %]  | 
              343 | 
               | 
            
            
              | 710 | 
                                          [% subfield_loo.marc_lib %]  | 
              344 | 
                              <span class="subfield_controls">  | 
            
            
              | 711 | 
                                      [% IF ( subfield_loo.mandatory ) %]</span>[% END %]  | 
              345 | 
                              [% IF ( subfield_loo.repeatable ) %]  | 
            
            
              | 712 | 
                                      </label>  | 
              346 | 
                                  <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;"> | 
            
            
              | 713 | 
                                  [% END %]  | 
              347 | 
                                      <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />  | 
            
            
              | 714 | 
                                    | 
              348 | 
                                  </a>  | 
            
            
              | 715 | 
                                  [% subfield_loo.marc_value %]  | 
              349 | 
                                  <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"> | 
            
            
              | 716 | 
                                    | 
              350 | 
                                      <img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />  | 
            
            
              | 717 | 
                                  [% IF ( subfield_loo.repeatable ) %]  | 
              351 | 
                                  </a>  | 
            
            
              | 718 | 
                                      <a href="#" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a> | 
              352 | 
                              [% END %]  | 
            
            
              | 719 | 
                                  [% END %]  | 
              353 | 
                              </span>  | 
            
            
              | 720 | 
                                  [% UNLESS ( subfield_loo.mandatory ) %]  | 
               | 
               | 
            
            
              | 721 | 
                                      <a href="#" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a> | 
            
            
              | 722 | 
                                  [% END %]  | 
            
            
              | 723 | 
                                    | 
            
            
              | 724 | 
                              </div>  | 
            
            
              | 725 | 
                              <!-- End of the line -->  | 
            
        
          | 726 | 
                            | 
          354 | 
                            | 
        
            
              | 727 | 
                          [% END %]  | 
               | 
               | 
            
        
          | 728 | 
                      </div>  | 
          355 | 
                      </div>  | 
        
          
            
              | 729 | 
                          [% END %]<!-- tag -->  | 
              356 | 
                          <!-- End of the line -->  | 
            
        
          | 730 | 
                  [% END %]  | 
          357 | 
                  [% END %]  | 
        
            
              | 731 | 
                      </div>  | 
               | 
               | 
            
            
              | 732 | 
              [% END %]  | 
            
        
          | 733 | 
           | 
          358 | 
           | 
        
          
            
              | 734 | 
              [% UNLESS ( singletab ) %]  | 
              359 | 
                  </div>  | 
            
            
              | 735 | 
                  </div>	  | 
              360 | 
                  [% END %]<!-- if innerloo.tag -->  | 
            
            
              | 736 | 
              [% END %]  | 
              361 | 
                  [% END %]<!-- BIG_LOO.innerloop -->  | 
            
            
              | 737 | 
              </div>  | 
              362 | 
                  </div>  | 
            
            
               | 
               | 
              363 | 
              [% END %]<!-- BIG_LOOP -->  | 
            
            
              | 364 | 
               | 
            
            
              | 365 | 
              </div><!-- tabs -->  | 
            
        
          | 738 | 
           | 
          366 | 
           | 
        
        
          | 739 | 
          <div name="hidden" id="hidden" class="tab">  | 
          367 | 
          <div name="hidden" id="hidden" class="tab">  | 
        
        
          | 740 | 
          [% FOREACH hidden_loo IN hidden_loop %]  | 
          368 | 
          [% FOREACH hidden_loo IN hidden_loop %]  | 
        
  
    | 
      
            Lines 756-765
          function searchauthority() {
      
      
        Link Here
      
     | 
  
        
          | 756 | 
              <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />  | 
          384 | 
              <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />  | 
        
        
          | 757 | 
              <input type="hidden" name="field_value" value="[% authtypecode %]" />  | 
          385 | 
              <input type="hidden" name="field_value" value="[% authtypecode %]" />  | 
        
        
          | 758 | 
          [% END %]  | 
          386 | 
          [% END %]  | 
        
            
               | 
               | 
              387 | 
               | 
            
        
          | 759 | 
          <fieldset class="action">  | 
          388 | 
          <fieldset class="action">  | 
        
        
          | 760 | 
                  <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />  | 
          389 | 
                  <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />  | 
        
        
          | 761 | 
          </fieldset>  | 
          390 | 
          </fieldset>  | 
        
            
               | 
               | 
              391 | 
               | 
            
        
          | 762 | 
          </form>  | 
          392 | 
          </form>  | 
        
            
               | 
               | 
              393 | 
               | 
            
            
              | 394 | 
              </div>  | 
            
        
          | 763 | 
          </div>  | 
          395 | 
          </div>  | 
        
        
          | 764 | 
          </div>  | 
          396 | 
          </div>  | 
        
        
          | 765 | 
           | 
          397 | 
           |