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 %]
17 [% INCLUDE 'select2.inc' %]
19 [% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
20 var auth_values_creation = 1;
22 var auth_values_creation = 0;
24 $.fn.select2.defaults.set("width", "100%" );
26 [% Asset.js( "lib/sortable/Sortable.min.js" ) | $raw %]
27 [% Asset.js("js/cataloging.js") | $raw %]
30 $(window).load(function(){
34 $(document).ready(function() {
36 $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
37 $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
40 /* On page load, check for location.hash in the page URL */
41 /* If present the location hash will be used to activate the correct tab */
42 var hash = location.hash;
43 var hashPieces = hash.split('?');
44 if( hashPieces[0] !== "" ){
45 selectTab( hashPieces[0] );
46 window.scrollTo( 0, 0 );
48 selectTab( "#tab0XX_panel" );
51 $("#authoritytabs ul.sortable_field").each( (i, e) => {
57 $("#authoritytabs ul.sortable_subfield").each( (i, e) => {
63 Sticky = $("#toolbar");
66 stickyClass: "floating"
69 $("#addauth").click(function(){
74 $("#z3950submit").click(function(){
75 var strQuery = GetZ3950Terms();
76 var index = "&index=[% index | html %]";
78 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');
83 $(".toolbar-tabs-container .nav-tabs a").on("click",function(e){
85 selectTab( this.hash );
88 $(".tag_anchor").on("click", function(e){
90 $(".tag_anchor").removeClass("selected");
91 $(this).addClass("selected");
93 var linkid = link.substring( link.indexOf("#") + 1 );
94 window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
97 $("body").on("click", ".linkfield", function(e){
99 var tab = $(this).data("tab");
100 var field = $(this).data("field");
101 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
102 selectTab( tablink );
103 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
106 $(".change-authtype").on("click", function(){
107 var authtypecode = $(this).data("authtypecode");
109 f.op.value = "[% op | html %]";
110 f.authid.value = "[% authid | html %]";
111 f.changed_authtype.value = "changed";
112 f.authtypecode.value = authtypecode;
116 $("body").on("click", ".linkfield", function(e){
118 var tab = $(this).data("tab");
119 var field = $(this).data("field");
120 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
121 selectTab( tablink );
122 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
125 $("body").on("click", ".show-errors", function(e){
126 document.getElementById("form-errors").scrollIntoView();
127 Sticky.hcSticky('refresh');
132 function selectTab( tablink ){
133 /* return if no tabs displayed (BIG_LOOP.size <= 1) */
134 if ($(".toolbar-tabs-container .nav-tabs li").length === 0){
137 let a = $("a[href='" + tablink + "']");
138 $(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
139 a.tab("show").parent().addClass("selected");
140 /* Get number from string like "tab9XX" */
141 var tabid = a.data("tabname").substring(3, 4);
142 $(".tag_anchors").removeClass("tab_selected").hide();
143 $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
147 * Returns a roughly ideal position to scroll an element into view
148 * @param {string} target - The HTML id of the element to scroll into view
149 * @param {string} elemid - The HTML id of the element which might obscure
150 * the view of the target element e.g. a floating toolbar
151 * @return {number} - The y-coordinate to pass to window.scrollTo()
153 function getScrollto( target, elemid ){
154 var dest = $("#" + target );
155 var yoffset = dest.offset();
158 var element = $("#" + elemid );
159 var elem_height = element.outerHeight();
163 return yoffset.top - elem_height - 20;
168 * check if z3950 mandatories are set or not
170 function GetZ3950Terms(){
171 var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
172 var mandatories = new Array();
173 var mandatories_label = new Array();
174 [% 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 %]");
175 mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %]
177 for(var i=0,len=mandatories.length; i<len ; i++){
178 var field_value = document.getElementById(mandatories[i]).value;
180 strQuery += "&"+mandatories_label[i]+"="+encodeURIComponent(field_value);
187 * check if mandatory subfields are written
189 function AreMandatoriesNotOk(){
190 var fields = new Array();
191 var subfields = new Array();
192 var tab = new Array();
193 var label = new Array();
195 var tabflag= new Array();
196 var StrAlert = "<div id='form-errors' class='dialog alert list'>";
197 var notFilledClass = "subfield_not_filled";
199 [% FOREACH BIG_LOO IN BIG_LOOP %]
200 [% FOREACH innerloo IN BIG_LOO.innerloop %]
201 [% IF ( innerloo.mandatory ) %]
202 fields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]", "[% BIG_LOO.number | html %]"));
204 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
205 [% IF ( subfield_loo.mandatory ) %]subfields.push("[% subfield_loo.id | html %]");
206 tab.push("[% BIG_LOO.number | html %]");
207 label.push("[% subfield_loo.marc_lib | $raw %]");
213 StrAlert += "<h4>" + _("The following mandatory subfields aren't filled:") + "</h4>";
216 for(var i=0,len=subfields.length; i<len ; i++){
217 var tag=subfields[i].substr(4,3);
218 var subfield=subfields[i].substr(17,1);
219 var tagnumber=subfields[i].substr(19,subfields[i].lastIndexOf("_")-19);
220 if (tabflag[tag+subfield+tagnumber] == null) {
221 tabflag[tag+subfield+tagnumber]=new Array();
222 tabflag[tag+subfield+tagnumber][0]=0;
224 if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(subfields[i]) != null && ! document.getElementById(subfields[i]).value || document.getElementById(subfields[i]) == null)){
225 tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
227 var elt = document.getElementById(subfields[i]);
228 if ( elt.nodeName == 'SELECT' ) {
229 $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass);
231 elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass);
233 $('#' + subfields[i]).focus();
234 tabflag[tag+subfield+tagnumber][1]=label[i];
235 tabflag[tag+subfield+tagnumber][2]=tab[i];
237 tabflag[tag+subfield+tagnumber][0] = 1;
239 tabflag[tag+subfield+tagnumber][3] = subfields[i];
242 for (var tagsubfieldid in tabflag){
243 if (tabflag[tagsubfieldid][0]==0){
244 var tag=tagsubfieldid.substr(0,3);
245 var subfield=tagsubfieldid.substr(3,1);
246 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>';
252 mandatoryFields = new Object();
254 /* Check for mandatories field(not subfields) */
255 for(var i=0,len=fields.length; i<len; i++){
258 divid = "tag_" + arr[0] + "_" + arr[1];
259 varegexp = new RegExp("^tag_" + arr[0] + "_code_");
261 if(parseInt(arr[0]) >= 10){
262 elem = document.getElementById(divid);
263 eleminputs = elem.getElementsByTagName('input');
265 for(var j=0,len2=eleminputs.length; j<len2; j++){
267 if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
268 inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
270 for( var k=0; k<len2; k++){
271 if( eleminputs[k].id.match(inputregexp) ){
272 if( eleminputs[k].value ){
278 elemselect = elem.getElementsByTagName('select');
279 for( var k=0; k<elemselect.length; k++){
280 if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
287 elemtextareas = elem.getElementsByTagName('textarea');
288 for(var j=0,len2=elemtextareas.length; j<len2; j++){
289 // this bit assumes that the only textareas in this context would be for subfields
290 if (elemtextareas[j].value) {
301 mandatoryFields[ arr[0] ] = {
302 importance: "mandatory",
303 elemid: "div_indicator_" + divid,
310 if( Object.entries(mandatoryFields).length > 0 ){
311 StrAlert += "<h4>" + _("The following fields aren't filled:") + "</h4>";
313 for( var prop in mandatoryFields ){
314 if( mandatoryFields[prop]["importance"] == "mandatory" ){
315 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>';
317 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>';
322 StrAlert += "</div>";
324 $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa-solid fa-triangle-exclamation"></i> ' + _("Errors") + '</span>');
332 var StrAlert = AreMandatoriesNotOk();
337 $("#check_errors").html( StrAlert );
338 $('html, body').animate({ scrollTop: 0 }, 'fast');
339 Sticky.hcSticky('refresh');
344 function AddField(field,cntrepeatfield) {
345 document.forms['f'].op.value = "addfield";
346 document.forms['f'].addfield_field.value=field;
347 document.forms['f'].repeat_field.value=cntrepeatfield;
351 function addauthority() {
352 X = document.forms[0].authtype.value;
353 window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
355 function searchauthority() {
356 X = document.forms[0].authtype2.value;
357 Y = document.forms[0].value.value;
358 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";
360 function confirmnotdup(redirect){
361 $("#confirm_not_duplicate").attr("value","1");
364 /* Wrap a value in HTML without putting HTML in translatable string */
365 function formatFieldName( string ){
366 return "<strong><em>" + string + "</em></strong>";
369 $(document).ready(function(){
370 $('body').on('click','.expandfield',ExpandField);
373 [% Asset.css("css/addbiblio.css") | $raw %]
376 <body id="auth_authorities" class="auth">
379 <div>Loading, please wait...</div>
382 [% INCLUDE 'header.inc' %]
384 [% WRAPPER 'sub-header.inc' %]
385 [% WRAPPER breadcrumbs %]
386 [% WRAPPER breadcrumb_item %]
387 <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
391 [% WRAPPER breadcrumb_item bc_active= 1 %]
392 <span>Modify authority #[% authid | html %] ([% authtypetext | html %])</span>
396 [% WRAPPER breadcrumb_item bc_active= 1 %]
397 <span>Adding authority [% authtypetext | html %]</span>
401 [% END #/ WRAPPER breadcrumbs %]
402 [% END #/ WRAPPER sub-header.inc %]
404 <div class="main container-fluid">
406 <div class="col-md-10 col-md-offset-1">
409 <h1>Modify authority #[% authid | html %] [% authtypetext | html %]</h1>
411 <h1>Adding authority [% authtypetext | html %]</h1>
414 <div id="check_errors"></div>
416 [% IF ( duplicateauthid ) %]
417 <div class="dialog alert">
418 <h3>Duplicate record suspected</h3>
419 <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>
421 <form action="authorities.pl" method="get">
422 <input type="hidden" name="authid" value="[% duplicateauthid | html %]" />
423 <button type="submit" class="new"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Yes: Edit existing authority</button>
425 <form action="authorities.pl" method="get">
426 <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
429 [% END # /IF duplicateauthid %]
431 <form method="post" id="f" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
432 <input type="hidden" name="op" value="add" />
433 <input type="hidden" name="addfield_field" value="" />
434 <input type="hidden" name="repeat_field" value="" />
435 <input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />
436 <input type="hidden" name="authid" value="[% authid | html %]" />
437 <input type="hidden" name="index" value="[% index | html %]" />
438 <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
439 <input type="hidden" name="changed_authtype" value="" />
441 <div id="toolbar" class="btn-toolbar">
442 <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
443 <div class="btn-group">
445 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a>
447 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
450 <div class="btn-group">
451 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
452 <ul id="settings-menu" class="dropdown-menu">
453 <li class="dropdown-header">Change authority type</li>
455 <a href="#" class="change-authtype" data-authtypecode="">
456 [% IF ( authtypecode ) %]
457 <i class="fa fa-fw"> </i>
459 <i class="fa fa-fw fa-check"></i>
464 [% FOREACH authority_type IN authority_types %]
466 <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]">
467 [% IF authority_type.authtypecode == authtypecode %]
468 <i class="fa fa-fw fa-check"></i>
470 <i class="fa fa-fw"> </i>
472 [% authority_type.authtypetext | html %]
476 </ul> <!-- /#settings-menu -->
477 </div> <!-- /.btn-group -->
478 <div class="btn-group">
480 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
482 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
485 <div id="show-errors" class="btn-group"></div>
486 <div class="toolbar-tabs-container">
487 [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
488 [% WRAPPER tabs_nav %]
489 [%- FOREACH BIG_LOO IN BIG_LOOP -%]
491 [% SET bt_active = 1 %]
493 [% SET bt_active = 0 %]
495 [% WRAPPER tab_item tabname= "tab${BIG_LOO.number}XX" bt_active= bt_active %]
496 <span>[% BIG_LOO.number | html %]</span>
499 [% END # /WRAPPER tabs_nav %]
501 <ul class="tag_anchors_list">
502 [% FOREACH BIG_LOO IN BIG_LOOP %]
503 [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
504 [% FOREACH innerloo IN BIG_LOO.innerloop %]
505 [% IF ( innerloo.tag ) %]
506 <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
507 <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>
514 </div> <!-- /#toolbar -->
517 Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&q=an:[% authid | uri %]">[% count | html %] record(s)</a>
519 This authority is not used in any records.
523 [% WRAPPER tabs id= "authoritytabs" %]
524 [% WRAPPER tab_panels %]
525 [% FOREACH BIG_LOO IN BIG_LOOP %]
527 [% SET bt_active = 1 %]
529 [% SET bt_active = 0 %]
531 [% WRAPPER tab_panel tabname="tab${BIG_LOO.number}XX" bt_active= bt_active %]
532 [% IF ( BIG_LOOP.size > 1 ) %]
533 <h2>Section [% BIG_LOO.number | html %]</h2>
536 [% FOREACH innerloo IN BIG_LOO.innerloop %]
537 [% IF ( innerloo.tag ) %]
538 [% IF innerloo.tag != previous %]
539 [% IF previous != "" %]
542 [% previous = innerloo.tag %]
543 [% IF ( innerloo.repeatable ) %]
544 <ul class="sortable_field">
550 [% IF ( innerloo.repeatable ) %]
551 <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
553 <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
556 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
557 [% UNLESS hide_marc %]
558 [% IF advancedMARCEditor %]
559 <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>
561 <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
563 [% IF ( innerloo.fixedfield ) %]
566 class="indicator flat"
567 style="display:none;"
568 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
571 value="[% innerloo.indicator1 | html %]" />
574 class="indicator flat"
575 style="display:none;"
576 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
579 value="[% innerloo.indicator2 | html %]" />
583 class="indicator flat"
584 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
587 value="[% innerloo.indicator1 | html %]" />
590 class="indicator flat"
591 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
594 value="[% innerloo.indicator2 | html %]" />
595 [% END # /IF ( innerloo.fixedfield ) %] -
597 [% IF ( innerloo.fixedfield ) %]
600 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
601 value="[% innerloo.indicator1 | html %]" />
604 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
605 value="[% innerloo.indicator2 | html %]" />
609 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
610 value="[% innerloo.indicator1 | html %]" />
613 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
614 value="[% innerloo.indicator2 | html %]" />
615 [% END # /IF ( innerloo.fixedfield ) %]
616 [% END # /UNLESS hide_marc %]
618 [% UNLESS advancedMARCEditor %]
619 <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>
621 <span class="field_controls">
622 [% IF ( innerloo.repeatable ) %]
623 <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">
624 <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this tag" />
627 <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this tag">
628 <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this tag" />
630 </span> <!-- /.field_controls -->
631 </div> <!-- /div.tag_title -->
633 <ul class="sortable_subfield">
634 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
635 <!-- One line on the marc editor -->
636 <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
638 [% UNLESS hide_marc %]
639 <div class="subfieldcode">
641 title="[% subfield_loo.marc_lib | $raw %]"
642 style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
643 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
644 value="[% subfield_loo.subfield | html %]"
652 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
653 value="[% subfield_loo.subfield | html %]" />
654 [% END # /UNLESS hide_marc %]
656 [% UNLESS advancedMARCEditor %]
657 [% IF ( subfield_loo.mandatory ) %]
658 <div class="subfield subfield_mandatory">
660 <div class="subfield">
662 [% IF ( subfield_loo.fixedfield ) %]
663 <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">
665 <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
667 [% subfield_loo.marc_lib | $raw %]
669 </div> <!-- /.subfield -->
670 [% END # UNLESS advancedMARCEditor %]
672 [% SET mv = subfield_loo.marc_value %]
673 <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
674 [% IF ( mv.type == 'select' ) %]
675 [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
676 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
678 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
680 [% FOREACH aval IN mv.values %]
681 [% IF aval == mv.default %]
682 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
684 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
688 [% ELSIF ( mv.type == 'text1' ) %]
689 <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" />
690 [% ELSIF ( mv.type == 'text2' ) %]
691 <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" />
692 [% ELSIF ( mv.type == 'text' ) %]
693 <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 -%]" />
694 [% ELSIF ( mv.type == 'textarea' ) %]
695 <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>
696 [% ELSIF ( mv.type == 'hidden' ) %]
697 <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
698 [% ELSIF ( mv.type == 'hidden_simple' ) %]
699 <input type="hidden" name="[%- mv.name | html -%]" />
700 [% END # /IF mv.type %]
701 </div> <!-- /.field_marceditor -->
703 [% IF ( subfield_loo.mandatory ) %]
704 <div class="subfield_loop_mandatory">
705 <span class="required">Required</span>
709 <div class="subfield_controls">
710 [% IF ( mv.type == 'text1' ) %]
711 <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>
712 [% ELSIF ( mv.type == 'text2' ) %]
714 <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
716 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a>
718 [% mv.javascript | $raw %]
719 [% END #/IF ( mv.type == 'text1' ) %]
720 [% IF ( subfield_loo.repeatable ) %]
721 <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;">
722 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
724 <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
725 <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
727 [% END # /IF ( subfield_loo.repeatable ) %]
728 </div> <!-- /.subfield_controls -->
729 </li> <!-- /.subfield_line -->
730 [% END # /FOREACH subfield_loo %]
731 </ul> <!-- /.sortable_subfield -->
733 [% END # /IF ( innerloo.tag ) %]
734 [% END # /FOREACH innerloo %]
735 </ul> <!-- /.sortable_field -->
736 [% END # /tab_panel#tabXXX %]
737 [% END #/FOREACH BIG_LOO %]
738 [% END # /WRAPPER tab_panels %]
739 [% END # /WRAPPER tabs %]
741 <div name="hidden" id="hidden" class="tab">
742 [% FOREACH hidden_loo IN hidden_loop %]
743 <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" />
744 <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" />
745 <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" />
746 <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" />
747 <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" />
749 </div> <!-- /.tab -->
750 [% IF ( oldauthnumtagfield ) %]
751 <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" />
752 <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" />
753 <input type="hidden" name="field_value" value="[% authid | html %]" />
754 <input type="hidden" name="mandatory" value="0" />
755 <input type="hidden" name="kohafield" value="[% kohafield | html %]" />
756 <input type="hidden" name="tag_mandatory" value="[% tag_mandatory | html %]" />
757 <input type="hidden" name="tag" value="[% oldauthtypetagfield | html %]" />
758 <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield | html %]" />
759 <input type="hidden" name="field_value" value="[% authtypecode | html %]" />
764 [% INCLUDE 'modals/cataloguing_create_av.inc' %]
770 [% INCLUDE 'intranet-bottom.inc' %]