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