#1444: Porting marcEditor to authorities (tab management)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / authorities.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <Title>Koha -- Authority details</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
5 <script type="text/javascript">
6 //<![CDATA[
7
8 function active(numlayer)
9 {
10     for (i=0; i < 10 ; i++ ) {
11         ong = i+"XX";
12         link = "link"+i;
13         if (numlayer==i) {
14                 document.getElementById(ong).style.visibility="visible";
15         } else {
16                 document.getElementById(ong).style.visibility="hidden";
17         }
18     }
19 }
20 /**
21  * check if mandatory subfields are writed
22  */
23 function AreMandatoriesNotOk(){
24     var mandatories = new Array();
25     var tab = new Array();
26     var label = new Array();
27     var flag=0;
28     <!-- TMPL_LOOP NAME='BIG_LOOP' --> 
29         <!-- TMPL_LOOP NAME='innerloop' -->
30             <!-- TMPL_LOOP NAME='subfield_loop'-->
31                 <!-- TMPL_IF NAME='mandatory'-->
32                     mandatories.push("<!-- TMPL_VAR NAME='id' -->");
33                         tab.push("<!-- TMPL_VAR NAME='number' -->");
34                         label.push("<!-- TMPL_VAR NAME='marc_lib' ESCAPE=JS-->");
35                 <!-- /TMPL_IF -->
36             <!-- /TMPL_LOOP -->
37         <!-- /TMPL_LOOP -->
38     <!-- /TMPL_LOOP -->
39     var StrAlert = _("Can't save this record because the following field aren't filled :\n\n");
40     for(var i=0,len=mandatories.length; i<len ; i++){
41         //alert (  mandatories[i]);
42         if( ! document.getElementById(mandatories[i]).value){
43             flag = 1;
44             document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
45             document.getElementById(mandatories[i]).focus();
46             StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n";
47         }
48     }
49     if(flag){
50       return StrAlert;
51   } else {
52     return flag;
53   }
54 }
55
56 /**
57  * 
58  * 
59  */
60 function Check(){
61     var StrAlert = AreMandatoriesNotOk();
62     if( ! StrAlert ){
63         document.f.submit;
64         return true;
65     } else {
66         alert(StrAlert);
67         return false;
68     }
69 }
70
71
72
73
74 function AddField(field,cntrepeatfield) {
75     document.forms['f'].op.value = "addfield";
76     document.forms['f'].addfield_field.value=field;
77     document.forms['f'].repeat_field.value=cntrepeatfield;
78     document.f.submit();
79 }
80
81 function Dopop(link,i) {
82     defaultvalue = document.getElementById(i).value;
83     window.open(link+"&result="+defaultvalue,"value builder",'width=700,height=550,toolbar=false,scrollbars=yes');
84 }
85
86 function ExpandField(index) {
87     var original = document.getElementById(index); //original <div>
88     var divs = original.getElementsByTagName('div');
89     for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
90         if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
91             if (divs[i].style.display == 'block') {
92                 divs[i].style.display = 'none';
93             } else {
94                 divs[i].style.display = 'block';
95             }
96         }
97     }
98 }
99
100 /**
101  * To clone a field or a subfield by clickink on '+' button
102  */ 
103 function CloneField(index) {
104     var original = document.getElementById(index); //original <div>
105     var clone = original.cloneNode(true);
106     var new_key = CreateKey();
107     var new_id  = original.getAttribute('id')+new_key;
108     
109     clone.setAttribute('id',new_id); // setting a new id for the parent div
110     
111     var divs = clone.getElementsByTagName('div');
112     
113     <!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
114         // setting a new name for the new indicator
115         var indicator = clone.getElementsByTagName('input')[0];
116         indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
117     <!-- /TMPL_UNLESS -->
118         
119     // settings all subfields
120     for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
121         if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
122             
123             // set the attribute for the new 'div' subfields
124             divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
125             
126             var inputs   = divs[i].getElementsByTagName('input');
127             var id_input = "";
128             
129             inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
130             inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
131             var id_input;
132             try {
133               id_input = inputs[1].getAttribute('id')+new_key;
134                 inputs[1].setAttribute('id',id_input);
135                 inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
136             } catch(e) {
137               try{ // it s a select if it is not an input
138                     var selects = divs[i].getElementsByTagName('select');
139                     id_input = selects[0].getAttribute('id')+new_key;
140                     selects[0].setAttribute('id',id_input);
141                     selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
142                 }catch(e2){ // it is a textarea if it s not a select or an input
143                   var textaeras = divs[i].getElementsByTagName('textarea');
144                   id_input = textaeras[0].getAttribute('id')+new_key;
145                   textaeras[0].setAttribute('id',id_input);
146                     textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
147                 }
148             }
149             
150             <!-- TMPL_UNLESS NAME='advancedMARCEditor'-->
151             // when cloning a subfield, re set its label too.
152             var labels = divs[i].getElementsByTagName('label');
153             labels[0].setAttribute('for',id_input);
154             <!-- /TMPL_UNLESS -->
155             
156             <!-- TMPL_UNLESS NAME='hide_marc'-->
157                 // updating javascript parameters on button up
158                 var imgs = divs[i].getElementsByTagName('img');
159                 imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
160             <!-- /TMPL_UNLESS -->
161             
162             // setting its '+' button
163             var CloneButtonPlus=0;
164             try {
165                 CloneButtonPlus = divs[i].getElementsByTagName('span')[0];
166                 if(CloneButtonPlus.getAttribute('class') == 'buttonPlus'){
167                     CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
168                 } else {
169                     CloneButtonPlus = 0;
170                 }
171             }
172             catch(e){
173                 // do nothig if ButtonPlus & CloneButtonPlus don t exist.
174             }
175             
176             // button ...
177             var spans=0;
178             try {
179                 spans = divs[i].getElementsByTagName('span');
180             } catch(e) {
181                 // no spans
182             }
183             if(spans){
184                 var buttonDot;
185                 if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
186                     buttonDot = spans[0];
187                     if(buttonDot){
188                         // 2 possibilities :
189                         try{
190                             var buttonDotOnClick = buttonDot.getAttribute('onclick');
191                             if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
192                                 var re = /\('.*'\)/i;
193                                 buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
194                                 if(buttonDotOnClick){
195                                     buttonDot.setAttribute('onclick',buttonDotOnClick);
196                                 }
197                             } else {
198                                 if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
199                                     
200                                     var re1 = /&index=.*',/;
201                                     var re2 = /,.*\)/;
202
203                                     buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
204                                     buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
205                                     
206                                     if(buttonDotOnClick){
207                                             buttonDot.setAttribute('onclick',buttonDotOnClick);
208                                     }
209                                 }
210                             }
211                             try {
212                               // do not copy the script section.
213                               var script = spans[0].getElementsByTagName('script')[0];
214                               spans[0].removeChild(script);
215                             } catch(e) {
216                               // do nothing if there is no script
217                             }
218                       }catch(e){}
219                   }
220                 }
221             }
222             <!-- TMPL_UNLESS NAME='hide_marc'-->
223                 var buttonUp = divs[i].getElementsByTagName('img')[0];
224                 buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
225             <!-- /TMPL_UNLESS -->
226             
227         } else { // it's a indicator div
228             if(divs[i].getAttribute('name') == 'div_indicator'){
229                 var inputs = divs[i].getElementsByTagName('input');
230                 inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
231                 
232                 var CloneButtonPlus;
233                 try {
234                     CloneButtonPlus = divs[i].getElementsByTagName('span')[1]; // 0 is the title
235                     CloneButtonPlus.setAttribute('onclick',"CloneField('" + divs[i].parentNode.getAttribute('id') + "')");
236                 }
237                 catch(e){
238                     // do nothig CloneButtonPlus doesn't exist.
239                 }
240                 
241                 // setting its 'Expand' property
242                 var ExpandFieldA=0;
243                 try {
244                     ExpandFieldA = divs[i].getElementsByTagName('a')[0];
245                     ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')");
246                 }
247                 catch(e){
248                     // do nothig if ButtonPlus & CloneButtonPlus don t exist.
249                 }
250                 
251             }
252         }
253     }
254     
255     // insert this line on the page
256     original.parentNode.insertBefore(clone,original.nextSibling);
257 }
258
259 function CloneSubfield(index){
260     var original = document.getElementById(index); //original <div>
261     var clone = original.cloneNode(true);
262     var new_key = CreateKey();
263     var new_id  = original.getAttribute('id')+new_key;
264     
265     // set the attribute for the new 'div' subfields
266     var inputs     = clone.getElementsByTagName('input');
267     var selects    = clone.getElementsByTagName('select');
268     var textareas  = clone.getElementsByTagName('textarea');
269         
270     // input
271     var id_input = "";
272     for(var i=0,len=inputs.length; i<len ; i++ ){
273         id_input = inputs[i].getAttribute('id')+new_key;
274         inputs[i].setAttribute('id',id_input);
275         inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
276     }
277     
278     // select 
279     for(var i=0,len=selects.length; i<len ; i++ ){
280         id_input = selects[i].getAttribute('id')+new_key;
281         selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
282         selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
283     }
284     
285     // textarea
286     for(var i=0,len=textareas.length; i<len ; i++ ){
287         id_input = textareas[i].getAttribute('id')+new_key;
288         textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
289         textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
290     }
291     
292     <!-- TMPL_UNLESS NAME='advancedMARCEditor' -->
293     // when cloning a subfield, reset its label too.
294     var label = clone.getElementsByTagName('label')[0];
295     label.setAttribute('for',id_input);
296     <!-- /TMPL_UNLESS -->
297     
298     // setting a new if for the parent div
299     clone.setAttribute('id',new_id);
300     
301     var CloneButtonPlus;
302     try {
303       var spans = clone.getElementsByTagName('span');
304       if(spans.length){
305           for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
306             if(spans[i].getAttribute('class') == 'buttonPlus'){
307                     CloneButtonPlus = spans[i];
308                     CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
309                     var buttonUp = clone.getElementsByTagName('img')[0];
310                     buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
311                 }
312             }
313         }
314     }
315     catch(e){
316         // do nothig if ButtonPlus & CloneButtonPlus don't exist.
317     }
318     // insert this line on the page
319     original.parentNode.insertBefore(clone,original.nextSibling);
320 }
321
322 /**
323  * This function create a random number
324  */
325 function CreateKey(){
326     return parseInt(Math.random() * 100000);
327 }
328
329 /**
330  * This function allows to move a subfield up by clickink on the 'up' button .
331  */
332 function upSubfield(index) {
333     try{
334         var line = document.getElementById(index); // get the line where the user has clicked.
335     } catch(e) {
336         return; // this line doesn't exist...
337     }
338     var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
339     
340     // getting all subfields for this tag
341     var subfields = tag.getElementsByTagName('div');
342     var subfieldsLength = subfields.length;
343     
344     if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
345     
346     // among all subfields 
347     for(var i=0;i<subfieldsLength;i++){ 
348         if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
349             if(i==1){ // if the clicked subfield is on the top
350                 tag.appendChild(subfields[1]);
351                 return;
352             } else {
353                 var lineAbove = subfields[i-1];
354                 tag.insertBefore(line,lineAbove);
355                 return;
356             }
357         }
358     }
359 }
360
361 function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
362     subfield = document.getElementById(index);
363     subfield.style.display = 'block';
364     label = document.getElementById(labelindex);
365     label.style.display='none'; 
366 }
367
368 function addauthority() {
369     X = document.forms[0].authtype.value;
370     window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
371 }
372 function searchauthority() {
373     X = document.forms[0].authtype2.value;
374     Y = document.forms[0].value.value;
375     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";
376 }
377 //]]>
378 </script>
379 </head>
380 <body>
381 <!-- TMPL_INCLUDE NAME="header.inc" -->
382
383 <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>
384
385 <div id="doc" class="yui-t7">
386
387 <div id="bd">
388         <div id="yui-main">
389         <div class="yui-g">
390
391 <!-- TMPL_IF name="authid" -->
392 <h1>Modify authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</h1>
393 <!-- TMPL_ELSE -->
394 <h1>Adding authority (<!-- TMPL_VAR name="authtypetext" -->)</h1>
395 <!-- /TMPL_IF -->  
396 <form method="post" name="f">
397     <input type="hidden" name="op" value="add" />
398     <input type="hidden" name="addfield_field" value="" />
399     <input type="hidden" name="repeat_field" value="" />
400     <input type="hidden" name="authtypecode" value="<!-- TMPL_VAR NAME="authtypecode" -->" />
401     <input type="hidden" name="authid" value="<!-- TMPL_VAR NAME="authid" -->" />
402
403     <div id="action">
404 <!-- TMPL_IF name="authid" -->
405     <input type="button" value="Save" onclick="Check(this.form)" accesskey="w" />
406 <!-- TMPL_ELSE -->
407     <input type="button" value="Add authority" onclick="Check(this.form)" accesskey="w" />
408 <!-- /TMPL_IF -->
409     </div>
410
411 <!-- TMPL_IF name="duplicateauthid" -->
412         <div class="problem">
413                 <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>
414                 <p>You must either :</p>
415                 <ul>
416                         <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>
417                         <p>Go to <a href="authorities.pl?authid=<!-- TMPL_VAR name="duplicateauthid" -->" >original authority</a></p>
418                 </ul>
419         </div>
420 <!-- /TMPL_IF -->
421
422 <!--TMPL_UNLESS Name="singletab"-->
423 <div id="tabs">
424         <!-- TMPL_LOOP name="BIG_LOOP" -->
425             <!-- TMPL_IF name="number" -->
426                 <a href="JavaScript:active(<!-- TMPL_VAR name="number"-->)" class="tab_inactive" id="link<!-- TMPL_VAR name="number"-->"><!-- TMPL_VAR name="number"--></a>
427             <!-- TMPL_ELSE -->
428                 <a href="JavaScript:active(<!-- TMPL_VAR name="number"-->)" class="tab_active" id="link<!-- TMPL_VAR name="number"-->"><!-- TMPL_VAR name="number"--></a>
429             <!-- /TMPL_IF -->
430         <!--  /TMPL_LOOP -->
431 </div>
432 <!--/TMPL_UNLESS-->
433
434 <!-- TMPL_LOOP name="BIG_LOOP" -->
435 <!-- hide every tab except the 1st -->
436 <!--TMPL_UNLESS Name="singletab"-->
437     <!-- TMPL_IF name="number" -->
438         <div id="<!-- TMPL_VAR name="number" -->XX" class="content_hidden">
439     <!-- TMPL_ELSE -->
440         <div id="0XX" class="content_visible">
441     <!-- /TMPL_IF -->
442 <!-- /TMPL_UNLESS -->
443     
444     <!-- TMPL_LOOP NAME="innerloop" -->
445         <!-- TMPL_IF NAME="tag" -->
446 <div class="tag" id="tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->">
447         <div class="tag_title" name="div_indicator">
448             <!-- TMPL_UNLESS name="hide_marc" -->
449                 <span title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></span>
450                 <!-- TMPL_IF NAME="fixedfield" -->
451                 <input tabindex="1"
452                             class="indicator"
453                             type="text"
454                             style="display:none;"
455                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
456                             size="2"
457                             maxlength="2"
458                             value="<!-- TMPL_VAR NAME="indicator" -->"
459                             class="flat" />
460                 <!-- TMPL_ELSE -->
461                 <input tabindex="1"
462                             class="indicator"
463                             type="text"
464                             name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->"
465                             size="2"
466                             maxlength="2"
467                             value="<!-- TMPL_VAR NAME="indicator" -->"
468                             class="flat" />
469                 <!-- /TMPL_IF --> -
470             <!-- TMPL_ELSE -->
471                 <!-- TMPL_IF NAME="fixedfield" -->
472                     <input tabindex="1"
473                         type="hidden"
474                         name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator_<!-- TMPL_VAR NAME='index'-->"
475                         value="<!-- TMPL_VAR NAME="indicator" --><!-- TMPL_VAR name="random" -->" />
476                 <!-- TMPL_ELSE -->
477                     <input tabindex="1"
478                         type="hidden"
479                         name="tag_<!-- TMPL_VAR NAME="tag" -->_indicator_<!-- TMPL_VAR NAME='index'-->"
480                         value="<!-- TMPL_VAR NAME="indicator" --><!-- TMPL_VAR name="random" -->" />
481                 <!-- /TMPL_IF -->
482             <!-- /TMPL_UNLESS -->
483
484             <!-- TMPL_UNLESS NAME="advancedMARCEditor" -->
485             <a onClick="ExpandField('tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->')"><!-- TMPL_VAR NAME="tag_lib" --></a>
486             <!-- /TMPL_UNLESS -->
487             <!-- TMPL_IF name="repeatable" -->
488                 <span class="buttonPlus" onclick="CloneField('tag_<!-- TMPL_VAR name="tag"-->_<!-- TMPL_VAR NAME='index'--><!-- TMPL_VAR name="random" -->')">+</span>
489             <!-- /TMPL_IF -->
490             
491         </div>
492
493         <!-- TMPL_LOOP NAME="subfield_loop" -->
494             <!--  One line on the marc editor -->
495             <div name="line" class="subfield_line" style="<!-- TMPL_VAR NAME='visibility' -->;" id="subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->">
496             
497                 <!--TMPL_UNLESS NAME="advancedMARCEditor" -->
498                 <label for="tag_<!-- TMPL_VAR NAME='tag'-->_subfield_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
499                         <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> class="labelsubfield" >
500                 <!-- /TMPL_UNLESS --> 
501                 
502                 <!-- TMPL_UNLESS name="hide_marc" -->
503                     <img class="buttonUp" <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> src="<!-- TMPL_VAR NAME="themelang" -->/../img/up.png" onclick="upSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->')"/>
504                         <input title="<!-- TMPL_VAR NAME='marc_lib_plain' -->"
505                             style=" <!-- TMPL_IF NAME="fixedfield" -->display:none; <!-- /TMPL_IF -->border:0;" type="text"
506                             name="tag_<!-- TMPL_VAR NAME='tag'-->_code_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
507                             value="<!-- TMPL_VAR NAME="subfield" -->"
508                             size="1"
509                             maxlength="1"
510                             class="flat"
511                             tabindex=-1 />
512                 <!-- TMPL_ELSE -->
513                     <input type="hidden"
514                         name="tag_<!-- TMPL_VAR NAME='tag'-->_code_<!--  TMPL_VAR NAME='subfield'-->_<!-- TMPL_VAR NAME='index'-->_<!-- TMPL_VAR NAME='index_subfield'-->"
515                         value="<!-- TMPL_VAR NAME="subfield" -->"/>
516                 <!-- /TMPL_UNLESS -->
517             
518                 <!-- TMPL_UNLESS NAME="advancedMARCEditor" -->
519                     <!-- TMPL_IF name="mandatory" --><span class="subfield_mandatory"><!-- /TMPL_IF -->
520                         <!-- TMPL_VAR NAME="marc_lib" -->
521                     <!-- TMPL_IF name="mandatory" --></span><!-- /TMPL_IF -->
522                     </label>
523                 <!-- /TMPL_UNLESS -->
524                 
525                 <!-- TMPL_VAR NAME="marc_value" -->
526                 
527                 <!-- TMPL_IF NAME="repeatable" -->
528                     <span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='subfield' -->')">+</span>
529                 <!-- /TMPL_IF -->
530                 
531             </div>
532             <!-- End of the line -->
533             
534         <!-- /TMPL_LOOP -->
535         </div>
536         <!-- /TMPL_IF --><!-- tag -->
537     <!-- /TMPL_LOOP -->
538     </div>
539 <!-- /TMPL_LOOP -->
540 <!--TMPL_UNLESS Name="singletab"-->
541 </div>  
542 <!--/TMPL_UNLESS-->
543
544 <div name="hidden" id="hidden" class="tab">
545 <!-- TMPL_LOOP NAME="hidden_loop" -->
546     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->">
547     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->">
548     <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->">
549     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->">
550     <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->">
551 <!-- /TMPL_LOOP -->
552 </div>
553 <!-- TMPL_IF name="oldauthnumtagfield" -->
554     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthnumtagfield" -->">
555     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthnumtagsubfield" -->">
556     <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authid" -->">
557     <input type="hidden" name="mandatory" value="0">
558     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->">
559     <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->">
560     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthtypetagfield" -->">
561     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthtypetagsubfield" -->">
562     <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authtypecode" -->">
563 <!-- /TMPL_IF -->
564 <div id="action">
565     <!-- TMPL_IF name="authid" -->
566         <input type="button" value="Save" onClick="Check(this.form)" accesskey="w">
567     <!-- TMPL_ELSE -->
568         <input type="button" value="Add authority" onClick="Check(this.form)" accesskey="w">
569     <!-- /TMPL_IF -->
570 </div>
571 </form>
572 </fieldset>
573 </div>
574 </div>
575
576 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->