4 [% PROCESS 'i18n.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% FILTER collapse %]
8 [% tx("Modify authority #{authority_id} ({authtypetext})", { authority_id = authid, authtypetext = authtypetext }) | html %]
10 [% tx("Adding authority ({authtypetext})", { authtypetext = authtypetext }) | html %]
12 [% t("Authorities") | html %] ›
13 [% t("Koha") | html %]
15 [% INCLUDE 'doc-head-close.inc' %]
16 [% Asset.js("lib/hc-sticky.js") | $raw %]
18 [% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
19 var auth_values_creation = 1;
21 var auth_values_creation = 0;
24 [% INCLUDE 'select2.inc' %]
25 [% Asset.js("js/cataloging.js") | $raw %]
28 $(window).load(function(){
32 $(document).ready(function() {
34 $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
35 $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
38 /* On page load, check for location.hash in the page URL */
39 /* If present the location hash will be used to activate the correct tab */
40 var hash = location.hash;
41 var hashPieces = hash.split('?');
42 if( hashPieces[0] !== "" ){
43 selectTab( hashPieces[0] );
44 window.scrollTo( 0, 0 );
46 selectTab( "#tab0XX_panel" );
49 $( "ul.sortable_field", "#authoritytabs" ).sortable();
50 $( "ul.sortable_subfield", "#authoritytabs" ).sortable();
52 Sticky = $("#toolbar");
55 stickyClass: "floating"
58 $("#addauth").click(function(){
63 $("#z3950submit").click(function(){
64 var strQuery = GetZ3950Terms();
65 var index = "&index=[% index | html %]";
67 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');
72 $(".toolbar-tabs-container .nav-tabs a").on("click",function(e){
74 selectTab( this.hash );
77 $(".tag_anchor").on("click", function(e){
79 $(".tag_anchor").removeClass("selected");
80 $(this).addClass("selected");
82 var linkid = link.substring( link.indexOf("#") + 1 );
83 window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
86 $("body").on("click", ".linkfield", function(e){
88 var tab = $(this).data("tab");
89 var field = $(this).data("field");
90 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
92 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
95 $(".change-authtype").on("click", function(){
96 var authtypecode = $(this).data("authtypecode");
98 f.op.value = "[% op | html %]";
99 f.authid.value = "[% authid | html %]";
100 f.changed_authtype.value = "changed";
101 f.authtypecode.value = authtypecode;
105 $("body").on("click", ".linkfield", function(e){
107 var tab = $(this).data("tab");
108 var field = $(this).data("field");
109 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
110 selectTab( tablink );
111 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
114 $("body").on("click", ".show-errors", function(e){
115 document.getElementById("form-errors").scrollIntoView();
116 Sticky.hcSticky('refresh');
121 function selectTab( tablink ){
122 let a = $("a[href='" + tablink + "']");
123 $(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
124 a.tab("show").parent().addClass("selected");
125 /* Get number from string like "tab9XX" */
126 var tabid = a.data("tabname").substring(3, 4);
127 $(".tag_anchors").removeClass("tab_selected").hide();
128 $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
132 * Returns a roughly ideal position to scroll an element into view
133 * @param {string} target - The HTML id of the element to scroll into view
134 * @param {string} elemid - The HTML id of the element which might obscure
135 * the view of the target element e.g. a floating toolbar
136 * @return {number} - The y-coordinate to pass to window.scrollTo()
138 function getScrollto( target, elemid ){
139 var dest = $("#" + target );
140 var yoffset = dest.offset();
143 var element = $("#" + elemid );
144 var elem_height = element.outerHeight();
148 return yoffset.top - elem_height - 20;
153 * check if z3950 mandatories are set or not
155 function GetZ3950Terms(){
156 var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
157 var mandatories = new Array();
158 var mandatories_label = new Array();
159 [% 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 %]");
160 mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %]
162 for(var i=0,len=mandatories.length; i<len ; i++){
163 var field_value = document.getElementById(mandatories[i]).value;
165 strQuery += "&"+mandatories_label[i]+"="+encodeURIComponent(field_value);
172 * check if mandatory subfields are written
174 function AreMandatoriesNotOk(){
175 var fields = new Array();
176 var subfields = new Array();
177 var tab = new Array();
178 var label = new Array();
180 var tabflag= new Array();
181 var StrAlert = "<div id='form-errors' class='dialog alert list'>";
182 var notFilledClass = "subfield_not_filled";
184 [% FOREACH BIG_LOO IN BIG_LOOP %]
185 [% FOREACH innerloo IN BIG_LOO.innerloop %]
186 [% IF ( innerloo.mandatory ) %]
187 fields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]", "[% BIG_LOO.number | html %]"));
189 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
190 [% IF ( subfield_loo.mandatory ) %]subfields.push("[% subfield_loo.id | html %]");
191 tab.push("[% BIG_LOO.number | html %]");
192 label.push("[% subfield_loo.marc_lib | $raw %]");
198 StrAlert += "<h4>" + _("The following mandatory subfields aren't filled:") + "</h4>";
201 for(var i=0,len=subfields.length; i<len ; i++){
202 var tag=subfields[i].substr(4,3);
203 var subfield=subfields[i].substr(17,1);
204 var tagnumber=subfields[i].substr(19,subfields[i].lastIndexOf("_")-19);
205 if (tabflag[tag+subfield+tagnumber] == null) {
206 tabflag[tag+subfield+tagnumber]=new Array();
207 tabflag[tag+subfield+tagnumber][0]=0;
209 if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(subfields[i]) != null && ! document.getElementById(subfields[i]).value || document.getElementById(subfields[i]) == null)){
210 tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
212 var elt = document.getElementById(subfields[i]);
213 if ( elt.nodeName == 'SELECT' ) {
214 $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass);
216 elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass);
218 $('#' + subfields[i]).focus();
219 tabflag[tag+subfield+tagnumber][1]=label[i];
220 tabflag[tag+subfield+tagnumber][2]=tab[i];
222 tabflag[tag+subfield+tagnumber][0] = 1;
224 tabflag[tag+subfield+tagnumber][3] = subfields[i];
227 for (var tagsubfieldid in tabflag){
228 if (tabflag[tagsubfieldid][0]==0){
229 var tag=tagsubfieldid.substr(0,3);
230 var subfield=tagsubfieldid.substr(3,1);
231 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>';
237 mandatoryFields = new Object();
239 /* Check for mandatories field(not subfields) */
240 for(var i=0,len=fields.length; i<len; i++){
243 divid = "tag_" + arr[0] + "_" + arr[1];
244 varegexp = new RegExp("^tag_" + arr[0] + "_code_");
246 if(parseInt(arr[0]) >= 10){
247 elem = document.getElementById(divid);
248 eleminputs = elem.getElementsByTagName('input');
250 for(var j=0,len2=eleminputs.length; j<len2; j++){
252 if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
253 inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
255 for( var k=0; k<len2; k++){
256 if( eleminputs[k].id.match(inputregexp) ){
257 if( eleminputs[k].value ){
263 elemselect = elem.getElementsByTagName('select');
264 for( var k=0; k<elemselect.length; k++){
265 if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
272 elemtextareas = elem.getElementsByTagName('textarea');
273 for(var j=0,len2=elemtextareas.length; j<len2; j++){
274 // this bit assumes that the only textareas in this context would be for subfields
275 if (elemtextareas[j].value) {
286 mandatoryFields[ arr[0] ] = {
287 importance: "mandatory",
288 elemid: "div_indicator_" + divid,
295 if( Object.entries(mandatoryFields).length > 0 ){
296 StrAlert += "<h4>" + _("The following fields aren't filled:") + "</h4>";
298 for( var prop in mandatoryFields ){
299 if( mandatoryFields[prop]["importance"] == "mandatory" ){
300 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>';
302 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>';
307 StrAlert += "</div>";
309 $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa-solid fa-triangle-exclamation"></i> ' + _("Errors") + '</span>');
317 var StrAlert = AreMandatoriesNotOk();
322 $("#check_errors").html( StrAlert );
323 $('html, body').animate({ scrollTop: 0 }, 'fast');
324 Sticky.hcSticky('refresh');
329 function AddField(field,cntrepeatfield) {
330 document.forms['f'].op.value = "addfield";
331 document.forms['f'].addfield_field.value=field;
332 document.forms['f'].repeat_field.value=cntrepeatfield;
336 function addauthority() {
337 X = document.forms[0].authtype.value;
338 window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
340 function searchauthority() {
341 X = document.forms[0].authtype2.value;
342 Y = document.forms[0].value.value;
343 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";
345 function confirmnotdup(redirect){
346 $("#confirm_not_duplicate").attr("value","1");
349 /* Wrap a value in HTML without putting HTML in translatable string */
350 function formatFieldName( string ){
351 return "<strong><em>" + string + "</em></strong>";
354 $(document).ready(function(){
355 $('body').on('click','.expandfield',ExpandField);
358 [% Asset.css("css/addbiblio.css") | $raw %]
361 <body id="auth_authorities" class="auth">
364 <div>Loading, please wait...</div>
367 [% INCLUDE 'header.inc' %]
369 [% WRAPPER 'sub-header.inc' %]
370 [% WRAPPER breadcrumbs %]
371 [% WRAPPER breadcrumb_item %]
372 <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
376 [% WRAPPER breadcrumb_item bc_active= 1 %]
377 <span>Modify authority #[% authid | html %] ([% authtypetext | html %])</span>
381 [% WRAPPER breadcrumb_item bc_active= 1 %]
382 <span>Adding authority [% authtypetext | html %]</span>
386 [% END #/ WRAPPER breadcrumbs %]
387 [% END #/ WRAPPER sub-header.inc %]
389 <div class="main container-fluid">
391 <div class="col-md-10 col-md-offset-1">
394 <h1>Modify authority #[% authid | html %] [% authtypetext | html %]</h1>
396 <h1>Adding authority [% authtypetext | html %]</h1>
399 <div id="check_errors"></div>
401 [% IF ( duplicateauthid ) %]
402 <div class="dialog alert">
403 <h3>Duplicate record suspected</h3>
404 <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>
406 <form action="authorities.pl" method="get">
407 <input type="hidden" name="authid" value="[% duplicateauthid | html %]" />
408 <button type="submit" class="new"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Yes: Edit existing authority</button>
410 <form action="authorities.pl" method="get">
411 <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
414 [% END # /IF duplicateauthid %]
416 <form method="post" id="f" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
417 <input type="hidden" name="op" value="add" />
418 <input type="hidden" name="addfield_field" value="" />
419 <input type="hidden" name="repeat_field" value="" />
420 <input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />
421 <input type="hidden" name="authid" value="[% authid | html %]" />
422 <input type="hidden" name="index" value="[% index | html %]" />
423 <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
424 <input type="hidden" name="changed_authtype" value="" />
426 <div id="toolbar" class="btn-toolbar">
427 <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
428 <div class="btn-group">
430 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a>
432 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
435 <div class="btn-group">
436 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
437 <ul id="settings-menu" class="dropdown-menu">
438 <li class="dropdown-header">Change authority type</li>
440 <a href="#" class="change-authtype" data-authtypecode="">
441 [% IF ( authtypecode ) %]
442 <i class="fa fa-fw"> </i>
444 <i class="fa fa-fw fa-check"></i>
449 [% FOREACH authority_type IN authority_types %]
451 <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]">
452 [% IF authority_type.authtypecode == authtypecode %]
453 <i class="fa fa-fw fa-check"></i>
455 <i class="fa fa-fw"> </i>
457 [% authority_type.authtypetext | html %]
461 </ul> <!-- /#settings-menu -->
462 </div> <!-- /.btn-group -->
463 <div class="btn-group">
465 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
467 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
470 <div id="show-errors" class="btn-group"></div>
471 <div class="toolbar-tabs-container">
472 [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
473 [% WRAPPER tabs_nav %]
474 [%- FOREACH BIG_LOO IN BIG_LOOP -%]
476 [% SET bt_active = 1 %]
478 [% SET bt_active = 0 %]
480 [% WRAPPER tab_item tabname= "tab${BIG_LOO.number}XX" bt_active= bt_active %]
481 <span>[% BIG_LOO.number | html %]</span>
484 [% END # /WRAPPER tabs_nav %]
486 <ul class="tag_anchors_list">
487 [% FOREACH BIG_LOO IN BIG_LOOP %]
488 [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
489 [% FOREACH innerloo IN BIG_LOO.innerloop %]
490 [% IF ( innerloo.tag ) %]
491 <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
492 <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>
499 </div> <!-- /#toolbar -->
502 Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&q=an:[% authid | uri %]">[% count | html %] record(s)</a>
504 This authority is not used in any records.
508 [% WRAPPER tabs id= "authoritytabs" %]
509 [% WRAPPER tab_panels %]
510 [% FOREACH BIG_LOO IN BIG_LOOP %]
512 [% SET bt_active = 1 %]
514 [% SET bt_active = 0 %]
516 [% WRAPPER tab_panel tabname="tab${BIG_LOO.number}XX" bt_active= bt_active %]
517 [% IF ( BIG_LOOP.size > 1 ) %]
518 <h2>Section [% BIG_LOO.number | html %]</h2>
521 [% FOREACH innerloo IN BIG_LOO.innerloop %]
522 [% IF ( innerloo.tag ) %]
523 [% IF innerloo.tag != previous %]
524 [% IF previous != "" %]
527 [% previous = innerloo.tag %]
528 [% IF ( innerloo.repeatable ) %]
529 <ul class="sortable_field">
535 [% IF ( innerloo.repeatable ) %]
536 <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
538 <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
541 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
542 [% UNLESS hide_marc %]
543 [% IF advancedMARCEditor %]
544 <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to expand this tag" data-field_id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'">[% innerloo.tag | html %]</a>
546 <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
548 [% IF ( innerloo.fixedfield ) %]
551 class="indicator flat"
552 style="display:none;"
553 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
556 value="[% innerloo.indicator1 | html %]" />
559 class="indicator flat"
560 style="display:none;"
561 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
564 value="[% innerloo.indicator2 | html %]" />
568 class="indicator flat"
569 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
572 value="[% innerloo.indicator1 | html %]" />
575 class="indicator flat"
576 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
579 value="[% innerloo.indicator2 | html %]" />
580 [% END # /IF ( innerloo.fixedfield ) %] -
582 [% IF ( innerloo.fixedfield ) %]
585 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
586 value="[% innerloo.indicator1 | html %]" />
589 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
590 value="[% innerloo.indicator2 | html %]" />
594 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
595 value="[% innerloo.indicator1 | html %]" />
598 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
599 value="[% innerloo.indicator2 | html %]" />
600 [% END # /IF ( innerloo.fixedfield ) %]
601 [% END # /UNLESS hide_marc %]
603 [% UNLESS advancedMARCEditor %]
604 <a href="#" tabindex="1" class="expandfield" data-field_id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]" title="Click to expand this tag">[% innerloo.tag_lib | html %]</a>
606 <span class="field_controls">
607 [% IF ( innerloo.repeatable ) %]
608 <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">
609 <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this tag" />
612 <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this tag">
613 <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this tag" />
615 </span> <!-- /.field_controls -->
616 </div> <!-- /div.tag_title -->
618 <ul class="sortable_subfield">
619 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
620 <!-- One line on the marc editor -->
621 <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
623 [% UNLESS hide_marc %]
624 <div class="subfieldcode">
626 title="[% subfield_loo.marc_lib | $raw %]"
627 style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
628 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
629 value="[% subfield_loo.subfield | html %]"
637 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
638 value="[% subfield_loo.subfield | html %]" />
639 [% END # /UNLESS hide_marc %]
641 [% UNLESS advancedMARCEditor %]
642 [% IF ( subfield_loo.mandatory ) %]
643 <div class="subfield subfield_mandatory">
645 <div class="subfield">
647 [% IF ( subfield_loo.fixedfield ) %]
648 <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">
650 <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
652 [% subfield_loo.marc_lib | $raw %]
654 </div> <!-- /.subfield -->
655 [% END # UNLESS advancedMARCEditor %]
657 [% SET mv = subfield_loo.marc_value %]
658 <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
659 [% IF ( mv.type == 'select' ) %]
660 [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
661 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
663 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
665 [% FOREACH aval IN mv.values %]
666 [% IF aval == mv.default %]
667 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
669 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
673 [% ELSIF ( mv.type == 'text1' ) %]
674 <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" />
675 [% ELSIF ( mv.type == 'text2' ) %]
676 <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" />
677 [% ELSIF ( mv.type == 'text' ) %]
678 <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 -%]" />
679 [% ELSIF ( mv.type == 'textarea' ) %]
680 <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>
681 [% ELSIF ( mv.type == 'hidden' ) %]
682 <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
683 [% ELSIF ( mv.type == 'hidden_simple' ) %]
684 <input type="hidden" name="[%- mv.name | html -%]" />
685 [% END # /IF mv.type %]
686 </div> <!-- /.field_marceditor -->
688 [% IF ( subfield_loo.mandatory ) %]
689 <div class="subfield_loop_mandatory">
690 <span class="required">Required</span>
694 <div class="subfield_controls">
695 [% IF ( mv.type == 'text1' ) %]
696 <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>
697 [% ELSIF ( mv.type == 'text2' ) %]
699 <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
701 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a>
703 [% mv.javascript | $raw %]
704 [% END #/IF ( mv.type == 'text1' ) %]
705 [% IF ( subfield_loo.repeatable ) %]
706 <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;">
707 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
709 <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
710 <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
712 [% END # /IF ( subfield_loo.repeatable ) %]
713 </div> <!-- /.subfield_controls -->
714 </li> <!-- /.subfield_line -->
715 [% END # /FOREACH subfield_loo %]
716 </ul> <!-- /.sortable_subfield -->
718 [% END # /IF ( innerloo.tag ) %]
719 [% END # /FOREACH innerloo %]
720 </ul> <!-- /.sortable_field -->
721 [% END # /tab_panel#tabXXX %]
722 [% END #/FOREACH BIG_LOO %]
723 [% END # /WRAPPER tab_panels %]
724 [% END # /WRAPPER tabs %]
726 <div name="hidden" id="hidden" class="tab">
727 [% FOREACH hidden_loo IN hidden_loop %]
728 <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" />
729 <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" />
730 <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" />
731 <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" />
732 <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" />
734 </div> <!-- /.tab -->
735 [% IF ( oldauthnumtagfield ) %]
736 <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" />
737 <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" />
738 <input type="hidden" name="field_value" value="[% authid | html %]" />
739 <input type="hidden" name="mandatory" value="0" />
740 <input type="hidden" name="kohafield" value="[% kohafield | html %]" />
741 <input type="hidden" name="tag_mandatory" value="[% tag_mandatory | html %]" />
742 <input type="hidden" name="tag" value="[% oldauthtypetagfield | html %]" />
743 <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield | html %]" />
744 <input type="hidden" name="field_value" value="[% authtypecode | html %]" />
749 [% INCLUDE 'modals/cataloguing_create_av.inc' %]
755 [% INCLUDE 'intranet-bottom.inc' %]