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