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 %]
8 [% INCLUDE 'select2.inc' %]
10 [% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
11 var auth_values_creation = 1;
13 var auth_values_creation = 0;
15 $.fn.select2.defaults.set("width", "100%" );
17 [% Asset.js("js/cataloging.js") | $raw %]
20 $(window).load(function(){
24 $(document).ready(function() {
26 $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
27 $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
30 /* On page load, check for location.hash in the page URL */
31 /* If present the location hash will be used to activate the correct tab */
32 var hash = location.hash;
33 var hashPieces = hash.split('?');
34 if( hashPieces[0] !== "" ){
35 selectTab( hashPieces[0] );
36 window.scrollTo( 0, 0 );
38 selectTab( "#tab0XX_panel" );
41 $( "ul.sortable_field", "#authoritytabs" ).sortable();
42 $( "ul.sortable_subfield", "#authoritytabs" ).sortable();
44 Sticky = $("#toolbar");
47 stickyClass: "floating"
50 $("#addauth").click(function(){
55 $("#z3950submit").click(function(){
56 var strQuery = GetZ3950Terms();
57 var index = "&index=[% index | html %]";
59 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');
64 $(".toolbar-tabs-container .nav-tabs a").on("click",function(e){
66 selectTab( this.hash );
69 $(".tag_anchor").on("click", function(e){
71 $(".tag_anchor").removeClass("selected");
72 $(this).addClass("selected");
74 var linkid = link.substring( link.indexOf("#") + 1 );
75 window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
78 $("body").on("click", ".linkfield", function(e){
80 var tab = $(this).data("tab");
81 var field = $(this).data("field");
82 var tablink = $("a[data-tabname='tab" + tab + "XX']" ).get(0).hash;
84 window.scrollTo( 0, getScrollto( field, "toolbar" ) );
87 $(".change-authtype").on("click", function(){
88 var authtypecode = $(this).data("authtypecode");
90 f.op.value = "[% op | html %]";
91 f.authid.value = "[% authid | html %]";
92 f.changed_authtype.value = "changed";
93 f.authtypecode.value = authtypecode;
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 $("body").on("click", ".show-errors", function(e){
107 document.getElementById("form-errors").scrollIntoView();
108 Sticky.hcSticky('refresh');
113 function selectTab( tablink ){
114 /* return if no tabs displayed (BIG_LOOP.size <= 1) */
115 if ($(".toolbar-tabs-container .nav-tabs li").length === 0){
118 let a = $("a[href='" + tablink + "']");
119 $(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
120 a.tab("show").parent().addClass("selected");
121 /* Get number from string like "tab9XX" */
122 var tabid = a.data("tabname").substring(3, 4);
123 $(".tag_anchors").removeClass("tab_selected").hide();
124 $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
128 * Returns a roughly ideal position to scroll an element into view
129 * @param {string} target - The HTML id of the element to scroll into view
130 * @param {string} elemid - The HTML id of the element which might obscure
131 * the view of the target element e.g. a floating toolbar
132 * @return {number} - The y-coordinate to pass to window.scrollTo()
134 function getScrollto( target, elemid ){
135 var dest = $("#" + target );
136 var yoffset = dest.offset();
139 var element = $("#" + elemid );
140 var elem_height = element.outerHeight();
144 return yoffset.top - elem_height - 20;
149 * check if z3950 mandatories are set or not
151 function GetZ3950Terms(){
152 var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
153 var mandatories = new Array();
154 var mandatories_label = new Array();
155 [% 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 %]");
156 mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %]
158 for(var i=0,len=mandatories.length; i<len ; i++){
159 var field_value = document.getElementById(mandatories[i]).value;
161 strQuery += "&"+mandatories_label[i]+"="+encodeURIComponent(field_value);
168 * check if mandatory subfields are written
170 function AreMandatoriesNotOk(){
171 var fields = new Array();
172 var subfields = new Array();
173 var tab = new Array();
174 var label = new Array();
176 var tabflag= new Array();
177 var StrAlert = "<div id='form-errors' class='dialog alert list'>";
178 var notFilledClass = "subfield_not_filled";
180 [% FOREACH BIG_LOO IN BIG_LOOP %]
181 [% FOREACH innerloo IN BIG_LOO.innerloop %]
182 [% IF ( innerloo.mandatory ) %]
183 fields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]", "[% BIG_LOO.number | html %]"));
185 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
186 [% IF ( subfield_loo.mandatory ) %]subfields.push("[% subfield_loo.id | html %]");
187 tab.push("[% BIG_LOO.number | html %]");
188 label.push("[% subfield_loo.marc_lib | $raw %]");
194 StrAlert += "<h4>" + _("The following mandatory subfields aren't filled:") + "</h4>";
197 for(var i=0,len=subfields.length; i<len ; i++){
198 var tag=subfields[i].substr(4,3);
199 var subfield=subfields[i].substr(17,1);
200 var tagnumber=subfields[i].substr(19,subfields[i].lastIndexOf("_")-19);
201 if (tabflag[tag+subfield+tagnumber] == null) {
202 tabflag[tag+subfield+tagnumber]=new Array();
203 tabflag[tag+subfield+tagnumber][0]=0;
205 if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(subfields[i]) != null && ! document.getElementById(subfields[i]).value || document.getElementById(subfields[i]) == null)){
206 tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
208 var elt = document.getElementById(subfields[i]);
209 if ( elt.nodeName == 'SELECT' ) {
210 $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass);
212 elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass);
214 $('#' + subfields[i]).focus();
215 tabflag[tag+subfield+tagnumber][1]=label[i];
216 tabflag[tag+subfield+tagnumber][2]=tab[i];
218 tabflag[tag+subfield+tagnumber][0] = 1;
220 tabflag[tag+subfield+tagnumber][3] = subfields[i];
223 for (var tagsubfieldid in tabflag){
224 if (tabflag[tagsubfieldid][0]==0){
225 var tag=tagsubfieldid.substr(0,3);
226 var subfield=tagsubfieldid.substr(3,1);
227 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>';
233 mandatoryFields = new Object();
235 /* Check for mandatories field(not subfields) */
236 for(var i=0,len=fields.length; i<len; i++){
239 divid = "tag_" + arr[0] + "_" + arr[1];
240 varegexp = new RegExp("^tag_" + arr[0] + "_code_");
242 if(parseInt(arr[0]) >= 10){
243 elem = document.getElementById(divid);
244 eleminputs = elem.getElementsByTagName('input');
246 for(var j=0,len2=eleminputs.length; j<len2; j++){
248 if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
249 inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
251 for( var k=0; k<len2; k++){
252 if( eleminputs[k].id.match(inputregexp) ){
253 if( eleminputs[k].value ){
259 elemselect = elem.getElementsByTagName('select');
260 for( var k=0; k<elemselect.length; k++){
261 if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
268 elemtextareas = elem.getElementsByTagName('textarea');
269 for(var j=0,len2=elemtextareas.length; j<len2; j++){
270 // this bit assumes that the only textareas in this context would be for subfields
271 if (elemtextareas[j].value) {
282 mandatoryFields[ arr[0] ] = {
283 importance: "mandatory",
284 elemid: "div_indicator_" + divid,
291 if( Object.entries(mandatoryFields).length > 0 ){
292 StrAlert += "<h4>" + _("The following fields aren't filled:") + "</h4>";
294 for( var prop in mandatoryFields ){
295 if( mandatoryFields[prop]["importance"] == "mandatory" ){
296 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>';
298 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>';
303 StrAlert += "</div>";
305 $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa-solid fa-triangle-exclamation"></i> ' + _("Errors") + '</span>');
313 var StrAlert = AreMandatoriesNotOk();
318 $("#check_errors").html( StrAlert );
319 $('html, body').animate({ scrollTop: 0 }, 'fast');
320 Sticky.hcSticky('refresh');
325 function AddField(field,cntrepeatfield) {
326 document.forms['f'].op.value = "addfield";
327 document.forms['f'].addfield_field.value=field;
328 document.forms['f'].repeat_field.value=cntrepeatfield;
332 function addauthority() {
333 X = document.forms[0].authtype.value;
334 window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
336 function searchauthority() {
337 X = document.forms[0].authtype2.value;
338 Y = document.forms[0].value.value;
339 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";
341 function confirmnotdup(redirect){
342 $("#confirm_not_duplicate").attr("value","1");
345 /* Wrap a value in HTML without putting HTML in translatable string */
346 function formatFieldName( string ){
347 return "<strong><em>" + string + "</em></strong>";
350 $(document).ready(function(){
351 $('body').on('click','.expandfield',ExpandField);
354 [% Asset.css("css/addbiblio.css") | $raw %]
357 <body id="auth_authorities" class="auth">
360 <div>Loading, please wait...</div>
363 [% INCLUDE 'header.inc' %]
365 [% WRAPPER 'sub-header.inc' %]
366 [% WRAPPER breadcrumbs %]
367 [% WRAPPER breadcrumb_item %]
368 <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
372 [% WRAPPER breadcrumb_item bc_active= 1 %]
373 <span>Modify authority #[% authid | html %] ([% authtypetext | html %])</span>
377 [% WRAPPER breadcrumb_item bc_active= 1 %]
378 <span>Adding authority [% authtypetext | html %]</span>
382 [% END #/ WRAPPER breadcrumbs %]
383 [% END #/ WRAPPER sub-header.inc %]
385 <div class="main container-fluid">
387 <div class="col-md-10 col-md-offset-1">
390 <h1>Modify authority #[% authid | html %] [% authtypetext | html %]</h1>
392 <h1>Adding authority [% authtypetext | html %]</h1>
395 <div id="check_errors"></div>
397 [% IF ( duplicateauthid ) %]
398 <div class="dialog alert">
399 <h3>Duplicate record suspected</h3>
400 <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>
402 <form action="authorities.pl" method="get">
403 <input type="hidden" name="authid" value="[% duplicateauthid | html %]" />
404 <button type="submit" class="new"><i class="fa fa-pencil"></i> Yes: Edit existing authority</button>
406 <form action="authorities.pl" method="get">
407 <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
410 [% END # /IF duplicateauthid %]
412 <form method="post" id="f" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
413 <input type="hidden" name="op" value="add" />
414 <input type="hidden" name="addfield_field" value="" />
415 <input type="hidden" name="repeat_field" value="" />
416 <input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />
417 <input type="hidden" name="authid" value="[% authid | html %]" />
418 <input type="hidden" name="index" value="[% index | html %]" />
419 <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
420 <input type="hidden" name="changed_authtype" value="" />
422 <div id="toolbar" class="btn-toolbar">
423 <div class="btn-group"><a href="#" id="addauth" class="btn btn-primary" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
424 <div class="btn-group">
426 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a>
428 <a class="btn btn-default" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
431 <div class="btn-group">
432 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
433 <ul id="settings-menu" class="dropdown-menu">
434 <li class="dropdown-header">Change authority type</li>
436 <a href="#" class="change-authtype" data-authtypecode="">
437 [% IF ( authtypecode ) %]
438 <i class="fa fa-fw"> </i>
440 <i class="fa fa-fw fa-check"></i>
445 [% FOREACH authority_type IN authority_types %]
447 <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]">
448 [% IF authority_type.authtypecode == authtypecode %]
449 <i class="fa fa-fw fa-check"></i>
451 <i class="fa fa-fw"> </i>
453 [% authority_type.authtypetext | html %]
457 </ul> <!-- /#settings-menu -->
458 </div> <!-- /.btn-group -->
459 <div class="btn-group">
461 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
463 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
466 <div id="show-errors" class="btn-group"></div>
467 <div class="toolbar-tabs-container">
468 [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
469 [% WRAPPER tabs_nav %]
470 [%- FOREACH BIG_LOO IN BIG_LOOP -%]
472 [% SET bt_active = 1 %]
474 [% SET bt_active = 0 %]
476 [% WRAPPER tab_item tabname= "tab${BIG_LOO.number}XX" bt_active= bt_active %]
477 <span>[% BIG_LOO.number | html %]</span>
480 [% END # /WRAPPER tabs_nav %]
482 <ul class="tag_anchors_list">
483 [% FOREACH BIG_LOO IN BIG_LOOP %]
484 [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
485 [% FOREACH innerloo IN BIG_LOO.innerloop %]
486 [% IF ( innerloo.tag ) %]
487 <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
488 <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>
495 </div> <!-- /#toolbar -->
498 Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&q=an:[% authid | uri %]">[% count | html %] record(s)</a>
500 This authority is not used in any records.
504 [% WRAPPER tabs id= "authoritytabs" %]
505 [% WRAPPER tab_panels %]
506 [% FOREACH BIG_LOO IN BIG_LOOP %]
508 [% SET bt_active = 1 %]
510 [% SET bt_active = 0 %]
512 [% WRAPPER tab_panel tabname="tab${BIG_LOO.number}XX" bt_active= bt_active %]
513 [% IF ( BIG_LOOP.size > 1 ) %]
514 <h2>Section [% BIG_LOO.number | html %]</h2>
517 [% FOREACH innerloo IN BIG_LOO.innerloop %]
518 [% IF ( innerloo.tag ) %]
519 [% IF innerloo.tag != previous %]
520 [% IF previous != "" %]
523 [% previous = innerloo.tag %]
524 [% IF ( innerloo.repeatable ) %]
525 <ul class="sortable_field">
531 [% IF ( innerloo.repeatable ) %]
532 <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
534 <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
537 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
538 [% UNLESS hide_marc %]
539 [% IF advancedMARCEditor %]
540 <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>
542 <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
544 [% IF ( innerloo.fixedfield ) %]
547 class="indicator flat"
548 style="display:none;"
549 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
552 value="[% innerloo.indicator1 | html %]" />
555 class="indicator flat"
556 style="display:none;"
557 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
560 value="[% innerloo.indicator2 | html %]" />
564 class="indicator flat"
565 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
568 value="[% innerloo.indicator1 | html %]" />
571 class="indicator flat"
572 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
575 value="[% innerloo.indicator2 | html %]" />
576 [% END # /IF ( innerloo.fixedfield ) %] -
578 [% IF ( innerloo.fixedfield ) %]
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 %]" />
590 name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
591 value="[% innerloo.indicator1 | html %]" />
594 name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
595 value="[% innerloo.indicator2 | html %]" />
596 [% END # /IF ( innerloo.fixedfield ) %]
597 [% END # /UNLESS hide_marc %]
599 [% UNLESS advancedMARCEditor %]
600 <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>
602 <span class="field_controls">
603 [% IF ( innerloo.repeatable ) %]
604 <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">
605 <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this tag" />
608 <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this tag">
609 <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this tag" />
611 </span> <!-- /.field_controls -->
612 </div> <!-- /div.tag_title -->
614 <ul class="sortable_subfield">
615 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
616 <!-- One line on the marc editor -->
617 <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
619 [% UNLESS hide_marc %]
620 <div class="subfieldcode">
622 title="[% subfield_loo.marc_lib | $raw %]"
623 style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
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 %]"
633 name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
634 value="[% subfield_loo.subfield | html %]" />
635 [% END # /UNLESS hide_marc %]
637 [% UNLESS advancedMARCEditor %]
638 [% IF ( subfield_loo.mandatory ) %]
639 <div class="subfield subfield_mandatory">
641 <div class="subfield">
643 [% IF ( subfield_loo.fixedfield ) %]
644 <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">
646 <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
648 [% subfield_loo.marc_lib | $raw %]
650 </div> <!-- /.subfield -->
651 [% END # UNLESS advancedMARCEditor %]
653 [% SET mv = subfield_loo.marc_value %]
654 <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
655 [% IF ( mv.type == 'select' ) %]
656 [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
657 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
659 <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
661 [% FOREACH aval IN mv.values %]
662 [% IF aval == mv.default %]
663 <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
665 <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
669 [% ELSIF ( mv.type == 'text1' ) %]
670 <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" />
671 [% ELSIF ( mv.type == 'text2' ) %]
672 <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" />
673 [% ELSIF ( mv.type == 'text' ) %]
674 <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 -%]" />
675 [% ELSIF ( mv.type == 'textarea' ) %]
676 <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>
677 [% ELSIF ( mv.type == 'hidden' ) %]
678 <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
679 [% ELSIF ( mv.type == 'hidden_simple' ) %]
680 <input type="hidden" name="[%- mv.name | html -%]" />
681 [% END # /IF mv.type %]
682 </div> <!-- /.field_marceditor -->
684 [% IF ( subfield_loo.mandatory ) %]
685 <div class="subfield_loop_mandatory">
686 <span class="required">Required</span>
690 <div class="subfield_controls">
691 [% IF ( mv.type == 'text1' ) %]
692 <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>
693 [% ELSIF ( mv.type == 'text2' ) %]
695 <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
697 <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor">...</a>
699 [% mv.javascript | $raw %]
700 [% END #/IF ( mv.type == 'text1' ) %]
701 [% IF ( subfield_loo.repeatable ) %]
702 <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;">
703 <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
705 <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
706 <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
708 [% END # /IF ( subfield_loo.repeatable ) %]
709 </div> <!-- /.subfield_controls -->
710 </li> <!-- /.subfield_line -->
711 [% END # /FOREACH subfield_loo %]
712 </ul> <!-- /.sortable_subfield -->
714 [% END # /IF ( innerloo.tag ) %]
715 [% END # /FOREACH innerloo %]
716 </ul> <!-- /.sortable_field -->
717 [% END # /tab_panel#tabXXX %]
718 [% END #/FOREACH BIG_LOO %]
719 [% END # /WRAPPER tab_panels %]
720 [% END # /WRAPPER tabs %]
722 <div name="hidden" id="hidden" class="tab">
723 [% FOREACH hidden_loo IN hidden_loop %]
724 <input type="hidden" name="tag" value="[% hidden_loo.tag | html %]" />
725 <input type="hidden" name="subfield" value="[% hidden_loo.subfield | html %]" />
726 <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory | html %]" />
727 <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield | html %]" />
728 <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory | html %]" />
730 </div> <!-- /.tab -->
731 [% IF ( oldauthnumtagfield ) %]
732 <input type="hidden" name="tag" value="[% oldauthnumtagfield | html %]" />
733 <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield | html %]" />
734 <input type="hidden" name="field_value" value="[% authid | html %]" />
735 <input type="hidden" name="mandatory" value="0" />
736 <input type="hidden" name="kohafield" value="[% kohafield | html %]" />
737 <input type="hidden" name="tag_mandatory" value="[% tag_mandatory | html %]" />
738 <input type="hidden" name="tag" value="[% oldauthtypetagfield | html %]" />
739 <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield | html %]" />
740 <input type="hidden" name="field_value" value="[% authtypecode | html %]" />
745 [% INCLUDE 'modals/cataloguing_create_av.inc' %]
751 [% INCLUDE 'intranet-bottom.inc' %]