Bug 30952: Fix style of some buttons
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / addbiblio.tt
index fb1652e..ddab667 100644 (file)
@@ -4,6 +4,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( biblionumber ) %]Editing [% title | html %] (Record number [% biblionumber | html %])[% ELSE %]Add MARC record[% END %] &rsaquo; Cataloging &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
 [% Asset.js("lib/hc-sticky.js") | $raw %]
 [% INCLUDE 'select2.inc' %]
 <script>
             $("#toolbar").hide();
         [% END %]
 
-        var $tabs = $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
-            $("#"+ui.panel.id+" input:eq(0)").focus();
+        $("a[data-toggle='tab']").on("shown.bs.tab", function (e) {
+            $( e.target.hash + " .input_marceditor:visible:eq(0)").focus();
         });
-        $( "ul.sortable_field", $tabs ).sortable({
+
+        /* On page load, check for location.hash in the page URL */
+        /* If present the location hash will be used to activate the correct tab */
+        var hash = location.hash;
+        var hashPieces = hash.split('?');
+        if( hashPieces[0] !== "" ){
+            selectTab( hashPieces[0] );
+            window.scrollTo( 0, 0 );
+        }
+
+        $( "ul.sortable_field", "#addbibliotabs" ).sortable({
             axis: "y",
             containment: $("#addbibliotabs")
         });
-        $( "ul.sortable_subfield", $tabs ).sortable({
+        $( "ul.sortable_subfield", "#addbibliotabs" ).sortable({
             axis: "y",
             containment: "parent"
         });
 
         [% IF tab %]
-            link = $("a[href='#[% tab | html %]']");
-            selectTab( link );
+            hash = "#[% tab | html %]";
+            selectTab( hash );
         [% END %]
 
         Sticky = $("#toolbar");
 
             if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
 
-            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } );
+            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
 
             var biblionumber = [% biblionumber || "null" | html %];
 
 
         $(".toolbar-tabs a").on("click",function(e){
             e.preventDefault();
-            selectTab( $(this ) );
+            selectTab( this.hash );
         });
 
         $(".tag_anchor").on("click", function(e){
     });
 
     function selectTab( tablink ){
+        let a = $("a[href='" + tablink + "']");
         $(".toolbar-tabs li").removeClass("selected");
-        tablink.parent().addClass("selected");
-        var tabid = tablink.data("tabid");
-        $('#addbibliotabs').selectTabByID("#tab" + tabid + "XX");
+        a.tab("show").parent().addClass("selected");
+        var tabid = a.data("tabid");
         $(".tag_anchors").removeClass("tab_selected").hide();
         $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
     }
@@ -508,11 +519,11 @@ function PopupMARCFieldDoc(field) {
     function toggleMARCdocLinks(flag){
         if( flag === true ){
             $(".marcdocs").show();
-            Cookies.set("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
+            Cookies.set("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: 'Lax'  });
             $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
         } else {
             $(".marcdocs").hide();
-            Cookies.set("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
+            Cookies.set("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: 'Lax'  });
             $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
         }
     }
@@ -521,12 +532,12 @@ function PopupMARCFieldDoc(field) {
         if( flag === true ){
             $(".tagnum").show();
             $(".subfieldcode").show();
-            Cookies.set("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
+            Cookies.set("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: 'Lax'  });
             $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
         } else {
             $(".tagnum").hide();
             $(".subfieldcode").hide();
-            Cookies.set("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
+            Cookies.set("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: 'Lax'  });
             $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
         }
     }
@@ -540,7 +551,7 @@ function PopupMARCFieldDoc(field) {
         var subfields = new Array();
         var tab = new Array();
         var label = new Array();
-        var flag=0;
+        var flag = false;
         var tabflag= new Array();
         var StrAlert = "<div id='form-errors' class='dialog alert list'>";
         var notFilledClass = "subfield_not_filled";
@@ -559,7 +570,7 @@ function PopupMARCFieldDoc(field) {
                     [% END %]
                 [% END %]
             [% END %]
-            StrAlert += "<h4>" + _("The following subfields aren't filled:") + "</h4>";
+            StrAlert += "<h4>" + _("The following mandatory subfields aren't filled:") + "</h4>";
         } else {
             [% FOREACH BIG_LOO IN BIG_LOOP %]
                 [% FOREACH innerloo IN BIG_LOO.innerloop %]
@@ -574,7 +585,7 @@ function PopupMARCFieldDoc(field) {
                     [% END %]
                 [% END %]
             [% END %]
-            StrAlert += "<h4>" + _("A few important fields are not filled:") + "</h4>";
+            StrAlert += "<h4>" + _("The following important subfields aren’t filled:") + "</h4>";
             notFilledClass = "important_subfield_not_filled";
         }
         StrAlert += "<ul>";
@@ -608,8 +619,8 @@ function PopupMARCFieldDoc(field) {
             if (tabflag[tagsubfieldid][0]==0){
                 var tag=tagsubfieldid.substr(0,3);
                 var subfield=tagsubfieldid.substr(3,1);
-                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>';
-                flag=1;
+                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>';
+                flag = true;
             }
         }
         StrAlert += "</ul>";
@@ -663,7 +674,7 @@ function PopupMARCFieldDoc(field) {
             }
 
             if(isempty){
-                flag = 1;
+                flag = true;
                 if (mandatory) {
                     mandatoryFields[ arr[0] ] = {
                         importance: "mandatory",
@@ -686,16 +697,16 @@ function PopupMARCFieldDoc(field) {
             StrAlert += "<ul>";
             for( var prop in mandatoryFields ){
                 if( mandatoryFields[prop]["importance"] == "mandatory" ){
-                    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>';
+                    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>';
                 } else {
-                    StrAlert += "<li>" + _("Field %s is important, at least one of its subfields must be filled.").format(arr[0]) + ' <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>';
+                    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>';
                 }
             }
             StrAlert += "</ul>";
         }
         StrAlert += "</div>";
-        if(flag){
-            $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa fa-warning"></i> Errors</span>');
+        if ( flag ) {
+            $("#show-errors").html('<button type="button" class="btn btn-danger show-errors"><i class="fa fa-warning"></i> ' + _("Errors") + '</span>');
             return StrAlert;
         } else {
             return flag;
@@ -703,27 +714,36 @@ function PopupMARCFieldDoc(field) {
     }
 
     /**
-     *
-     *
+     * Run checks for mandatory and important fields
+     * Output errors if necessary, or submit the form
      */
     function Check(){
         var StrAlert = AreFieldsNotOk();
-        if( ! StrAlert ){
-            var StrWarning = AreFieldsNotOk(false);
-            if (StrWarning){
-                StrWarning += "\n" + _("Are you sure you want to save?");
-                var r=confirm(StrWarning);
-                if (! r){
-                    return false;
-                }
+        var StrWarning = AreFieldsNotOk( false );
+        if( !StrAlert && StrWarning ){
+            // Check important fields
+            $("#check_errors").html( StrWarning );
+            $('html, body').animate({ scrollTop: 0 }, 'fast');
+
+            var r=confirm( _("Important fields(s) are not filled. Are you sure you want to save?" ) );
+            if (! r){
+                return false;
+            } else {
+                document.f.submit();
+                return true;
             }
-            document.f.submit();
-            return true;
-        } else {
-            $("#check_errors").html( StrAlert );
+        } else if( StrAlert ){
+            var strAll = StrAlert;
+            if( StrWarning ){
+                strAll += StrWarning;
+            }
+            $("#check_errors").html( strAll );
             $('html, body').animate({ scrollTop: 0 }, 'fast');
             Sticky.hcSticky('refresh');
             return false;
+        } else if( !StrAlert && !StrWarning ){
+            document.f.submit();
+            return true;
         }
     }
 
@@ -857,12 +877,12 @@ function PopupMARCFieldDoc(field) {
                     [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
                         [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
                             <!-- Action is under fast cataloging - Save button redirecting to items -->
-                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-default"><i class="fa fa-save"></i> Save</a></div>
+                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
                         [% ELSE %]
                             <!-- Not using fast cataloging - Display split menu -->
                             <div class="btn-group">
-                                <button class="btn btn-default" id="saverecord"><i class="fa fa-save"></i> Save</button>
-                                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+                                <button class="btn btn-primary" id="saverecord"><i class="fa fa-save"></i> Save</button>
+                                <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                                 <span class="caret"></span>
                                 </button>
                                 <ul class="dropdown-menu">
@@ -928,40 +948,26 @@ function PopupMARCFieldDoc(field) {
                     </div> <!-- /.btn-group -->
                     [% UNLESS (circborrowernumber) %][%# Hide in fast cataloging %]
                         [% IF (biblionumber) %]
-                            [% IF ( BiblioDefaultViewmarc ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSIF ( BiblioDefaultViewisbd ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSE %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% END %]
+                            <div class="btn-group">
+                                <a href="[% PROCESS biblio_a_href biblionumber => biblionumber %]" class="btn btn-link" id="cancel">Cancel</a>
+                            </div>
                         [% ELSE %]
                             <div class="btn-group">
-                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/cataloguing/addbooks.pl">Cancel</a>
+                                <a class="btn btn-link" id="cancel" href="/cgi-bin/koha/cataloguing/addbooks.pl">Cancel</a>
                             </div>
                         [% END %]
                         <div id="show-errors" class="btn-group"></div>
                     [% END # /UNLESS circborrowernumber %]
                     <div class="toolbar-tabs-container">
                         [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
-                            <ul class="toolbar-tabs">
+                            <ul class="toolbar-tabs" role="tablist">
                                 [%- FOREACH BIG_LOO IN BIG_LOOP -%]
                                     [% IF loop.first %]
-                                        <li class="selected">
+                                        <li role="presentation" class="active selected">
                                     [% ELSE %]
-                                        <li>
+                                        <li role="presentation">
                                     [% END %]
-                                        <a data-tabid="[% BIG_LOO.number | html %]" href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a>
+                                        <a data-tabid="[% BIG_LOO.number | html %]" href="#tab[% BIG_LOO.number | html %]XX" aria-controls="#tab[% BIG_LOO.number | html %]XX" role="tab" data-toggle="tab">[% BIG_LOO.number | html %]</a>
                                     </li>
                                 [%- END -%]
                             </ul>
@@ -999,205 +1005,206 @@ function PopupMARCFieldDoc(field) {
                 <input type="hidden" name="changed_framework" value="" />
 
                 <div id="addbibliotabs" class="toptabs numbered">
-                    <ul>
-                        [% FOREACH BIG_LOO IN BIG_LOOP %]
-                            <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li>
-                        [% END %]
-                    </ul>
-
-                    [% FOREACH BIG_LOO IN BIG_LOOP %]
-                        <div id="tab[% BIG_LOO.number | html %]XX">
+                    <div class="tab-content">
 
-                            [% IF ( BIG_LOOP.size > 1 ) %]
-                                <h3>Section [% BIG_LOO.number | html %]</h3>
+                        [% FOREACH BIG_LOO IN BIG_LOOP %]
+                            [% IF loop.first %]
+                                <div id="tab[% BIG_LOO.number | html %]XX" role="tabpanel" class="tab-pane active">
+                            [% ELSE %]
+                                <div id="tab[% BIG_LOO.number | html %]XX" role="tabpanel" class="tab-pane">
                             [% END %]
-                            [% previous = "" %]
-                            [% FOREACH innerloo IN BIG_LOO.innerloop %]
-                                [% IF ( innerloo.tag ) %]
-                                [% IF innerloo.tag != previous %]
-                                    [% IF previous != "" %]
-                                        </ul>
-                                    [% END %]
-                                    [% previous = innerloo.tag %]
-                                    [% IF ( innerloo.repeatable ) %]
-                                        <ul class="sortable_field">
-                                    [% ELSE %]
-                                        <ul>
-                                    [% END %]
+
+                                [% IF ( BIG_LOOP.size > 1 ) %]
+                                    <h3>Section [% BIG_LOO.number | html %]</h3>
                                 [% END %]
-                                    [% IF ( innerloo.repeatable ) %]
-                                        <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
-                                    [% ELSE %]
-                                        <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
+                                [% previous = "" %]
+                                [% FOREACH innerloo IN BIG_LOO.innerloop %]
+                                    [% IF ( innerloo.tag ) %]
+                                    [% IF innerloo.tag != previous %]
+                                        [% IF previous != "" %]
+                                            </ul>
+                                        [% END %]
+                                        [% previous = innerloo.tag %]
+                                        [% IF ( innerloo.repeatable ) %]
+                                            <ul class="sortable_field">
+                                        [% ELSE %]
+                                            <ul>
+                                        [% END %]
                                     [% END %]
-                                        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
-                                            [% IF advancedMARCEditor %]
-                                                <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>
-                                            [% ELSE %]
-                                                <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
-                                                <a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>
-                                            [% END %]
-
-                                            [% IF ( innerloo.fixedfield ) %]
-                                                <input type="text"
-                                                    tabindex="1"
-                                                    class="indicator flat"
-                                                    style="display:none;"
-                                                    name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
-                                                    size="1"
-                                                    maxlength="1"
-                                                    value="[% innerloo.indicator1 | html %]" />
-                                                <input type="text"
-                                                    tabindex="1"
-                                                    class="indicator flat"
-                                                    style="display:none;"
-                                                    name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
-                                                    size="1"
-                                                    maxlength="1"
-                                                    value="[% innerloo.indicator2 | html %]" />
-                                            [% ELSE %]
-                                                <input type="text"
-                                                    tabindex="1"
-                                                    class="indicator flat"
-                                                    name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
-                                                    size="1"
-                                                    maxlength="1"
-                                                    value="[% innerloo.indicator1 | html %]" />
-                                                <input type="text"
-                                                    tabindex="1"
-                                                    class="indicator flat"
-                                                    name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
-                                                    size="1"
-                                                    maxlength="1"
-                                                    value="[% innerloo.indicator2 | html %]" />
-                                            [% END # /IF innerloo.fixedfield %] -
-
-                                            [% UNLESS advancedMARCEditor %]
-                                                <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>
-                                            [% END %]
-
-                                            <span class="field_controls">
-                                                [% IF ( innerloo.repeatable ) %]
-                                                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag">
-                                                        <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
-                                                    </a>
+                                        [% IF ( innerloo.repeatable ) %]
+                                            <li class="tag sortable_tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
+                                        [% ELSE %]
+                                            <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
+                                        [% END %]
+                                            <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
+                                                [% IF advancedMARCEditor %]
+                                                    <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>
+                                                [% ELSE %]
+                                                    <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
+                                                    <a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>
                                                 [% END %]
-                                                <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
-                                                    <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
-                                                </a>
-                                            </span> <!-- /.field_controls -->
-                                        </div> <!-- /div.tag_title -->
-
-                                        <ul class="sortable_subfield">
-                                        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
-                                            <!--  One line on the marc editor -->
-                                            <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
-                                                <div class="subfieldcode">
+
+                                                [% IF ( innerloo.fixedfield ) %]
                                                     <input type="text"
-                                                            title="[% subfield_loo.marc_lib | $raw %]"
-                                                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
-                                                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
-                                                            value="[% subfield_loo.subfield | html %]"
-                                                            size="1"
-                                                            maxlength="1"
-                                                            class="flat"
-                                                            tabindex="0" />
-                                                </div>
+                                                        tabindex="1"
+                                                        class="indicator flat"
+                                                        style="display:none;"
+                                                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
+                                                        size="1"
+                                                        maxlength="1"
+                                                        value="[% innerloo.indicator1 | html %]" />
+                                                    <input type="text"
+                                                        tabindex="1"
+                                                        class="indicator flat"
+                                                        style="display:none;"
+                                                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
+                                                        size="1"
+                                                        maxlength="1"
+                                                        value="[% innerloo.indicator2 | html %]" />
+                                                [% ELSE %]
+                                                    <input type="text"
+                                                        tabindex="1"
+                                                        class="indicator flat"
+                                                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
+                                                        size="1"
+                                                        maxlength="1"
+                                                        value="[% innerloo.indicator1 | html %]" />
+                                                    <input type="text"
+                                                        tabindex="1"
+                                                        class="indicator flat"
+                                                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
+                                                        size="1"
+                                                        maxlength="1"
+                                                        value="[% innerloo.indicator2 | html %]" />
+                                                [% END # /IF innerloo.fixedfield %] -
+
                                                 [% UNLESS advancedMARCEditor %]
-                                                    [% IF ( subfield_loo.mandatory ) %]
-                                                        <div class="subfield subfield_mandatory">
-                                                    [% ELSIF ( subfield_loo.important ) %]
-                                                        <div class="subfield subfield_important">
-                                                    [% ELSE %]
-                                                        <div class="subfield">
-                                                    [% END %]
-                                                        [% IF ( subfield_loo.fixedfield ) %]
-                                                            <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">
-                                                        [% ELSE %]
-                                                            <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
-                                                        [% END %]
-                                                        [% subfield_loo.marc_lib | $raw %]
-                                                        </label>
-                                                    </div>
+                                                    <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>
                                                 [% END %]
 
-                                                [% SET mv = subfield_loo.marc_value %]
-                                                <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
-                                                    [% IF ( mv.type == 'text' ) %]
-                                                        [% IF ( mv.readonly == 1 ) %]
-                                                            <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" />
+                                                <span class="field_controls">
+                                                    [% IF ( innerloo.repeatable ) %]
+                                                        <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag">
+                                                            <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
+                                                        </a>
+                                                    [% END %]
+                                                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
+                                                        <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
+                                                    </a>
+                                                </span> <!-- /.field_controls -->
+                                            </div> <!-- /div.tag_title -->
+
+                                            <ul class="sortable_subfield">
+                                            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
+                                                <!--  One line on the marc editor -->
+                                                <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
+                                                    <div class="subfieldcode">
+                                                        <input type="text"
+                                                                title="[% subfield_loo.marc_lib | $raw %]"
+                                                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
+                                                                name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
+                                                                value="[% subfield_loo.subfield | html %]"
+                                                                size="1"
+                                                                maxlength="1"
+                                                                class="flat"
+                                                                tabindex="0" />
+                                                    </div>
+                                                    [% UNLESS advancedMARCEditor %]
+                                                        [% IF ( subfield_loo.mandatory ) %]
+                                                            <div class="subfield subfield_mandatory">
+                                                        [% ELSIF ( subfield_loo.important ) %]
+                                                            <div class="subfield subfield_important">
                                                         [% ELSE %]
-                                                            <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
+                                                            <div class="subfield">
                                                         [% END %]
-
-                                                    [% ELSIF ( mv.type == 'text_complex' ) %]
-                                                        <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
-                                                        [% mv.javascript | $raw %]
-                                                    [% ELSIF ( mv.type == 'hidden' ) %]
-                                                        <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
-                                                    [% ELSIF ( mv.type == 'textarea' ) %]
-                                                        <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
-                                                    [% ELSIF ( mv.type == 'select' ) %]
-                                                    [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
-                                                        <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
-                                                    [% ELSE %]
-                                                        <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
+                                                            [% IF ( subfield_loo.fixedfield ) %]
+                                                                <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">
+                                                            [% ELSE %]
+                                                                <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
+                                                            [% END %]
+                                                            [% subfield_loo.marc_lib | $raw %]
+                                                            </label>
+                                                        </div>
                                                     [% END %]
-                                                        [% FOREACH aval IN mv.values %]
-                                                            [% IF aval == mv.default %]
-                                                            <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
+
+                                                    [% SET mv = subfield_loo.marc_value %]
+                                                    <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
+                                                        [% IF ( mv.type == 'text' ) %]
+                                                            [% IF ( mv.readonly == 1 ) %]
+                                                                <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" />
                                                             [% ELSE %]
-                                                            <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
+                                                                <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
                                                             [% END %]
+
+                                                        [% ELSIF ( mv.type == 'text_complex' ) %]
+                                                            <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
+                                                            [% mv.javascript | $raw %]
+                                                        [% ELSIF ( mv.type == 'hidden' ) %]
+                                                            <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
+                                                        [% ELSIF ( mv.type == 'textarea' ) %]
+                                                            <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
+                                                        [% ELSIF ( mv.type == 'select' ) %]
+                                                        [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
+                                                            <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
+                                                        [% ELSE %]
+                                                            <select name="[%- mv.name | html -%]" tabindex="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
                                                         [% END %]
-                                                        </select>
-                                                    [% END  # /IF (mv.type...) %]
-                                                </div>
-                                                [% IF ( subfield_loo.mandatory ) %]
-                                                    <div class="subfield_loop_mandatory">
-                                                        <span class="required">Required</span>
-                                                    </div>
-                                                [% ELSIF ( subfield_loo.important ) %]
-                                                    <div class="subfield_loop_mandatory">
-                                                        <span class="important">Important</span>
-                                                    </div>
-                                                [% END %]
-                                                <div class="subfield_controls">
-                                                    [% IF ( mv.type == 'text' ) %]
-                                                        [% IF ( mv.authtype ) %]
-                                                            <a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','biblio'); return false;" tabindex="1" title="Tag editor">Tag editor</a>
-                                                        [% END %]
-                                                    [% ELSIF ( mv.type == 'text_complex' ) %]
-                                                            [% IF mv.noclick %]
-                                                                <span class="buttonDot tag_editor disabled" tabindex="-1" title="Field autofilled by plugin"></span>
-                                                            [% ELSE %]
-                                                                [% IF mv.plugin == "upload.pl" %]
-                                                                    <a href="#" id="buttonDot_[% mv.id | html %]" class="tag_editor upload framework_plugin" tabindex="1"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
+                                                            [% FOREACH aval IN mv.values %]
+                                                                [% IF aval == mv.default %]
+                                                                <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
                                                                 [% ELSE %]
-                                                                    <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
+                                                                <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
                                                                 [% END %]
                                                             [% END %]
-                                                        </span>
-                                                    [% END %]
-                                                    [% IF ( subfield_loo.repeatable ) %]
-                                                        <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;">
-                                                            <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
-                                                        </a>
-                                                        <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
-                                                            <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
-                                                        </a>
+                                                            </select>
+                                                        [% END  # /IF (mv.type...) %]
+                                                    </div>
+                                                    [% IF ( subfield_loo.mandatory ) %]
+                                                        <div class="subfield_loop_mandatory">
+                                                            <span class="required">Required</span>
+                                                        </div>
+                                                    [% ELSIF ( subfield_loo.important ) %]
+                                                        <div class="subfield_loop_mandatory">
+                                                            <span class="important">Important</span>
+                                                        </div>
                                                     [% END %]
-                                                </div>
-                                            </li> <!-- /.subfield_line -->
-                                            <!-- End of the line -->
-                                        [% END # /FOREACH subfield_loop %]
-                                        </ul> <!--  /.sortable_subfield -->
-                                    </li> <!-- /.tag.clearfix -->
-                                [% END %]<!-- if innerloo.tag -->
-                            [% END # /FOREACH BIG_LOO.innerloop %]
-                            </ul> <!--  /.sortable_field -->
-                        </div> <!-- /#tabXXX -->
-                    [% END # /FOREACH BIG_LOOP %]
+                                                    <div class="subfield_controls">
+                                                        [% IF ( mv.type == 'text' ) %]
+                                                            [% IF ( mv.authtype ) %]
+                                                                <a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','biblio'); return false;" tabindex="1" title="Tag editor">Tag editor</a>
+                                                            [% END %]
+                                                        [% ELSIF ( mv.type == 'text_complex' ) %]
+                                                                [% IF mv.noclick %]
+                                                                    <span class="buttonDot tag_editor disabled" tabindex="-1" title="Field autofilled by plugin"></span>
+                                                                [% ELSE %]
+                                                                    [% IF mv.plugin == "upload.pl" %]
+                                                                        <a href="#" id="buttonDot_[% mv.id | html %]" class="tag_editor upload framework_plugin" tabindex="1"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
+                                                                    [% ELSE %]
+                                                                        <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
+                                                                    [% END %]
+                                                                [% END %]
+                                                            </span>
+                                                        [% END %]
+                                                        [% IF ( subfield_loo.repeatable ) %]
+                                                            <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;">
+                                                                <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                                                            </a>
+                                                            <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
+                                                                <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
+                                                            </a>
+                                                        [% END %]
+                                                    </div>
+                                                </li> <!-- /.subfield_line -->
+                                                <!-- End of the line -->
+                                            [% END # /FOREACH subfield_loop %]
+                                            </ul> <!--  /.sortable_subfield -->
+                                        </li> <!-- /.tag.clearfix -->
+                                    [% END %]<!-- if innerloo.tag -->
+                                [% END # /FOREACH BIG_LOO.innerloop %]
+                                </ul> <!--  /.sortable_field -->
+                            </div> <!-- /#tabXXX -->
+                        [% END # /FOREACH BIG_LOOP %]
+                    </div> <!-- /.tab-content -->
                 </div><!-- /#addbibliotabs -->
 
                 [%# Fields for fast cataloging %]