Small patch again to fix repeated col in reserveratios.tmpl
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / authorities.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Authorities &rsaquo; <!-- TMPL_IF name="authid" -->Modify authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- TMPL_ELSE -->Adding authority (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/yui/plugins/bubbling-min.js"></script>
5
6 <script type="text/javascript">
7 //<![CDATA[
8
9      var fields_in_use = {};
10          $(document).ready(function() {
11                 $('#authoritytabs > ul').tabs();
12         $('.tag').each(function() {
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(){
29                         return $(this).Check();
30                 });
31          });
32
33 /**
34  * check if mandatory subfields are writed
35  */
36 function AreMandatoriesNotOk(){
37     var mandatories = new Array();
38     var tab = new Array();
39     var label = new Array();
40     var flag=0;
41     <!-- TMPL_LOOP NAME='BIG_LOOP' --><!-- TMPL_LOOP NAME='innerloop' --><!-- TMPL_LOOP NAME='subfield_loop'--><!-- TMPL_IF NAME='mandatory'-->mandatories.push("<!-- TMPL_VAR NAME='id' -->");
42                         tab.push("<!-- TMPL_VAR NAME='number' -->");
43                         label.push("<!-- TMPL_VAR NAME='marc_lib' ESCAPE=JS-->");<!-- /TMPL_IF --><!-- /TMPL_LOOP --><!-- /TMPL_LOOP --><!-- /TMPL_LOOP -->
44     var StrAlert = _("Can't save this record because the following field aren't filled :\n\n");
45     for(var i=0,len=mandatories.length; i<len ; i++){
46         //alert (  mandatories[i]);
47         if( ! document.getElementById(mandatories[i]).value){
48             flag = 1;
49             document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
50             document.getElementById(mandatories[i]).focus();
51             StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n";
52         }
53     }
54     if(flag){
55       return StrAlert;
56   } else {
57     return flag;
58   }
59 }
60
61 /**
62  * 
63  * 
64  */
65 function Check(){
66     var StrAlert = AreMandatoriesNotOk();
67     if( ! StrAlert ){
68         document.f.submit();
69         return true;
70     } else {
71         alert(StrAlert);
72         return false;
73     }
74 }
75
76
77
78
79 function AddField(field,cntrepeatfield) {
80     document.forms['f'].op.value = "addfield";
81     document.forms['f'].addfield_field.value=field;
82     document.forms['f'].repeat_field.value=cntrepeatfield;
83     document.f.submit();
84 }
85
86 function Dopop(link,i) {
87     defaultvalue = document.getElementById(i).value;
88     window.open(link+"&result="+defaultvalue,"value builder",'width=700,height=550,toolbar=false,scrollbars=yes');
89 }
90
91 function ExpandField(index) {
92     var original = document.getElementById(index); //original <div>
93     var divs = original.getElementsByTagName('div');
94     for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
95         if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
96             if (divs[i].style.display == 'block') {
97                 divs[i].style.display = 'none';
98             } else {
99                 divs[i].style.display = 'block';
100             }
101         }
102     }
103 }
104
105 /**
106  * To clone a field or a subfield by clickink on '+' button
107  */ 
108 function CloneField(index) {
109     var original = document.getElementById(index); //original <div>
110     fields_in_use[index.substr(0, 7)]++;
111     var clone = original.cloneNode(true);
112     var new_key = CreateKey();
113     var new_id  = original.getAttribute('id')+new_key;
114     
115     clone.setAttribute('id',new_id); // setting a new id for the parent div
116     
117     var divs = clone.getElementsByTagName('div');
118     
119     <!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
120         // setting a new name for the new indicator
121         for(var i=0; i < 2; i++) {
122             var indicator = clone.getElementsByTagName('input')[i];
123             indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
124         }
125     <!-- /TMPL_UNLESS -->
126         
127     // settings all subfields
128     for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
129         if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
130             
131             // set the attribute for the new 'div' subfields
132             divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
133             
134             var inputs   = divs[i].getElementsByTagName('input');
135             var id_input = "";
136             
137             inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
138             inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
139             var id_input;
140             try {
141               id_input = inputs[1].getAttribute('id')+new_key;
142                 inputs[1].setAttribute('id',id_input);
143                 inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
144             } catch(e) {
145               try{ // it s a select if it is not an input
146                     var selects = divs[i].getElementsByTagName('select');
147                     id_input = selects[0].getAttribute('id')+new_key;
148                     selects[0].setAttribute('id',id_input);
149                     selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
150                 }catch(e2){ // it is a textarea if it s not a select or an input
151                   var textaeras = divs[i].getElementsByTagName('textarea');
152                   id_input = textaeras[0].getAttribute('id')+new_key;
153                   textaeras[0].setAttribute('id',id_input);
154                     textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
155                 }
156             }
157             
158             <!-- TMPL_UNLESS NAME='advancedMARCEditor'-->
159             // when cloning a subfield, re set its label too.
160             var labels = divs[i].getElementsByTagName('label');
161             labels[0].setAttribute('for',id_input);
162             <!-- /TMPL_UNLESS -->
163             
164             <!-- TMPL_UNLESS NAME='hide_marc'-->
165                 // updating javascript parameters on button up
166                 var imgs = divs[i].getElementsByTagName('img');
167                 imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
168             <!-- /TMPL_UNLESS -->
169             
170             // setting its '+' and '-' buttons
171             try {
172                 var spans = divs[i].getElementsByTagName('span');
173                 for (var j = 0; j < spans.length; j++) {
174                     if(spans[j].getAttribute('class') == 'buttonPlus'){
175                         spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
176                     } else if (spans[j].getAttribute('class') == 'buttonMinus') {
177                         spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
178                     }
179                 }
180             }
181             catch(e){
182                 // do nothig if ButtonPlus & CloneButtonPlus don t exist.
183             }
184             
185             // button ...
186             var spans=0;
187             try {
188                 spans = divs[i].getElementsByTagName('span');
189             } catch(e) {
190                 // no spans
191             }
192             if(spans){
193                 var buttonDot;
194                 if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
195                     buttonDot = spans[0];
196                     if(buttonDot){
197                         // 2 possibilities :
198                         try{
199                             var buttonDotOnClick = buttonDot.getAttribute('onclick');
200                             if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
201                                 var re = /\('.*'\)/i;
202                                 buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
203                                 if(buttonDotOnClick){
204                                     buttonDot.setAttribute('onclick',buttonDotOnClick);
205                                 }
206                             } else {
207                                 if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
208                                     
209                                     var re1 = /&index=.*',/;
210                                     var re2 = /,.*\)/;
211
212                                     buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
213                                     buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
214                                     
215                                     if(buttonDotOnClick){
216                                             buttonDot.setAttribute('onclick',buttonDotOnClick);
217                                     }
218                                 }
219                             }
220                             try {
221                               // do not copy the script section.
222                               var script = spans[0].getElementsByTagName('script')[0];
223                               spans[0].removeChild(script);
224                             } catch(e) {
225                               // do nothing if there is no script
226                             }
227                       }catch(e){}
228                   }
229                 }
230             }
231             <!-- TMPL_UNLESS NAME='hide_marc'-->
232                 var buttonUp = divs[i].getElementsByTagName('img')[0];
233                 buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
234             <!-- /TMPL_UNLESS -->
235             
236         } else { // it's a indicator div
237             if(divs[i].getAttribute('name') == 'div_indicator'){
238                 var inputs = divs[i].getElementsByTagName('input');
239                 inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
240                 inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
241                 
242                 var CloneButtonPlus;
243                 try {
244                     var anchors = divs[i].getElementsByTagName('span');
245                     for (var j = 0; j < anchors.length; j++) {
246                         if (anchors[j].getAttribute('class') == 'buttonPlus') {
247                             anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
248                         } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
249                             anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
250                         }
251                     }
252                 }
253                 catch(e){
254                     // do nothig CloneButtonPlus doesn't exist.
255                 }
256                 
257                 // setting its 'Expand' property
258                 var ExpandFieldA=0;
259                 try {
260                     ExpandFieldA = divs[i].getElementsByTagName('a')[0];
261                     ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')");
262                 }
263                 catch(e){
264                     // do nothig if ButtonPlus & CloneButtonPlus don t exist.
265                 }
266                 
267             }
268         }
269     }
270     
271     // insert this line on the page
272     original.parentNode.insertBefore(clone,original.nextSibling);
273 }
274
275 function CloneSubfield(index){
276     var original = document.getElementById(index); //original <div>
277     fields_in_use[index.substr(0, 12)]++;
278     var clone = original.cloneNode(true);
279     var new_key = CreateKey();
280     var new_id  = original.getAttribute('id')+new_key;
281     
282     // set the attribute for the new 'div' subfields
283     var inputs     = clone.getElementsByTagName('input');
284     var selects    = clone.getElementsByTagName('select');
285     var textareas  = clone.getElementsByTagName('textarea');
286         
287     // input
288     var id_input = "";
289     for(var i=0,len=inputs.length; i<len ; i++ ){
290         id_input = inputs[i].getAttribute('id')+new_key;
291         inputs[i].setAttribute('id',id_input);
292         inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
293     }
294     
295     // select 
296     for(var i=0,len=selects.length; i<len ; i++ ){
297         id_input = selects[i].getAttribute('id')+new_key;
298         selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
299         selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
300     }
301     
302     // textarea
303     for(var i=0,len=textareas.length; i<len ; i++ ){
304         id_input = textareas[i].getAttribute('id')+new_key;
305         textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
306         textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
307     }
308     
309     <!-- TMPL_UNLESS NAME='advancedMARCEditor' -->
310     // when cloning a subfield, reset its label too.
311     var label = clone.getElementsByTagName('label')[0];
312     label.setAttribute('for',id_input);
313     <!-- /TMPL_UNLESS -->
314     
315     // setting a new if for the parent div
316     clone.setAttribute('id',new_id);
317     
318     try {
319       var buttonUp = clone.getElementsByTagName('img')[0];
320       buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
321       var spans = clone.getElementsByTagName('span');
322       if(spans.length){
323           for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
324             if(spans[i].getAttribute('class') == 'buttonPlus'){
325                     spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
326                 } else if (spans[i].getAttribute('class') == 'buttonMinus') {
327                     spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
328                 }
329             }
330         }
331     }
332     catch(e){
333         // do nothig if ButtonPlus & CloneButtonPlus don't exist.
334     }
335     // insert this line on the page
336     original.parentNode.insertBefore(clone,original.nextSibling);
337 }
338
339  /**
340  * This function removes or clears unwanted subfields
341  */
342 function UnCloneField(index) {
343     var original = document.getElementById(index);
344     var field_id;
345     if (index.match("tag")) {
346         field_id = index.substr(0, 7);
347     } else {
348         field_id = index.substr(0, 12);
349     }
350     if (1 == fields_in_use[field_id]) {
351         // clear inputs, but don't delete
352         $(":input.input_marceditor", original).each(function(){
353             // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
354             // hint about clearing selects correctly
355             var type = this.type;
356             var tag = this.tagName.toLowerCase();
357             if (type == 'text' || type == 'password' || tag == 'textarea') {
358                 this.value = "";
359             } else if (type == 'checkbox' || type == 'radio') {
360                 this.checked = false;
361             } else if (tag == 'select') {
362                 this.selectedIndex = -1;
363             }
364         });
365         $(":input.indicator", original).val("");
366     } else {
367         original.parentNode.removeChild(original);
368         fields_in_use[field_id]--;
369     }
370 }
371
372
373 /**
374  * This function create a random number
375  */
376 function CreateKey(){
377     return parseInt(Math.random() * 100000);
378 }
379
380 /**
381  * This function allows to move a subfield up by clickink on the 'up' button .
382  */
383 function upSubfield(index) {
384     try{
385         var line = document.getElementById(index); // get the line where the user has clicked.
386     } catch(e) {
387         return; // this line doesn't exist...
388     }
389     var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
390     
391     // getting all subfields for this tag
392     var subfields = tag.getElementsByTagName('div');
393     var subfieldsLength = subfields.length;
394     
395     if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
396     
397     // among all subfields 
398     for(var i=0;i<subfieldsLength;i++){ 
399         if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
400             if(i==1){ // if the clicked subfield is on the top
401                 tag.appendChild(subfields[1]);
402                 return;
403             } else {
404                 var lineAbove = subfields[i-1];
405                 tag.insertBefore(line,lineAbove);
406                 return;
407             }
408         }
409     }
410 }
411
412 function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
413     subfield = document.getElementById(index);
414     subfield.style.display = 'block';
415     label = document.getElementById(labelindex);
416     label.style.display='none'; 
417 }
418
419 function addauthority() {
420     X = document.forms[0].authtype.value;
421     window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
422 }
423 function searchauthority() {
424     X = document.forms[0].authtype2.value;
425     Y = document.forms[0].value.value;
426     window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
427 }
428 //]]>
429 </script>
430 <link rel="stylesheet" href="<!-- TMPL_VAR NAME="themelang" -->/css/addbiblio.css" />
431 </head>
432 <body>
433 <div id="yui-cms-loading">
434       <div id="yui-cms-float">
435           Loading, please wait...
436       </div>
437   </div>
438 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/yui/plugins/loading-min.js"></script>
439 <script type="text/javascript">
440 //<![CDATA[
441 (function() {
442         // configuring the loading mask
443         YAHOO.widget.Loading.config({
444                 opacity: 0.8
445         });
446 })();
447 //]]>
448 </script>
449 <!-- TMPL_INCLUDE NAME="header.inc" -->
450
451 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> &rsaquo; <!-- TMPL_IF name="authid" -->Modify authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- TMPL_ELSE -->Adding authority <!-- TMPL_VAR name="authtypetext" --><!-- /TMPL_IF -->  </div>
452
453 <div id="doc" class="yui-t7">
454
455 <div id="bd">
456         <div id="yui-main">
457         <div class="yui-g">
458
459 <!-- TMPL_IF name="authid" -->
460 <h1>Modify authority #<!-- TMPL_VAR NAME="authid" --> <!-- TMPL_VAR name="authtypetext" --></h1>
461 <!-- TMPL_ELSE -->
462 <h1>Adding authority <!-- TMPL_VAR name="authtypetext" --></h1>
463 <!-- /TMPL_IF -->  
464 <form method="post" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
465     <input type="hidden" name="op" value="add" />
466     <input type="hidden" name="addfield_field" value="" />
467     <input type="hidden" name="repeat_field" value="" />
468     <input type="hidden" name="authtypecode" value="<!-- TMPL_VAR NAME="authtypecode" -->" />
469     <input type="hidden" name="authid" value="<!-- TMPL_VAR NAME="authid" -->" />
470
471         <div id="toolbar">
472         <script type="text/javascript">
473         //<![CDATA[
474         // prepare DOM for YUI Toolbar
475          $(document).ready(function() {
476             yuiToolbar();
477             $("#addauthc,#action").empty();
478          });
479         // YUI Toolbar Functions
480         function yuiToolbar() {
481         var addauthButton = new YAHOO.widget.Button({
482                                             id: "addauth", 
483                                             type: "button", 
484                                             label: "Save", 
485                                             container: "addauthc",
486                                                                                         onclick: {fn: Check }
487                                         });
488         var addauthButton2 = new YAHOO.widget.Button({
489                                             id: "addauth2", 
490                                             type: "button", 
491                                             label: "Save", 
492                                             container: "action",
493                                                                                         onclick: {fn: Check }
494                                         });
495         } //]]>
496         </script>
497         <ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>
498
499 <!-- TMPL_IF name="duplicateauthid" -->
500         <div class="problem">
501                 <p>Duplicate suspected with <a href="javascript:openWindow('detail.pl?authid=<!-- TMPL_VAR name=duplicateauthid -->&amp;popup=1', 'Duplicate Authority')" class="button"><!-- TMPL_VAR name="duplicateauthvalue" --></a></p>
502                 <p>You must either :</p>
503                 <ul>
504                         <p><input type="checkbox" value="1" name="confirm_not_duplicate" />confirm it's not a duplicate (and click on <input type="button" value="Add authority" onclick="Check(this.form)" accesskey="w" class="button" /> again)</p>
505                         <p>Go to <a href="authorities.pl?authid=<!-- TMPL_VAR name="duplicateauthid" -->" >original authority</a></p>
506                 </ul>
507         </div>
508 <!-- /TMPL_IF -->
509
510 <div id="authoritytabs" class="toptabs numbered">
511        <ul> <!-- TMPL_LOOP name="BIG_LOOP" -->
512             <li><!-- TMPL_IF name="number" -->
513                 <a href="/cgi-bin/authorities/authorties.pl#tab<!-- TMPL_VAR name="number" -->XX"><!-- TMPL_VAR name="number"--></a>
514             <!-- TMPL_ELSE -->
515                 <a href="/cgi-bin/authorities/authorties.pl#tab<!-- TMPL_VAR name="number" -->XX"><!-- TMPL_VAR name="number"--></a>
516             <!-- /TMPL_IF --></li>
517         <!--  /TMPL_LOOP --></ul>
518
519 <!-- TMPL_LOOP name="BIG_LOOP" -->
520     <!-- hide every tab except the 1st -->
521             <!-- TMPL_IF name="number" -->
522                 <div id="tab<!-- TMPL_VAR name="number" -->XX">
523             <!-- TMPL_ELSE -->
524                 <div id="tab<!-- TMPL_VAR name="number" -->XX">
525             <!-- /TMPL_IF -->
526         
527         <!-- TMPL_LOOP NAME="innerloop" -->
528             <!-- TMPL_IF NAME="tag" -->
529                 <div class="tag" id="tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->">
530                 <div class="tag_title" name="div_indicator">
531                 <!-- TMPL_UNLESS name="hide_marc" -->
532                     <span title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></span>
533                     <!-- TMPL_IF NAME="fixedfield" -->
534                     <input tabindex="1"
535                                 class="indicator flat"
536                                 type="text"
537                                 style="display:none;"
538                                 name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator1_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
539                                 size="1"
540                                 maxlength="1"
541                                 value="<!-- TMPL_VAR NAME="indicator1" -->" />
542                     <input tabindex="1"
543                                 class="indicator flat"
544                                 type="text"
545                                 style="display:none;"
546                                 name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator2_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
547                                 size="1"
548                                 maxlength="1"
549                                 value="<!-- TMPL_VAR NAME="indicator2" -->" />
550                     <!-- TMPL_ELSE -->
551                     <input tabindex="1"
552                                 class="indicator flat"
553                                 type="text"
554                                 name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator1_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
555                                 size="1"
556                                 maxlength="1"
557                                 value="<!-- TMPL_VAR NAME="indicator1" -->" />
558                     <input tabindex="1"
559                                 class="indicator flat"
560                                 type="text"
561                                 name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator2_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
562                                 size="1"
563                                 maxlength="1"
564                                 value="<!-- TMPL_VAR NAME="indicator2" -->" />
565                     <!-- /TMPL_IF --> -
566                 <!-- TMPL_ELSE -->
567                     <!-- TMPL_IF NAME="fixedfield" -->
568                         <input tabindex="1"
569                             type="hidden"
570                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator1_<!-- TMPL_VAR NAME='index'-->"
571                             value="<!-- TMPL_VAR NAME="indicator1" --><!-- TMPL_VAR name="random" -->" />
572                         <input tabindex="1"
573                             type="hidden"
574                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator2_<!-- TMPL_VAR NAME='index'-->"
575                             value="<!-- TMPL_VAR NAME="indicator2" --><!-- TMPL_VAR name="random" -->" />
576                     <!-- TMPL_ELSE -->
577                         <input tabindex="1"
578                             type="hidden"
579                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator1_<!-- TMPL_VAR NAME='index'-->"
580                             value="<!-- TMPL_VAR NAME="indicator1" --><!-- TMPL_VAR name="random" -->" />
581                         <input tabindex="1"
582                             type="hidden"
583                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator2_<!-- TMPL_VAR NAME='index'-->"
584                             value="<!-- TMPL_VAR NAME="indicator2" --><!-- TMPL_VAR name="random" -->" />
585                     <!-- /TMPL_IF -->
586                 <!-- /TMPL_UNLESS -->
587     
588                 <!-- TMPL_UNLESS NAME="advancedMARCEditor" -->
589                     <a onclick="ExpandField('tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->')"><!-- TMPL_VAR NAME="tag_lib" --></a>
590                 <!-- /TMPL_UNLESS -->
591                 <!-- TMPL_IF name="repeatable" -->
592                     <span class="buttonPlus" onclick="CloneField('tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->')">+</span>
593                 <!-- /TMPL_IF -->
594                 <!-- TMPL_UNLESS NAME="mandatory" -->
595                     <span class="buttonMinus" onclick="UnCloneField('tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->')">&#8722;</span>
596                 <!-- /TMPL_UNLESS -->
597                 
598             </div>
599     
600             <!-- TMPL_LOOP NAME="subfield_loop" -->
601                 <!--  One line on the marc editor -->
602                 <div name="line" class="subfield_line" style="<!-- TMPL_VAR NAME='visibility' -->;" id="subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->">
603                 
604                     <!--TMPL_UNLESS NAME="advancedMARCEditor" -->
605                     <label for="tag_<!-- TMPL_VAR NAME='tag'-->_subfield_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
606                             <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> class="labelsubfield" >
607                     <!-- /TMPL_UNLESS --> 
608                     
609                     <!-- TMPL_UNLESS name="hide_marc" -->
610                     <!-- TMPL_IF NAME="fixedfield" -->
611                         <img class="buttonUp" style="display:none;" src="<!-- TMPL_VAR NAME="themelang" -->/../img/up.png" onclick="upSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->')" alt="Move Up" title="Move Up" />
612                     <!-- TMPL_ELSE -->
613                         <img class="buttonUp"  src="<!-- TMPL_VAR NAME="themelang" -->/../img/up.png" onclick="upSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->')" alt="Move Up" title="Move Up" />
614                         <!-- /TMPL_IF -->
615                             <input title="<!-- TMPL_VAR NAME='marc_lib_plain' -->"
616                                 style=" <!-- TMPL_IF NAME="fixedfield" -->display:none; <!-- /TMPL_IF -->border:0;" type="text"
617                                 name="tag_<!-- TMPL_VAR NAME='tag'-->_code_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
618                                 value="<!-- TMPL_VAR NAME="subfield" -->"
619                                 size="1"
620                                 maxlength="1"
621                                 class="flat"
622                                 tabindex="-1" />
623                     <!-- TMPL_ELSE -->
624                         <input type="hidden"
625                             name="tag_<!-- TMPL_VAR NAME='tag'-->_code_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
626                             value="<!-- TMPL_VAR NAME="subfield" -->"/>
627                     <!-- /TMPL_UNLESS -->
628                 
629                     <!-- TMPL_UNLESS NAME="advancedMARCEditor" -->
630                         <!-- TMPL_IF name="mandatory" --><span class="subfield_mandatory"><!-- /TMPL_IF -->
631                             <!-- TMPL_VAR NAME="marc_lib" -->
632                         <!-- TMPL_IF name="mandatory" --></span><!-- /TMPL_IF -->
633                         </label>
634                     <!-- /TMPL_UNLESS -->
635                     
636                     <!-- TMPL_VAR NAME="marc_value" -->
637                     
638                     <!-- TMPL_IF NAME="repeatable" -->
639                         <span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->')">+</span>
640                     <!-- /TMPL_IF -->
641                     <!-- TMPL_UNLESS NAME="mandatory" -->
642                         <span class="buttonMinus" onclick="UnCloneField('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">&#8722;</span>
643                     <!-- /TMPL_UNLESS -->
644                     
645                 </div>
646                 <!-- End of the line -->
647                 
648             <!-- /TMPL_LOOP -->
649             </div>
650             <!-- /TMPL_IF --><!-- tag -->
651         <!-- /TMPL_LOOP -->
652         </div>
653 <!-- /TMPL_LOOP -->
654
655 <!-- TMPL_UNLESS Name="singletab" -->
656     </div>      
657 <!--/TMPL_UNLESS-->
658 </div>
659
660 <div name="hidden" id="hidden" class="tab">
661 <!-- TMPL_LOOP NAME="hidden_loop" -->
662     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
663     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
664     <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
665     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
666     <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
667 <!-- /TMPL_LOOP -->
668 </div>
669 <!-- TMPL_IF name="oldauthnumtagfield" -->
670     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthnumtagfield" -->" />
671     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthnumtagsubfield" -->" />
672     <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authid" -->" />
673     <input type="hidden" name="mandatory" value="0" />
674     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
675     <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
676     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthtypetagfield" -->" />
677     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthtypetagsubfield" -->" />
678     <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authtypecode" -->" />
679 <!-- /TMPL_IF -->
680 <div id="action">
681         <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
682 </div>
683 </form>
684 </fieldset>
685 </div>
686 </div>
687
688 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->