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