Bug 34436: (QA follow-up) Move spans to surround full text
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / authorities.tt
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %] &rsaquo; Authorities &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.js("lib/hc-sticky.js") | $raw %]
8 <script>
9     [% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
10         var auth_values_creation = 1;
11     [% ELSE %]
12         var auth_values_creation = 0;
13     [% END %]
14 </script>
15 [% INCLUDE 'select2.inc' %]
16 [% Asset.js("js/cataloging.js") | $raw %]
17
18 <script>
19     $(window).load(function(){
20         $("#loading").hide();
21     });
22     var Sticky;
23     $(document).ready(function() {
24
25         $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
26             $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
27         });
28
29         /* On page load, check for location.hash in the page URL */
30         /* If present the location hash will be used to activate the correct tab */
31         var hash = location.hash;
32         var hashPieces = hash.split('?');
33         if( hashPieces[0] !== "" ){
34             selectTab( hashPieces[0] );
35             window.scrollTo( 0, 0 );
36         } else {
37             selectTab( "#tab0XX_panel" );
38         }
39
40         $( "ul.sortable_field", "#authoritytabs" ).sortable();
41         $( "ul.sortable_subfield", "#authoritytabs" ).sortable();
42
43         Sticky = $("#toolbar");
44         Sticky.hcSticky({
45             stickTo: ".main",
46             stickyClass: "floating"
47         });
48         $("#addauth").click(function(){
49             if(Check()){
50                 $("#f").submit();
51             }
52         });
53         $("#z3950submit").click(function(){
54             var strQuery = GetZ3950Terms();
55             var index = "&index=[% index | html %]";
56             if(strQuery){
57                 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid | html %]"+strQuery+index,"z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
58             }
59             return false;
60         });
61
62         $(".toolbar-tabs-container .nav-tabs a").on("click",function(e){
63             e.preventDefault();
64             selectTab( this.hash );
65         });
66
67         $(".tag_anchor").on("click", function(e){
68             e.preventDefault();
69             $(".tag_anchor").removeClass("selected");
70             $(this).addClass("selected");
71             var link = this.href;
72             var linkid = link.substring( link.indexOf("#") + 1 );
73             window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
74         });
75
76         $("body").on("click", ".linkfield", function(e){
77             e.preventDefault();
78             var tab = $(this).data("tab");
79             var field = $(this).data("field");
80             var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
81             selectTab( tablink );
82             window.scrollTo( 0, getScrollto( field, "toolbar" ) );
83         });
84     });
85
86     function selectTab( tablink ){
87         let a = $("a[href='" + tablink + "']");
88         $(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
89         a.tab("show").parent().addClass("selected");
90         /* Get number from string like "tab9XX" */
91         var tabid = a.data("tabname").substring(3, 4);
92         $(".tag_anchors").removeClass("tab_selected").hide();
93         $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
94     }
95
96     /**
97     * Returns a roughly ideal position to scroll an element into view
98     * @param {string} target - The HTML id of the element to scroll into view
99     * @param {string} elemid - The HTML id of the element which might obscure
100     *                          the view of the target element e.g. a floating toolbar
101     * @return {number} - The y-coordinate to pass to window.scrollTo()
102     */
103     function getScrollto( target, elemid ){
104         var dest = $("#" + target );
105         var yoffset = dest.offset();
106
107         if( elemid != "" ){
108             var element = $("#" + elemid );
109             var elem_height = element.outerHeight();
110         } else {
111             elem_height = 0;
112         }
113         return yoffset.top - elem_height - 20;
114     }
115
116
117     /**
118     * check if z3950 mandatories are set or not
119     */
120     function GetZ3950Terms(){
121         var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
122         var mandatories = new Array();
123         var mandatories_label = new Array();
124         [% FOREACH BIG_LOO IN BIG_LOOP %][% FOREACH innerloo IN BIG_LOO.innerloop %][% FOREACH subfield_loo IN innerloo.subfield_loop %][% IF ( subfield_loo.z3950_mandatory ) %]mandatories.push("[% subfield_loo.id | html %]");
125             mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %]
126
127         for(var i=0,len=mandatories.length; i<len ; i++){
128             var field_value = document.getElementById(mandatories[i]).value;
129             if( field_value ){
130                 strQuery += "&"+mandatories_label[i]+"="+encodeURIComponent(field_value);
131             }
132         }
133         return strQuery;
134     }
135
136     /**
137     * check if mandatory subfields are written
138     */
139     function AreMandatoriesNotOk(){
140         var mandatories = new Array();
141         var mandatoriesfields = new Array();
142         var   tab = new Array();
143         var label = new Array();
144         [% FOREACH BIG_LOO IN BIG_LOOP %]
145             [% FOREACH innerloo IN BIG_LOO.innerloop %]
146                 [% IF ( innerloo.mandatory ) %]
147                     mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]"));
148                 [% END %]
149                 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
150                     [% IF ( subfield_loo.mandatory ) %]mandatories.push("[% subfield_loo.id | html %]");
151                         tab.push("[% BIG_LOO.number | html %]");
152                         label.push("[% To.json(subfield_loo.marc_lib) | html %]");
153                     [% END %]
154                 [% END %]
155             [% END %]
156         [% END %]
157         var StrAlert = "";
158         for(var i=0,len=mandatories.length; i<len ; i++){
159             var id_string = mandatories[i];
160             // alert (id_string);
161             if( ! $("#" + id_string).val() ){
162                 var elt = document.getElementById(id_string);
163                 if ( elt.nodeName == 'SELECT' ) {
164                     $(elt).siblings('.select2').find("span[role='combobox']").addClass('subfield_not_filled');
165                 } else {
166                     $(elt).addClass('subfield_not_filled');
167                 }
168
169                 $(elt).focus();
170                 StrAlert += "\t* " + _("%s in tab %s").format(label[i], tab[i]) + "\n";
171             }
172         }
173
174         /* Check for mandatories field(not subfields) */
175         for(var i=0,len=mandatoriesfields.length; i<len; i++){
176             isempty  = true;
177             arr      = mandatoriesfields[i];
178             divid    = "tag_" + arr[0] + "_" + arr[1];
179             varegexp = new RegExp("^tag_" + arr[0] + "_code_");
180
181             if(parseInt(arr[0]) >= 10){
182                 elem = document.getElementById(divid);
183                 eleminputs = elem.getElementsByTagName('input');
184
185                 for(var j=0,len2=eleminputs.length; j<len2; j++){
186
187                     if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
188                         inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
189
190                         for( var k=0; k<len2; k++){
191                             if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
192                                 isempty = false
193                             }
194                         }
195                     }
196                 }
197             }else{
198                 isempty = false;
199             }
200
201             if(isempty){
202                 flag = 1;
203                     StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
204             }
205
206         }
207
208
209         if(StrAlert){
210             return _("Can't save this record because the following field aren't filled :") + "\n\n" + StrAlert;
211         }
212         return false;
213     }
214
215     function Check(){
216         var StrAlert = AreMandatoriesNotOk();
217         if( ! StrAlert ){
218             document.f.submit();
219             return true;
220         } else {
221             alert(StrAlert);
222             return false;
223         }
224     }
225
226     function AddField(field,cntrepeatfield) {
227         document.forms['f'].op.value = "addfield";
228         document.forms['f'].addfield_field.value=field;
229         document.forms['f'].repeat_field.value=cntrepeatfield;
230         document.f.submit();
231     }
232
233     function addauthority() {
234         X = document.forms[0].authtype.value;
235         window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
236     }
237     function searchauthority() {
238         X = document.forms[0].authtype2.value;
239         Y = document.forms[0].value.value;
240         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";
241     }
242     function confirmnotdup(redirect){
243         $("#confirm_not_duplicate").attr("value","1");
244         Check();
245     }
246 </script>
247 [% Asset.css("css/addbiblio.css") | $raw %]
248
249 </head>
250 <body id="auth_authorities" class="auth">
251
252     <div id="loading">
253         <div>Loading, please wait...</div>
254     </div>
255
256     [% INCLUDE 'header.inc' %]
257
258 [% WRAPPER 'sub-header.inc' %]
259     [% WRAPPER breadcrumbs %]
260         [% WRAPPER breadcrumb_item %]
261             <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
262         [% END %]
263
264         [% IF ( authid ) %]
265             [% WRAPPER breadcrumb_item bc_active= 1 %]
266                 <span>Modify authority #[% authid | html %] ([% authtypetext | html %])</span>
267             [% END %]
268
269         [% ELSE %]
270             [% WRAPPER breadcrumb_item bc_active= 1 %]
271                 <span>Adding authority [% authtypetext | html %]</span>
272             [% END %]
273
274         [% END %]
275     [% END #/ WRAPPER breadcrumbs %]
276 [% END #/ WRAPPER sub-header.inc %]
277
278     <div class="main container-fluid">
279         <div class="row">
280             <div class="col-md-10 col-md-offset-1">
281
282                 [% IF ( authid ) %]
283                     <h1>Modify authority #[% authid | html %] [% authtypetext | html %]</h1>
284                 [% ELSE %]
285                     <h1>Adding authority [% authtypetext | html %]</h1>
286                 [% END %]
287
288                 [% IF ( duplicateauthid ) %]
289                     <div class="dialog alert">
290                         <h3>Duplicate record suspected</h3>
291                         <p>Is this a duplicate of <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% duplicateauthid | uri %]" class="popup" onclick="openWindow('/cgi-bin/koha/authorities/detail.pl?authid=[% duplicateauthid | html %]&amp;popup=1', 'DuplicateAuthority','800','600'); return false;" class="button">[% duplicateauthvalue | html %]</a> ?</p>
292
293                         <form action="authorities.pl" method="get">
294                             <input type="hidden" name="authid" value="[% duplicateauthid | html %]" />
295                             <button type="submit" class="new"><i class="fa fa-pencil"></i> Yes: Edit existing authority</button>
296                         </form>
297                         <form action="authorities.pl" method="get">
298                             <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
299                         </form>
300                     </div>
301                 [% END # /IF duplicateauthid %]
302
303                 <form method="post" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
304                     <input type="hidden" name="op" value="add" />
305                     <input type="hidden" name="addfield_field" value="" />
306                     <input type="hidden" name="repeat_field" value="" />
307                     <input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />
308                     <input type="hidden" name="authid" value="[% authid | html %]" />
309                     <input type="hidden" name="index" value="[% index | html %]" />
310                     <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
311
312                     <div id="toolbar" class="btn-toolbar">
313                         <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
314                         <div class="btn-group">
315                             [% IF ( authid ) %]
316                                 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a>
317                             [% ELSE %]
318                                 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
319                             [% END %]
320                         </div>
321                         <div class="btn-group">
322                             [% IF ( authid ) %]
323                                 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
324                             [% ELSE %]
325                                 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
326                             [% END %]
327                         </div>
328                         <div class="toolbar-tabs-container">
329                             [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
330                                 [% WRAPPER tabs_nav %]
331                                     [%- FOREACH BIG_LOO IN BIG_LOOP -%]
332                                         [% IF loop.first %]
333                                             [% SET bt_active = 1 %]
334                                         [% ELSE %]
335                                             [% SET bt_active = 0 %]
336                                         [% END %]
337                                         [% WRAPPER tab_item tabname= "tab${BIG_LOO.number}XX" bt_active= bt_active %]
338                                             <span>[% BIG_LOO.number | html %]</span>
339                                         [% END %]
340                                     [%- END -%]
341                                 [% END # /WRAPPER tabs_nav %]
342                             [% END %]
343                             <ul class="tag_anchors_list">
344                                 [% FOREACH BIG_LOO IN BIG_LOOP %]
345                                     [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
346                                     [% FOREACH innerloo IN BIG_LOO.innerloop %]
347                                         [% IF ( innerloo.tag ) %]
348                                             <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
349                                                 <a class="tag_anchor" id="tag_anchor_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]" title="tag_anchor_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]" href="#div_indicator_tag_[% innerloo.tag | uri %]_[% innerloo.index | uri %][% innerloo.random | uri %]">[% innerloo.tag | uri %]</a>
350                                             </li>
351                                         [% END %]
352                                     [% END %]
353                                 [% END %]
354                             </ul>
355                         </div>
356                     </div> <!-- /#toolbar -->
357                     <div id="action">
358                         [% IF count %]
359                                 Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an:[% authid | uri %]">[% count | html %] record(s)</a>
360                         [% ELSE %]
361                                 This authority is not used in any records.
362                         [% END %]
363                     </div>
364
365                     [% WRAPPER tabs id= "authoritytabs" %]
366                         [% WRAPPER tab_panels %]
367                             [% FOREACH BIG_LOO IN BIG_LOOP %]
368                                 [% IF loop.first %]
369                                     [% SET bt_active = 1 %]
370                                 [% ELSE %]
371                                     [% SET bt_active = 0 %]
372                                 [% END %]
373                                 [% WRAPPER tab_panel tabname="tab${BIG_LOO.number}XX" bt_active= bt_active %]
374                                     [% IF ( BIG_LOOP.size > 1 ) %]
375                                         <h2>Section [% BIG_LOO.number | html %]</h2>
376                                     [% END %]
377                                     [% previous = "" %]
378                                     [% FOREACH innerloo IN BIG_LOO.innerloop %]
379                                         [% IF ( innerloo.tag ) %]
380                                             [% IF innerloo.tag != previous %]
381                                                 [% IF previous != "" %]
382                                                     </ul>
383                                                 [% END %]
384                                                 [% previous = innerloo.tag %]
385                                                 [% IF ( innerloo.repeatable ) %]
386                                                     <ul class="sortable_field">
387                                                 [% ELSE %]
388                                                     <ul>
389                                                 [% END %]
390                                             [% END %]
391
392                                             [% IF ( innerloo.repeatable ) %]
393                                                 <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
394                                             [% ELSE %]
395                                                 <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
396                                             [% END %]
397
398                                                 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
399                                                     [% UNLESS hide_marc %]
400                                                         [% IF advancedMARCEditor %]
401                                                             <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to expand this tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a>
402                                                         [% ELSE %]
403                                                             <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
404                                                         [% END %]
405                                                         [% IF ( innerloo.fixedfield ) %]
406                                                             <input type="text"
407                                                                 tabindex="1"
408                                                                 class="indicator flat"
409                                                                 style="display:none;"
410                                                                 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
411                                                                 size="1"
412                                                                 maxlength="1"
413                                                                 value="[% innerloo.indicator1 | html %]" />
414                                                             <input type="text"
415                                                                 tabindex="1"
416                                                                 class="indicator flat"
417                                                                 style="display:none;"
418                                                                 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
419                                                                 size="1"
420                                                                 maxlength="1"
421                                                                 value="[% innerloo.indicator2 | html %]" />
422                                                         [% ELSE %]
423                                                             <input type="text"
424                                                                 tabindex="1"
425                                                                 class="indicator flat"
426                                                                 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
427                                                                 size="1"
428                                                                 maxlength="1"
429                                                                 value="[% innerloo.indicator1 | html %]" />
430                                                             <input type="text"
431                                                                 tabindex="1"
432                                                                 class="indicator flat"
433                                                                 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
434                                                                 size="1"
435                                                                 maxlength="1"
436                                                                 value="[% innerloo.indicator2 | html %]" />
437                                                         [% END # /IF ( innerloo.fixedfield ) %] -
438                                                     [% ELSE %]
439                                                         [% IF ( innerloo.fixedfield ) %]
440                                                             <input type="hidden"
441                                                                 tabindex="1"
442                                                                 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
443                                                                 value="[% innerloo.indicator1 | html %]" />
444                                                             <input type="hidden"
445                                                                 tabindex="1"
446                                                                 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
447                                                                 value="[% innerloo.indicator2 | html %]" />
448                                                         [% ELSE %]
449                                                             <input type="hidden"
450                                                                 tabindex="1"
451                                                                 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
452                                                                 value="[% innerloo.indicator1 | html %]" />
453                                                             <input type="hidden"
454                                                                 tabindex="1"
455                                                                 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
456                                                                 value="[% innerloo.indicator2 | html %]" />
457                                                         [% END # /IF ( innerloo.fixedfield ) %]
458                                                     [% END # /UNLESS hide_marc %]
459
460                                                     [% UNLESS advancedMARCEditor %]
461                                                         <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to expand this tag">[% innerloo.tag_lib | html %]</a>
462                                                     [% END %]
463                                                     <span class="field_controls">
464                                                         [% IF ( innerloo.repeatable ) %]
465                                                             <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','[% hide_marc | html %]','[% advancedMARCEditor | html %]'); return false;" title="Repeat this tag">
466                                                                 <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this tag" />
467                                                             </a>
468                                                         [% END %]
469                                                         <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this tag">
470                                                             <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this tag" />
471                                                         </a>
472                                                     </span> <!-- /.field_controls -->
473                                                 </div> <!-- /div.tag_title -->
474
475                                                 <ul class="sortable_subfield">
476                                                     [% FOREACH subfield_loo IN innerloo.subfield_loop %]
477                                                         <!--  One line on the marc editor -->
478                                                         <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
479
480                                                             [% UNLESS hide_marc %]
481                                                                 <div class="subfieldcode">
482                                                                     <input type="text"
483                                                                         title="[% subfield_loo.marc_lib | $raw %]"
484                                                                         style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
485                                                                         name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
486                                                                         value="[% subfield_loo.subfield | html %]"
487                                                                         size="1"
488                                                                         maxlength="1"
489                                                                         class="flat"
490                                                                         tabindex="0" />
491                                                                 </div>
492                                                             [% ELSE %]
493                                                                 <input type="hidden"
494                                                                     name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
495                                                                     value="[% subfield_loo.subfield | html %]" />
496                                                             [% END # /UNLESS hide_marc %]
497
498                                                             [% UNLESS advancedMARCEditor %]
499                                                                 [% IF ( subfield_loo.mandatory ) %]
500                                                                     <div class="subfield subfield_mandatory">
501                                                                 [% ELSE %]
502                                                                     <div class="subfield">
503                                                                 [% END %]
504                                                                     [% IF ( subfield_loo.fixedfield ) %]
505                                                                         <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield">
506                                                                     [% ELSE %]
507                                                                         <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
508                                                                     [% END %]
509                                                                         [% subfield_loo.marc_lib | $raw %]
510                                                                     </label>
511                                                                 </div> <!-- /.subfield -->
512                                                             [% END # UNLESS advancedMARCEditor %]
513
514                                                             [% SET mv = subfield_loo.marc_value %]
515                                                             <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
516                                                                 [% IF ( mv.type == 'select' ) %]
517                                                                     [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
518                                                                         <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
519                                                                     [% ELSE %]
520                                                                         <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
521                                                                     [% END %]
522                                                                         [% FOREACH aval IN mv.values %]
523                                                                             [% IF aval == mv.default %]
524                                                                                 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
525                                                                             [% ELSE %]
526                                                                                 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
527                                                                             [% END %]
528                                                                         [% END %]
529                                                                     </select>
530                                                                 [% ELSIF ( mv.type == 'text1' ) %]
531                                                                     <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" />
532                                                                 [% ELSIF ( mv.type == 'text2' ) %]
533                                                                     <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" />
534                                                                 [% ELSIF ( mv.type == 'text' ) %]
535                                                                     <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength | html -%]" />
536                                                                 [% ELSIF ( mv.type == 'textarea' ) %]
537                                                                     <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength | html -%]">[%- mv.value | html -%]</textarea>
538                                                                 [% ELSIF ( mv.type == 'hidden' ) %]
539                                                                     <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
540                                                                 [% ELSIF ( mv.type == 'hidden_simple' ) %]
541                                                                     <input type="hidden" name="[%- mv.name | html -%]" />
542                                                                 [% END # /IF mv.type %]
543                                                             </div> <!-- /.field_marceditor -->
544
545                                                             [% IF ( subfield_loo.mandatory ) %]
546                                                                 <div class="subfield_loop_mandatory">
547                                                                     <span class="required">Required</span>
548                                                                 </div>
549                                                             [% END %]
550
551                                                             <div class="subfield_controls">
552                                                                 [% IF ( mv.type == 'text1' ) %]
553                                                                     <a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtypecode | html -%]','auth'); return false;" tabindex="1" title="Tag editor">Tag editor</a>
554                                                                 [% ELSIF ( mv.type == 'text2' ) %]
555                                                                     [% IF mv.noclick %]
556                                                                         <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
557                                                                     [% ELSE %]
558                                                                         <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a>
559                                                                     [% END %]
560                                                                     [% mv.javascript | $raw %]
561                                                                 [% END #/IF ( mv.type == 'text1' ) %]
562                                                                 [% IF ( subfield_loo.repeatable ) %]
563                                                                     <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;">
564                                                                         <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
565                                                                     </a>
566                                                                     <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
567                                                                         <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
568                                                                     </a>
569                                                                 [% END # /IF ( subfield_loo.repeatable ) %]
570                                                             </div> <!-- /.subfield_controls -->
571                                                         </li> <!-- /.subfield_line -->
572                                                     [% END # /FOREACH subfield_loo %]
573                                                 </ul> <!-- /.sortable_subfield -->
574                                             </li> <!-- /.tag -->
575                                         [% END # /IF ( innerloo.tag ) %]
576                                     [% END # /FOREACH innerloo %]
577                                     </ul> <!-- /.sortable_field -->
578                                 [% END # /tab_panel#tabXXX %]
579                             [% END #/FOREACH BIG_LOO %]
580                         [% END # /WRAPPER tab_panels %]
581                     [% END # /WRAPPER tabs %]
582
583                     <div name="hidden" id="hidden" class="tab">
584                         [% FOREACH hidden_loo IN hidden_loop %]
585                             <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" />
586                             <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" />
587                             <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" />
588                             <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" />
589                             <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" />
590                         [% END %]
591                     </div> <!-- /.tab -->
592                     [% IF ( oldauthnumtagfield ) %]
593                         <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" />
594                         <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" />
595                         <input type="hidden" name="field_value" value="[% authid | html %]" />
596                         <input type="hidden" name="mandatory" value="0" />
597                         <input type="hidden" name="kohafield" value="[% kohafield | html %]" />
598                         <input type="hidden" name="tag_mandatory" value="[% tag_mandatory | html %]" />
599                         <input type="hidden" name="tag" value="[% oldauthtypetagfield | html %]" />
600                         <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield | html %]" />
601                         <input type="hidden" name="field_value" value="[% authtypecode | html %]" />
602                     [% END %]
603
604                 </form>
605
606                 [% INCLUDE 'modals/cataloguing_create_av.inc' %]
607
608             </div>
609         </div>
610     </div>
611
612 [% INCLUDE 'intranet-bottom.inc' %]