4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %] › Authorities › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% Asset.js("lib/hc-sticky.js") | $raw %]
9 [% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
10 var auth_values_creation = 1;
12 var auth_values_creation = 0;
15 [% INCLUDE 'select2.inc' %]
16 [% Asset.js("js/cataloging.js") | $raw %]
19 $(window).load(function(){
23 $(document).ready(function() {
25 $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
26 $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
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 );
37 selectTab( "#tab0XX_panel" );
40 $( "ul.sortable_field", "#authoritytabs" ).sortable();
41 $( "ul.sortable_subfield", "#authoritytabs" ).sortable();
43 Sticky = $("#toolbar");
46 stickyClass: "floating"
49 $("#addauth").click(function(){
54 $("#z3950submit").click(function(){
55 var strQuery = GetZ3950Terms();
56 var index = "&index=[% index | html %]";
58 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');
63 $(".toolbar-tabs-container .nav-tabs a").on("click",function(e){
65 selectTab( this.hash );
68 $(".tag_anchor").on("click", function(e){
70 $(".tag_anchor").removeClass("selected");
71 $(this).addClass("selected");
73 var linkid = link.substring( link.indexOf("#") + 1 );
74 window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
77 $("body").on("click", ".linkfield", function(e){
79 var tab = $(this).data("tab");
80 var field = $(this).data("field");
81 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
83 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
86 $(".change-authtype").on("click", function(){
87 var authtypecode = $(this).data("authtypecode");
89 f.op.value = "[% op | html %]";
90 f.authid.value = "[% authid | html %]";
91 f.changed_authtype.value = "changed";
92 f.authtypecode.value = authtypecode;
96 $("body").on("click", ".linkfield", function(e){
98 var tab = $(this).data("tab");
99 var field = $(this).data("field");
100 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
101 selectTab( tablink );
102 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
105 $("body").on("click", ".show-errors", function(e){
106 document.getElementById("form-errors").scrollIntoView();
107 Sticky.hcSticky('refresh');
112 function selectTab( tablink ){
113 let a = $("a[href='" + tablink + "']");
114 $(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
115 a.tab("show").parent().addClass("selected");
116 /* Get number from string like "tab9XX" */
117 var tabid = a.data("tabname").substring(3, 4);
118 $(".tag_anchors").removeClass("tab_selected").hide();
119 $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
123 * Returns a roughly ideal position to scroll an element into view
124 * @param {string} target - The HTML id of the element to scroll into view
125 * @param {string} elemid - The HTML id of the element which might obscure
126 * the view of the target element e.g. a floating toolbar
127 * @return {number} - The y-coordinate to pass to window.scrollTo()
129 function getScrollto( target, elemid ){
130 var dest = $("#" + target );
131 var yoffset = dest.offset();
134 var element = $("#" + elemid );
135 var elem_height = element.outerHeight();
139 return yoffset.top - elem_height - 20;
144 * check if z3950 mandatories are set or not
146 function GetZ3950Terms(){
147 var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
148 var mandatories = new Array();
149 var mandatories_label = new Array();
150 [% 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 %]");
151 mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %]
153 for(var i=0,len=mandatories.length; i<len ; i++){
154 var field_value = document.getElementById(mandatories[i]).value;
156 strQuery += "&"+mandatories_label[i]+"="+encodeURIComponent(field_value);
163 * check if mandatory subfields are written
165 function AreMandatoriesNotOk(){
166 var fields = new Array();
167 var subfields = new Array();
168 var tab = new Array();
169 var label = new Array();
171 var tabflag= new Array();
172 var StrAlert = "<div id='form-errors' class='dialog alert list'>";
173 var notFilledClass = "subfield_not_filled";
175 [% FOREACH BIG_LOO IN BIG_LOOP %]
176 [% FOREACH innerloo IN BIG_LOO.innerloop %]
177 [% IF ( innerloo.mandatory ) %]
178 fields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]", "[% BIG_LOO.number | html %]"));
180 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
181 [% IF ( subfield_loo.mandatory ) %]subfields.push("[% subfield_loo.id | html %]");
182 tab.push("[% BIG_LOO.number | html %]");
183 label.push("[% subfield_loo.marc_lib | $raw %]");
189 StrAlert += "<h4>" + _("The following mandatory subfields aren't filled:") + "</h4>";
192 for(var i=0,len=subfields.length; i<len ; i++){
193 var tag=subfields[i].substr(4,3);
194 var subfield=subfields[i].substr(17,1);
195 var tagnumber=subfields[i].substr(19,subfields[i].lastIndexOf("_")-19);
196 if (tabflag[tag+subfield+tagnumber] == null) {
197 tabflag[tag+subfield+tagnumber]=new Array();
198 tabflag[tag+subfield+tagnumber][0]=0;
200 if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(subfields[i]) != null && ! document.getElementById(subfields[i]).value || document.getElementById(subfields[i]) == null)){
201 tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
203 var elt = document.getElementById(subfields[i]);
204 if ( elt.nodeName == 'SELECT' ) {
205 $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass);
207 elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass);
209 $('#' + subfields[i]).focus();
210 tabflag[tag+subfield+tagnumber][1]=label[i];
211 tabflag[tag+subfield+tagnumber][2]=tab[i];
213 tabflag[tag+subfield+tagnumber][0] = 1;
215 tabflag[tag+subfield+tagnumber][3] = subfields[i];
218 for (var tagsubfieldid in tabflag){
219 if (tabflag[tagsubfieldid][0]==0){
220 var tag=tagsubfieldid.substr(0,3);
221 var subfield=tagsubfieldid.substr(3,1);
222 StrAlert += "<li>"+_("Tag %s subfield %s %s in tab %s").format(tag, subfield, formatFieldName( tabflag[tagsubfieldid][1] ), tabflag[tagsubfieldid][2]) + ' <a class="linkfield btn btn-link" href="#" data-tab="' + tabflag[tagsubfieldid][2] + '" data-field="' + tabflag[tagsubfieldid][3] + '"><i class="fa fa-arrow-right" aria-hidden="true"></i> ' + _("Go to field") + '</a></li>';
228 mandatoryFields = new Object();
230 /* Check for mandatories field(not subfields) */
231 for(var i=0,len=fields.length; i<len; i++){
234 divid = "tag_" + arr[0] + "_" + arr[1];
235 varegexp = new RegExp("^tag_" + arr[0] + "_code_");
237 if(parseInt(arr[0]) >= 10){
238 elem = document.getElementById(divid);
239 eleminputs = elem.getElementsByTagName('input');
241 for(var j=0,len2=eleminputs.length; j<len2; j++){
243 if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
244 inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
246 for( var k=0; k<len2; k++){
247 if( eleminputs[k].id.match(inputregexp) ){
248 if( eleminputs[k].value ){
254 elemselect = elem.getElementsByTagName('select');
255 for( var k=0; k<elemselect.length; k++){
256 if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
263 elemtextareas = elem.getElementsByTagName('textarea');
264 for(var j=0,len2=elemtextareas.length; j<len2; j++){
265 // this bit assumes that the only textareas in this context would be for subfields
266 if (elemtextareas[j].value) {
277 mandatoryFields[ arr[0] ] = {
278 importance: "mandatory",
279 elemid: "div_indicator_" + divid,
286 if( Object.entries(mandatoryFields).length > 0 ){
287 StrAlert += "<h4>" + _("The following fields aren't filled:") + "</h4>";
289 for( var prop in mandatoryFields ){
290 if( mandatoryFields[prop]["importance"] == "mandatory" ){
291 StrAlert += "<li>" + _("Field %s is mandatory, at least one of its subfields must be filled.").format( prop ) + ' <a class="linkfield btn btn-link" href="#" data-tab="' + mandatoryFields[prop]["tab"] + '" data-field="' + mandatoryFields[prop]["elemid"] + '"><i class="fa fa-arrow-right" aria-hidden="true"></i> ' + _("Go to field") + '</a></li>';
293 StrAlert += "<li>" + _("Field %s is important, at least one of its subfields must be filled.").format(prop) + ' <a class="linkfield btn btn-link" href="#" data-tab="' + mandatoryFields[prop]["tab"] + '" data-field="' + mandatoryFields[prop]["elemid"] + '"><i class="fa fa-arrow-right" aria-hidden="true"></i> ' + _("Go to field") + '</a></li>';
298 StrAlert += "</div>";
300 $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa-solid fa-triangle-exclamation"></i> ' + _("Errors") + '</span>');
308 var StrAlert = AreMandatoriesNotOk();
313 $("#check_errors").html( StrAlert );
314 $('html, body').animate({ scrollTop: 0 }, 'fast');
315 Sticky.hcSticky('refresh');
320 function AddField(field,cntrepeatfield) {
321 document.forms['f'].op.value = "addfield";
322 document.forms['f'].addfield_field.value=field;
323 document.forms['f'].repeat_field.value=cntrepeatfield;
327 function addauthority() {
328 X = document.forms[0].authtype.value;
329 window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
331 function searchauthority() {
332 X = document.forms[0].authtype2.value;
333 Y = document.forms[0].value.value;
334 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";
336 function confirmnotdup(redirect){
337 $("#confirm_not_duplicate").attr("value","1");
340 /* Wrap a value in HTML without putting HTML in translatable string */
341 function formatFieldName( string ){
342 return "<strong><em>" + string + "</em></strong>";
345 [% Asset.css("css/addbiblio.css") | $raw %]
348 <body id="auth_authorities" class="auth">
351 <div>Loading, please wait...</div>
354 [% INCLUDE 'header.inc' %]
356 [% WRAPPER 'sub-header.inc' %]
357 [% WRAPPER breadcrumbs %]
358 [% WRAPPER breadcrumb_item %]
359 <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
363 [% WRAPPER breadcrumb_item bc_active= 1 %]
364 <span>Modify authority #[% authid | html %] ([% authtypetext | html %])</span>
368 [% WRAPPER breadcrumb_item bc_active= 1 %]
369 <span>Adding authority [% authtypetext | html %]</span>
373 [% END #/ WRAPPER breadcrumbs %]
374 [% END #/ WRAPPER sub-header.inc %]
376 <div class="main container-fluid">
378 <div class="col-md-10 col-md-offset-1">
381 <h1>Modify authority #[% authid | html %] [% authtypetext | html %]</h1>
383 <h1>Adding authority [% authtypetext | html %]</h1>
386 <div id="check_errors"></div>
388 [% IF ( duplicateauthid ) %]
389 <div class="dialog alert">
390 <h3>Duplicate record suspected</h3>
391 <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 %]&popup=1', 'DuplicateAuthority','800','600'); return false;" class="button">[% duplicateauthvalue | html %]</a> ?</p>
393 <form action="authorities.pl" method="get">
394 <input type="hidden" name="authid" value="[% duplicateauthid | html %]" />
395 <button type="submit" class="new"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Yes: Edit existing authority</button>
397 <form action="authorities.pl" method="get">
398 <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
401 [% END # /IF duplicateauthid %]
403 <form method="post" id="f" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
404 <input type="hidden" name="op" value="add" />
405 <input type="hidden" name="addfield_field" value="" />
406 <input type="hidden" name="repeat_field" value="" />
407 <input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />
408 <input type="hidden" name="authid" value="[% authid | html %]" />
409 <input type="hidden" name="index" value="[% index | html %]" />
410 <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
411 <input type="hidden" name="changed_authtype" value="" />
413 <div id="toolbar" class="btn-toolbar">
414 <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
415 <div class="btn-group">
417 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a>
419 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
422 <div class="btn-group">
423 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
424 <ul id="settings-menu" class="dropdown-menu">
425 <li class="dropdown-header">Change authority type</li>
427 <a href="#" class="change-authtype" data-authtypecode="">
428 [% IF ( authtypecode ) %]
429 <i class="fa fa-fw"> </i>
431 <i class="fa fa-fw fa-check"></i>
436 [% FOREACH authority_type IN authority_types %]
438 <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]">
439 [% IF authority_type.authtypecode == authtypecode %]
440 <i class="fa fa-fw fa-check"></i>
442 <i class="fa fa-fw"> </i>
444 [% authority_type.authtypetext | html %]
448 </ul> <!-- /#settings-menu -->
449 </div> <!-- /.btn-group -->
450 <div class="btn-group">
452 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
454 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
457 <div id="show-errors" class="btn-group"></div>
458 <div class="toolbar-tabs-container">
459 [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
460 [% WRAPPER tabs_nav %]
461 [%- FOREACH BIG_LOO IN BIG_LOOP -%]
463 [% SET bt_active = 1 %]
465 [% SET bt_active = 0 %]
467 [% WRAPPER tab_item tabname= "tab${BIG_LOO.number}XX" bt_active= bt_active %]
468 <span>[% BIG_LOO.number | html %]</span>
471 [% END # /WRAPPER tabs_nav %]
473 <ul class="tag_anchors_list">
474 [% FOREACH BIG_LOO IN BIG_LOOP %]
475 [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
476 [% FOREACH innerloo IN BIG_LOO.innerloop %]
477 [% IF ( innerloo.tag ) %]
478 <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
479 <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>
486 </div> <!-- /#toolbar -->
489 Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&q=an:[% authid | uri %]">[% count | html %] record(s)</a>
491 This authority is not used in any records.
495 [% WRAPPER tabs id= "authoritytabs" %]
496 [% WRAPPER tab_panels %]
497 [% FOREACH BIG_LOO IN BIG_LOOP %]
499 [% SET bt_active = 1 %]
501 [% SET bt_active = 0 %]
503 [% WRAPPER tab_panel tabname="tab${BIG_LOO.number}XX" bt_active= bt_active %]
504 [% IF ( BIG_LOOP.size > 1 ) %]
505 <h2>Section [% BIG_LOO.number | html %]</h2>
508 [% FOREACH innerloo IN BIG_LOO.innerloop %]
509 [% IF ( innerloo.tag ) %]
510 [% IF innerloo.tag != previous %]
511 [% IF previous != "" %]
514 [% previous = innerloo.tag %]
515 [% IF ( innerloo.repeatable ) %]
516 <ul class="sortable_field">
522 [% IF ( innerloo.repeatable ) %]
523 <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
525 <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
528 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
529 [% UNLESS hide_marc %]
530 [% IF advancedMARCEditor %]
531 <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>
533 <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
535 [% IF ( innerloo.fixedfield ) %]
538 class="indicator flat"
539 style="display:none;"
540 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
543 value="[% innerloo.indicator1 | html %]" />
546 class="indicator flat"
547 style="display:none;"
548 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
551 value="[% innerloo.indicator2 | html %]" />
555 class="indicator flat"
556 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
559 value="[% innerloo.indicator1 | html %]" />
562 class="indicator flat"
563 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
566 value="[% innerloo.indicator2 | html %]" />
567 [% END # /IF ( innerloo.fixedfield ) %] -
569 [% IF ( innerloo.fixedfield ) %]
572 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
573 value="[% innerloo.indicator1 | html %]" />
576 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
577 value="[% innerloo.indicator2 | html %]" />
581 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
582 value="[% innerloo.indicator1 | html %]" />
585 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
586 value="[% innerloo.indicator2 | html %]" />
587 [% END # /IF ( innerloo.fixedfield ) %]
588 [% END # /UNLESS hide_marc %]
590 [% UNLESS advancedMARCEditor %]
591 <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>
593 <span class="field_controls">
594 [% IF ( innerloo.repeatable ) %]
595 <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">
596 <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this tag" />
599 <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this tag">
600 <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this tag" />
602 </span> <!-- /.field_controls -->
603 </div> <!-- /div.tag_title -->
605 <ul class="sortable_subfield">
606 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
607 <!-- One line on the marc editor -->
608 <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
610 [% UNLESS hide_marc %]
611 <div class="subfieldcode">
613 title="[% subfield_loo.marc_lib | $raw %]"
614 style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
615 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
616 value="[% subfield_loo.subfield | html %]"
624 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
625 value="[% subfield_loo.subfield | html %]" />
626 [% END # /UNLESS hide_marc %]
628 [% UNLESS advancedMARCEditor %]
629 [% IF ( subfield_loo.mandatory ) %]
630 <div class="subfield subfield_mandatory">
632 <div class="subfield">
634 [% IF ( subfield_loo.fixedfield ) %]
635 <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">
637 <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
639 [% subfield_loo.marc_lib | $raw %]
641 </div> <!-- /.subfield -->
642 [% END # UNLESS advancedMARCEditor %]
644 [% SET mv = subfield_loo.marc_value %]
645 <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
646 [% IF ( mv.type == 'select' ) %]
647 [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
648 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
650 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
652 [% FOREACH aval IN mv.values %]
653 [% IF aval == mv.default %]
654 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
656 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
660 [% ELSIF ( mv.type == 'text1' ) %]
661 <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" />
662 [% ELSIF ( mv.type == 'text2' ) %]
663 <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" />
664 [% ELSIF ( mv.type == 'text' ) %]
665 <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 -%]" />
666 [% ELSIF ( mv.type == 'textarea' ) %]
667 <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>
668 [% ELSIF ( mv.type == 'hidden' ) %]
669 <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
670 [% ELSIF ( mv.type == 'hidden_simple' ) %]
671 <input type="hidden" name="[%- mv.name | html -%]" />
672 [% END # /IF mv.type %]
673 </div> <!-- /.field_marceditor -->
675 [% IF ( subfield_loo.mandatory ) %]
676 <div class="subfield_loop_mandatory">
677 <span class="required">Required</span>
681 <div class="subfield_controls">
682 [% IF ( mv.type == 'text1' ) %]
683 <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>
684 [% ELSIF ( mv.type == 'text2' ) %]
686 <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
688 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a>
690 [% mv.javascript | $raw %]
691 [% END #/IF ( mv.type == 'text1' ) %]
692 [% IF ( subfield_loo.repeatable ) %]
693 <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;">
694 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
696 <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
697 <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
699 [% END # /IF ( subfield_loo.repeatable ) %]
700 </div> <!-- /.subfield_controls -->
701 </li> <!-- /.subfield_line -->
702 [% END # /FOREACH subfield_loo %]
703 </ul> <!-- /.sortable_subfield -->
705 [% END # /IF ( innerloo.tag ) %]
706 [% END # /FOREACH innerloo %]
707 </ul> <!-- /.sortable_field -->
708 [% END # /tab_panel#tabXXX %]
709 [% END #/FOREACH BIG_LOO %]
710 [% END # /WRAPPER tab_panels %]
711 [% END # /WRAPPER tabs %]
713 <div name="hidden" id="hidden" class="tab">
714 [% FOREACH hidden_loo IN hidden_loop %]
715 <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" />
716 <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" />
717 <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" />
718 <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" />
719 <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" />
721 </div> <!-- /.tab -->
722 [% IF ( oldauthnumtagfield ) %]
723 <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" />
724 <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" />
725 <input type="hidden" name="field_value" value="[% authid | html %]" />
726 <input type="hidden" name="mandatory" value="0" />
727 <input type="hidden" name="kohafield" value="[% kohafield | html %]" />
728 <input type="hidden" name="tag_mandatory" value="[% tag_mandatory | html %]" />
729 <input type="hidden" name="tag" value="[% oldauthtypetagfield | html %]" />
730 <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield | html %]" />
731 <input type="hidden" name="field_value" value="[% authtypecode | html %]" />
736 [% INCLUDE 'modals/cataloguing_create_av.inc' %]
742 [% INCLUDE 'intranet-bottom.inc' %]