View | Details | Raw Unified | Return to bug 7882
Collapse All | Expand All

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 511-517 sub build_tabs { Link Here
511
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
511
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
512
        my @loop_data = (); #innerloop in the template.
512
        my @loop_data = (); #innerloop in the template.
513
        my $i = 0;
513
        my $i = 0;
514
        foreach my $tag (@tab_data) {
514
        foreach my $tag (sort @tab_data) {
515
            $i++;
515
            $i++;
516
            next if ! $tag;
516
            next if ! $tag;
517
            my ($indicator1, $indicator2);
517
            my ($indicator1, $indicator2);
(-)a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css (-4 / +47 lines)
Lines 15-20 div#toolbar { Link Here
15
    margin: .3em 0;
15
    margin: .3em 0;
16
}
16
}
17
17
18
ul.sortable_field, ul.sortable_subfield {
19
    margin-bottom: 0;
20
    padding-left: 0;
21
}
22
23
ul li.tag, ul li.tag li.subfield_line {
24
    list-style-type: none;
25
    position: relative;
26
    padding-left: 30px;
27
}
28
29
ul li.tag:before, ul li.tag li.subfield_line:before {
30
    position: absolute;
31
    font-family: 'FontAwesome';
32
    font-size: .8em;
33
    top: 0;
34
    left: 10px;
35
    content: "\f047";
36
}
37
38
ul li.tag:before {
39
    padding-top: 1.7em;
40
}
41
42
li.ui-sortable-helper {
43
    background-color: #e0e0e0;
44
    max-height: 150px;
45
    padding: 2px;
46
    border-radius: 4px;
47
}
48
49
li.ui-sortable-helper ul li {
50
	display: none !important;
51
}
52
53
.sortable_subfield .ui-sortable-helper input.flat {
54
	background-color: transparent;
55
}
56
57
ul li.tag li.subfield_line.ui-sortable-helper::before {
58
    top: 5px;
59
}
60
18
.buttonPlus {
61
.buttonPlus {
19
	font-weight : bold;
62
	font-weight : bold;
20
	text-decoration : none;
63
	text-decoration : none;
Lines 44-57 a.expandfield { Link Here
44
    padding: .7em 0;
87
    padding: .7em 0;
45
}
88
}
46
89
47
div.subfield_line {
90
li.subfield_line {
48
    padding-bottom: .3em;
91
    padding-bottom: .3em;
49
    float: left;
92
    float: left;
50
    clear: left;
93
    clear: left;
51
    width: 100%;
94
    width: 100%;
52
}
95
}
53
96
54
div.subfield_line label {
97
li.subfield_line label {
55
    font-size:89%;
98
    font-size:89%;
56
    float: left;
99
    float: left;
57
	 padding-right : .4em;
100
	 padding-right : .4em;
Lines 262-268 tbody tr.active td { Link Here
262
}
305
}
263
306
264
@media (min-width: 768px) {
307
@media (min-width: 768px) {
265
    div.subfield_line label {
308
    li.subfield_line label {
266
        width: 20em;
309
        width: 20em;
267
    }
310
    }
268
311
Lines 276-282 tbody tr.active td { Link Here
276
}
319
}
277
320
278
@media (min-width: 1200px) {
321
@media (min-width: 1200px) {
279
    div.subfield_line label {
322
    li.subfield_line label {
280
        width: 25em;
323
        width: 25em;
281
    }
324
    }
282
325
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-10 / +18 lines)
Lines 12-18 Link Here
12
    });
12
    });
13
    var Sticky;
13
    var Sticky;
14
	 $(document).ready(function() {
14
	 $(document).ready(function() {
15
        $('#authoritytabs').tabs();
15
        var tabs = $('#authoritytabs').tabs();
16
        $( "ul.sortable_field", tabs ).sortable();
17
        $( "ul.sortable_subfield", tabs ).sortable();
16
        Sticky = $("#toolbar");
18
        Sticky = $("#toolbar");
17
        Sticky.hcSticky({
19
        Sticky.hcSticky({
18
            stickTo: ".main",
20
            stickTo: ".main",
Lines 235-243 function confirmnotdup(redirect){ Link Here
235
[% FOREACH BIG_LOO IN BIG_LOOP %]
237
[% FOREACH BIG_LOO IN BIG_LOOP %]
236
    <div id="tab[% BIG_LOO.number | html %]XX">
238
    <div id="tab[% BIG_LOO.number | html %]XX">
237
239
240
    [% previous = "" %]
238
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
241
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
239
    [% IF ( innerloo.tag ) %]
242
    [% IF ( innerloo.tag ) %]
240
    <div class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
243
    [% IF innerloo.tag != previous %]
244
        [% IF previous != "" %]
245
            </ul>
246
        [% END %]
247
        [% previous = innerloo.tag %]
248
        <ul class="sortable_field">
249
    [% END %]
250
    <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
241
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
251
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
242
        [% UNLESS hide_marc %]
252
        [% UNLESS hide_marc %]
243
            [% IF advancedMARCEditor %]
253
            [% IF advancedMARCEditor %]
Lines 316-324 function confirmnotdup(redirect){ Link Here
316
326
317
        </div>
327
        </div>
318
328
329
        <ul class="sortable_subfield">
319
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
330
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
320
            <!--  One line on the marc editor -->
331
            <!--  One line on the marc editor -->
321
            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
332
            <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
322
333
323
                [% UNLESS advancedMARCEditor %]
334
                [% UNLESS advancedMARCEditor %]
324
                    [% 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">
335
                    [% 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">
Lines 328-338 function confirmnotdup(redirect){ Link Here
328
                
339
                
329
                [% UNLESS hide_marc %]
340
                [% UNLESS hide_marc %]
330
                <span class="subfieldcode">
341
                <span class="subfieldcode">
331
                    [% IF ( subfield_loo.fixedfield ) %]
332
                        <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
333
                    [% ELSE %]
334
                        <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
335
                    [% END %]
336
                        <input type="text"
342
                        <input type="text"
337
                            title="[% subfield_loo.marc_lib | $raw %]"
343
                            title="[% subfield_loo.marc_lib | $raw %]"
338
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
344
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
Lines 400-411 function confirmnotdup(redirect){ Link Here
400
                [% END %]
406
                [% END %]
401
                </span>
407
                </span>
402
                
408
                
403
            </div>
409
            </li>
404
            <!-- End of the line -->
410
            <!-- End of the line -->
405
        [% END %]
411
        [% END %]
406
412
407
    </div>
413
        </ul> <!-- /.sortable_subfield -->
414
    </li>
408
    [% END %]<!-- if innerloo.tag -->
415
    [% END %]<!-- if innerloo.tag -->
416
    </ul> <!-- /.sortable_field -->
409
    [% END %]<!-- BIG_LOO.innerloop -->
417
    [% END %]<!-- BIG_LOO.innerloop -->
410
    </div>
418
    </div>
411
[% END %]<!-- BIG_LOOP -->
419
[% END %]<!-- BIG_LOOP -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-3 / +3 lines)
Lines 46-52 Link Here
46
            } catch(e) {
46
            } catch(e) {
47
                return;
47
                return;
48
            }
48
            }
49
            var field_start = whichfield.parentNode.parentNode;
49
            var field_start = whichfield.parentNode.parentNode.parentNode;
50
50
51
            // Sets the good number of form fields for the specified subfield
51
            // Sets the good number of form fields for the specified subfield
52
            // Returns false if the cloning failed
52
            // Returns false if the cloning failed
Lines 58-64 Link Here
58
58
59
                // Find the subfield we want to clone
59
                // Find the subfield we want to clone
60
                var re = new RegExp('^subfield' + subfield_name,'g');
60
                var re = new RegExp('^subfield' + subfield_name,'g');
61
                var subfields = $(field_start).children('div').filter( function() {
61
                var subfields = $(field_start).children('ul').children('li').filter( function() {
62
                    return this.id.match(re);
62
                    return this.id.match(re);
63
                });
63
                });
64
64
Lines 89-95 Link Here
89
89
90
                // Find the subfields where we will add the new values
90
                // Find the subfields where we will add the new values
91
                var re = new RegExp('^subfield' + subfield_name,'g');
91
                var re = new RegExp('^subfield' + subfield_name,'g');
92
                var subfields = $(field_start).children('div').filter( function() {
92
                var subfields = $(field_start).children('ul').children('li').filter( function() {
93
                    return this.id.match(re);
93
                    return this.id.match(re);
94
                });
94
                });
95
95
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-10 / +18 lines)
Lines 23-31 Link Here
23
            $("#toolbar").hide();
23
            $("#toolbar").hide();
24
        [% END %]
24
        [% END %]
25
25
26
        $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
26
        var $tabs = $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
27
            $("#"+ui.panel.id+" input:eq(0)").focus();
27
            $("#"+ui.panel.id+" input:eq(0)").focus();
28
        });
28
        });
29
        $( "ul.sortable_field", $tabs ).sortable();
30
        $( "ul.sortable_subfield", $tabs ).sortable();
29
31
30
        [% IF tab %]
32
        [% IF tab %]
31
            link = $("a[href='#[% tab | html %]']");
33
            link = $("a[href='#[% tab | html %]']");
Lines 659-667 Link Here
659
                            [% IF ( BIG_LOOP.size > 1 ) %]
661
                            [% IF ( BIG_LOOP.size > 1 ) %]
660
                                <h3>Section [% BIG_LOO.number | html %]</h3>
662
                                <h3>Section [% BIG_LOO.number | html %]</h3>
661
                            [% END %]
663
                            [% END %]
664
                            [% previous = "" %]
662
                            [% FOREACH innerloo IN BIG_LOO.innerloop %]
665
                            [% FOREACH innerloo IN BIG_LOO.innerloop %]
663
                                [% IF ( innerloo.tag ) %]
666
                                [% IF ( innerloo.tag ) %]
664
                                    <div class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
667
                                [% IF innerloo.tag != previous %]
668
                                    [% IF previous != "" %]
669
                                        </ul>
670
                                    [% END %]
671
                                    [% previous = innerloo.tag %]
672
                                    <ul class="sortable_field">
673
                                [% END %]
674
                                    <li class="tag clearfix" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
665
                                        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
675
                                        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
666
                                            [% IF advancedMARCEditor %]
676
                                            [% IF advancedMARCEditor %]
667
                                                <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>
677
                                                <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>
Lines 720-728 Link Here
720
                                            </span> <!-- /.field_controls -->
730
                                            </span> <!-- /.field_controls -->
721
                                        </div> <!-- /div.tag_title -->
731
                                        </div> <!-- /div.tag_title -->
722
732
733
                                        <ul class="sortable_subfield">
723
                                        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
734
                                        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
724
                                            <!--  One line on the marc editor -->
735
                                            <!--  One line on the marc editor -->
725
                                            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
736
                                            <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
726
                                                [% UNLESS advancedMARCEditor %]
737
                                                [% UNLESS advancedMARCEditor %]
727
                                                    [% IF ( subfield_loo.fixedfield ) %]
738
                                                    [% IF ( subfield_loo.fixedfield ) %]
728
                                                        <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">
739
                                                        <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">
Lines 732-742 Link Here
732
                                                [% END %]
743
                                                [% END %]
733
744
734
                                                    <span class="subfieldcode">
745
                                                    <span class="subfieldcode">
735
                                                        [% IF ( subfield_loo.fixedfield ) %]
736
                                                            <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
737
                                                        [% ELSE %]
738
                                                            <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
739
                                                        [% END %]
740
                                                            <input type="text"
746
                                                            <input type="text"
741
                                                                title="[% subfield_loo.marc_lib | $raw %]"
747
                                                                title="[% subfield_loo.marc_lib | $raw %]"
742
                                                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
748
                                                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
Lines 808-819 Link Here
808
                                                        </a>
814
                                                        </a>
809
                                                    [% END %]
815
                                                    [% END %]
810
                                                </span>
816
                                                </span>
811
                                            </div> <!-- /.subfield_line -->
817
                                            </li> <!-- /.subfield_line -->
812
                                            <!-- End of the line -->
818
                                            <!-- End of the line -->
813
                                        [% END # /FOREACH subfield_loop %]
819
                                        [% END # /FOREACH subfield_loop %]
814
                                    </div> <!-- /.tag.clearfix -->
820
                                        </ul> <!--  /.sortable_subfield -->
821
                                    </li> <!-- /.tag.clearfix -->
815
                                [% END %]<!-- if innerloo.tag -->
822
                                [% END %]<!-- if innerloo.tag -->
816
                            [% END # /FOREACH BIG_LOO.innerloop %]
823
                            [% END # /FOREACH BIG_LOO.innerloop %]
824
                            </ul> <!--  /.sortable_field -->
817
                        </div> <!-- /#tabXXX -->
825
                        </div> <!-- /#tabXXX -->
818
                    [% END # /FOREACH BIG_LOOP %]
826
                    [% END # /FOREACH BIG_LOOP %]
819
                </div><!-- /#addbibliotabs -->
827
                </div><!-- /#addbibliotabs -->
(-)a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js (-32 / +21 lines)
Lines 56-75 function openAuth(tagsubfieldid,authtype,source) { Link Here
56
}
56
}
57
57
58
function ExpandField(index) {
58
function ExpandField(index) {
59
    var original = document.getElementById(index); //original <div>
59
    var original = document.getElementById(index); //original <li>
60
    var divs = original.getElementsByTagName('div');
60
    var lis = original.getElementsByTagName('li');
61
    for(var i=0,divslen = divs.length ; i<divslen ; i++){   // foreach div
61
    for(var i=0,lislen = lis.length ; i<lislen ; i++){   // foreach li
62
        if(divs[i].hasAttribute('id') == 0 ) {continue; } // div element is specific to Select2
62
        if(lis[i].hasAttribute('id') == 0 ) {continue; } // li element is specific to Select2
63
        if(divs[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
63
        if(lis[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
64
            if (!divs[i].style.display) {
64
            if (!lis[i].style.display) {
65
                // first time => show all subfields
65
                // first time => show all subfields
66
                divs[i].style.display = 'block';
66
                lis[i].style.display = 'block';
67
            } else if (divs[i].style.display == 'none') {
67
            } else if (lis[i].style.display == 'none') {
68
                // show
68
                // show
69
                divs[i].style.display = 'block';
69
                lis[i].style.display = 'block';
70
            } else {
70
            } else {
71
                // hide
71
                // hide
72
                divs[i].style.display = 'none';
72
                lis[i].style.display = 'none';
73
            }
73
            }
74
        }
74
        }
75
    }
75
    }
Lines 101-116 var Select2Utils = { Link Here
101
 * @param advancedMARCEditor '0' for false, '1' for true
101
 * @param advancedMARCEditor '0' for false, '1' for true
102
 */
102
 */
103
function CloneField(index, hideMarc, advancedMARCEditor) {
103
function CloneField(index, hideMarc, advancedMARCEditor) {
104
    var original = document.getElementById(index); //original <div>
104
    var original = document.getElementById(index); //original <li>
105
    Select2Utils.removeSelect2(original);
105
    Select2Utils.removeSelect2(original);
106
106
107
    var clone = original.cloneNode(true);
107
    var clone = original.cloneNode(true);
108
    var new_key = CreateKey();
108
    var new_key = CreateKey();
109
    var new_id  = original.getAttribute('id')+new_key;
109
    var new_id  = original.getAttribute('id')+new_key;
110
110
111
    clone.setAttribute('id',new_id); // setting a new id for the parent div
111
    clone.setAttribute('id',new_id); // setting a new id for the parent li
112
112
113
    var divs = clone.getElementsByTagName('div');
113
    var divs = Array.from(clone.getElementsByTagName('li')).concat(Array.from(clone.getElementsByTagName('div')));
114
114
115
    // if hide_marc, indicators are hidden fields
115
    // if hide_marc, indicators are hidden fields
116
    // setting a new name for the new indicator
116
    // setting a new name for the new indicator
Lines 120-129 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
120
    }
120
    }
121
121
122
    // settings all subfields
122
    // settings all subfields
123
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
123
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div/li
124
        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
124
        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
125
125
126
            // set the attribute for the new 'div' subfields
126
            // set the attribute for the new 'li' subfields
127
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
127
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
128
128
129
            var inputs   = divs[i].getElementsByTagName('input');
129
            var inputs   = divs[i].getElementsByTagName('input');
Lines 162-168 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
162
                }
162
                }
163
            }
163
            }
164
            if( $(inputs[1]).hasClass('framework_plugin') ) {
164
            if( $(inputs[1]).hasClass('framework_plugin') ) {
165
                var olddiv= original.getElementsByTagName('div')[i];
165
                var olddiv= original.getElementsByTagName('li')[i];
166
                var oldcontrol= olddiv.getElementsByTagName('input')[1];
166
                var oldcontrol= olddiv.getElementsByTagName('input')[1];
167
                AddEventHandlers( oldcontrol,inputs[1],id_input );
167
                AddEventHandlers( oldcontrol,inputs[1],id_input );
168
            }
168
            }
Lines 173-184 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
173
                labels[0].setAttribute('for',id_input);
173
                labels[0].setAttribute('for',id_input);
174
            }
174
            }
175
175
176
            if(hideMarc == '0') {
177
                // updating javascript parameters on button up
178
                var imgs = divs[i].getElementsByTagName('img');
179
                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
180
            }
181
182
            // setting its '+' and '-' buttons
176
            // setting its '+' and '-' buttons
183
            try {
177
            try {
184
                var anchors = divs[i].getElementsByTagName('a');
178
                var anchors = divs[i].getElementsByTagName('a');
Lines 209-215 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
209
                        // 2 possibilities :
203
                        // 2 possibilities :
210
                        try{
204
                        try{
211
                            if( $(buttonDot).hasClass('framework_plugin') ) {
205
                            if( $(buttonDot).hasClass('framework_plugin') ) {
212
                                var olddiv= original.getElementsByTagName('div')[i];
206
                                var olddiv= original.getElementsByTagName('li')[i];
213
                                var oldcontrol= olddiv.getElementsByTagName('a')[0];
207
                                var oldcontrol= olddiv.getElementsByTagName('a')[0];
214
                                AddEventHandlers(oldcontrol,buttonDot,id_input);
208
                                AddEventHandlers(oldcontrol,buttonDot,id_input);
215
                            } else {
209
                            } else {
Lines 236-245 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
236
                    }
230
                    }
237
                }
231
                }
238
            }
232
            }
239
            if(hideMarc == '0') {
240
                var buttonUp = divs[i].getElementsByTagName('img')[0];
241
                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
242
            }
243
233
244
        } else { // it's a indicator div
234
        } else { // it's a indicator div
245
            if(divs[i].getAttribute('id').match(/^div_indicator/)){
235
            if(divs[i].getAttribute('id').match(/^div_indicator/)){
Lines 275-280 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
275
    // insert this line on the page
265
    // insert this line on the page
276
    original.parentNode.insertBefore(clone,original.nextSibling);
266
    original.parentNode.insertBefore(clone,original.nextSibling);
277
267
268
    $("ul.sortable_subfield", clone).sortable();
269
278
    Select2Utils.initSelect2(original);
270
    Select2Utils.initSelect2(original);
279
    Select2Utils.initSelect2(clone);
271
    Select2Utils.initSelect2(clone);
280
}
272
}
Lines 290-296 function CloneSubfield(index, advancedMARCEditor){ Link Here
290
    Select2Utils.removeSelect2(original);
282
    Select2Utils.removeSelect2(original);
291
    var clone = original.cloneNode(true);
283
    var clone = original.cloneNode(true);
292
    var new_key = CreateKey();
284
    var new_key = CreateKey();
293
    // set the attribute for the new 'div' subfields
285
    // set the attribute for the new 'li' subfields
294
    var inputs     = clone.getElementsByTagName('input');
286
    var inputs     = clone.getElementsByTagName('input');
295
    var selects    = clone.getElementsByTagName('select');
287
    var selects    = clone.getElementsByTagName('select');
296
    var textareas  = clone.getElementsByTagName('textarea');
288
    var textareas  = clone.getElementsByTagName('textarea');
Lines 351-358 function CloneSubfield(index, advancedMARCEditor){ Link Here
351
    clone.setAttribute('id',new_id);
343
    clone.setAttribute('id',new_id);
352
344
353
    try {
345
    try {
354
        var buttonUp = clone.getElementsByTagName('img')[0];
355
        buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
356
        var anchors = clone.getElementsByTagName('a');
346
        var anchors = clone.getElementsByTagName('a');
357
        if(anchors.length){
347
        if(anchors.length){
358
            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
348
            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
Lines 500-506 function CloneItemSubfield(original){ Link Here
500
    var clone = original.cloneNode(true);
490
    var clone = original.cloneNode(true);
501
    var new_key = CreateKey();
491
    var new_key = CreateKey();
502
492
503
    // set the attribute for the new 'div' subfields
493
    // set the attribute for the new 'li' subfields
504
    var inputs     = clone.getElementsByTagName('input');
494
    var inputs     = clone.getElementsByTagName('input');
505
    var selects    = clone.getElementsByTagName('select');
495
    var selects    = clone.getElementsByTagName('select');
506
    var textareas  = clone.getElementsByTagName('textarea');
496
    var textareas  = clone.getElementsByTagName('textarea');
507
- 

Return to bug 7882