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