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

(-)a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css (-84 / +53 lines)
Lines 71-96 ul li.tag li.subfield_line.ui-sortable-helper::before { Link Here
71
}
71
}
72
72
73
.buttonPlus {
73
.buttonPlus {
74
	font-weight : bold;
74
	font-weight: bold;
75
	text-decoration : none;
75
	text-decoration: none;
76
}
76
}
77
77
78
.buttonMinus {
78
.buttonMinus {
79
	font-weight : bold;
79
	font-weight: bold;
80
	text-decoration : none;
80
	text-decoration: none;
81
}
81
}
82
82
83
a.expandfield {
83
a.expandfield {
84
	text-decoration : none;
84
	text-decoration: none;
85
}
85
}
86
86
87
#authoritytabs {
87
#authoritytabs {
88
	margin-top : 1em;
88
	margin-top: 1em;
89
	margin-bottom : 1em;
89
	margin-bottom: 1em;
90
}
90
}
91
91
92
.toptabs .ui-tabs-nav li a {
92
.toptabs .ui-tabs-nav li a {
93
	padding : .2em 1.2em;
93
	padding: .2em 1.2em;
94
}
94
}
95
95
96
.tag {
96
.tag {
Lines 101-118 a.expandfield { Link Here
101
101
102
li.subfield_line {
102
li.subfield_line {
103
    padding-bottom: .3em;
103
    padding-bottom: .3em;
104
    float: left;
105
    clear: left;
106
    width: 100%;
107
}
108
104
109
li.subfield_line label {
110
    font-size:89%;
111
    float: left;
112
	 padding-right : .4em;
113
    width: 16em;
114
    text-align: left;
115
    clear:left;
116
}
105
}
117
106
118
.subfieldcode img {
107
.subfieldcode img {
Lines 120-167 li.subfield_line label { Link Here
120
}
109
}
121
110
122
.tag_title {
111
.tag_title {
123
	font-size : 90%;
112
	font-size: 90%;
124
	padding : .2em 0;
113
	padding: .2em 0;
125
}
114
}
126
115
127
.tagnum {
116
.tagnum {
128
	font-size : 130%;
117
	font-size: 130%;
129
	font-weight : bold;
118
	font-weight: bold;
130
	color : #000;
119
	color: #000;
131
	padding : .1em .3em .1em 0;
120
	padding: .1em .3em .1em 0;
132
}
121
}
133
122
134
a.tagnum {
123
a.tagnum {
135
	font-size : 110%;
124
	font-size: 110%;
136
	font-weight : bold;
125
	font-weight: bold;
137
	color : #000;
126
	color: #000;
138
	padding : .1em .3em .1em 0;
127
	padding: .1em .3em .1em 0;
139
	text-decoration : none;
128
	text-decoration: none;
140
}
129
}
141
130
142
.subfield {
131
.subfield {
143
	color : #00698a;
132
    padding: .25em .5em;
144
	float: left;
133
    text-align:right;
145
	width: 10em;
134
    width: 10em;
146
	text-align:right;
147
}
135
}
148
136
149
.subfield.subfield_mandatory {
137
.subfield label {
150
    color: #C00;
138
    color: #00698a;
151
}
139
}
152
140
153
.subfieldcode {
141
.subfield.subfield_mandatory {
154
	display: block;
142
    color: #C00;
155
	float: left;
156
}
143
}
157
144
158
.labelsubfield {
145
.labelsubfield {
159
	float:left;
146
    font-size: 90%;
160
}
147
}
161
148
162
.input_marceditor {
149
.input_marceditor {
163
	float:left;
150
    width: 100%;
164
	width:30em;
165
}
151
}
166
152
167
.indicator {
153
.indicator {
Lines 170-209 a.tagnum { Link Here
170
}
156
}
171
157
172
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
158
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
173
	font-size : 100%;
159
	font-size: 100%;
174
	width : 25%;
175
}
176
160
177
#cataloguing_additem_newitem fieldset.rows li {
178
	padding-bottom : 3px;
179
}
180
#cataloguing_additem_newitem .input_marceditor {
181
	width : auto;
182
}
161
}
183
162
184
#cataloguing_additem_newitem textarea.input_marceditor {
163
#cataloguing_additem_newitem fieldset.rows li {
185
     width : 31em;
164
	padding-bottom: 3px;
186
}
165
}
187
166
188
.mandatory_marker {
167
.mandatory_marker {
189
	color: red;
168
	color: red;
190
}
169
}
191
.linktools { display: block; white-space: nowrap; }
170
.linktools { display: block; white-space: nowrap; }
192
.linktools a { font-size : 75%; display:block;text-decoration:none;}
171
.linktools a { font-size: 75%; display:block;text-decoration:none;}
193
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
172
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
194
.linktools a:first-child { border-bottom: 1px solid #DDD; }
173
.linktools a:first-child { border-bottom: 1px solid #DDD; }
195
.linktools a:hover { background-color: #FFC; }
174
.linktools a:hover { background-color: #FFC; }
196
.subfield_controls { margin : 0 .5em; }
197
175
198
#cataloguing_additem_itemlist {
176
.subfield_controls {
199
	margin-bottom : 1em;
177
    margin: 0 .5em;
200
}
178
    min-width: 3em;
201
.yui-gf div.first {
202
	width : 19%;
203
}
179
}
204
180
205
.yui-gf .yui-u {
181
#cataloguing_additem_itemlist {
206
	width: 79.2%;
182
	margin-bottom: 1em;
207
}
183
}
208
184
209
tbody tr.active:nth-child(2n+1) td,
185
tbody tr.active:nth-child(2n+1) td,
Lines 223-235 tbody tr.active td { Link Here
223
    z-index: 1000;
199
    z-index: 1000;
224
}
200
}
225
#loading div {
201
#loading div {
226
    background : transparent url(../img/loading.gif) top left no-repeat;
202
    background: transparent url(../img/loading.gif) top left no-repeat;
227
    font-size : 175%;
203
    font-size: 175%;
228
    font-weight: bold;
204
    font-weight: bold;
229
    height: 2em;
205
    height: 2em;
230
    left: 50%;
206
    left: 50%;
231
    margin: -1em 0 0 -2.5em;
207
    margin: -1em 0 0 -2.5em;
232
    padding-left : 50px;
208
    padding-left: 50px;
233
    position: absolute;
209
    position: absolute;
234
    top: 50%;
210
    top: 50%;
235
    width: 15em;
211
    width: 15em;
Lines 322-351 tbody tr.active td { Link Here
322
    display: inline-block;
298
    display: inline-block;
323
}
299
}
324
300
325
@media (min-width: 768px) {
301
.subfield_line {
326
    li.subfield_line label {
302
    display: flex;
327
        width: 20em;
303
}
328
    }
304
305
.field_marceditor {
306
    flex-grow: 1;
307
    padding: .25em .5em;
308
}
309
310
.subfield_loop_mandatory {
311
    padding: .25em .5em;
312
}
329
313
330
    .input_marceditor {
314
@media (min-width: 768px) {
331
        width: 50em;
332
    }
333
315
334
    .subfield {
335
        width: 14em;
336
    }
337
}
316
}
338
317
339
@media (min-width: 1200px) {
318
@media (min-width: 1200px) {
340
    li.subfield_line label {
341
        width: 25em;
342
    }
343
344
    .input_marceditor {
345
        width: 60em;
346
    }
347
319
348
    .subfield {
349
        width: 16em;
350
    }
351
}
320
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-62 / +70 lines)
Lines 479-485 Link Here
479
[% INCLUDE 'select2.inc' %]
479
[% INCLUDE 'select2.inc' %]
480
<script>
480
<script>
481
  $(document).ready(function() {
481
  $(document).ready(function() {
482
    $('.subfield_line select').select2();
482
    $('.subfield_line select').select2({
483
        width: "100%"
484
    });
483
  });
485
  });
484
</script>
486
</script>
485
487
Lines 787-867 Link Here
787
                                        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
789
                                        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
788
                                            <!--  One line on the marc editor -->
790
                                            <!--  One line on the marc editor -->
789
                                            <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
791
                                            <li class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
792
                                                <div class="subfieldcode">
793
                                                    <input type="text"
794
                                                            title="[% subfield_loo.marc_lib | $raw %]"
795
                                                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
796
                                                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
797
                                                            value="[% subfield_loo.subfield | html %]"
798
                                                            size="1"
799
                                                            maxlength="1"
800
                                                            class="flat"
801
                                                            tabindex="0" />
802
                                                </div>
790
                                                [% UNLESS advancedMARCEditor %]
803
                                                [% UNLESS advancedMARCEditor %]
791
                                                    [% IF ( subfield_loo.fixedfield ) %]
804
                                                    [% IF ( subfield_loo.mandatory ) %]
792
                                                        <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">
805
                                                        <div class="subfield subfield_mandatory">
806
                                                    [% ELSIF ( subfield_loo.important ) %]
807
                                                        <div class="subfield subfield_important">
793
                                                    [% ELSE %]
808
                                                    [% ELSE %]
794
                                                        <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
809
                                                        <div class="subfield">
795
                                                    [% END %]
810
                                                    [% END %]
796
                                                [% END %]
811
                                                        [% IF ( subfield_loo.fixedfield ) %]
797
812
                                                            <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">
798
                                                    <span class="subfieldcode">
799
                                                            <input type="text"
800
                                                                title="[% subfield_loo.marc_lib | $raw %]"
801
                                                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
802
                                                                name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
803
                                                                value="[% subfield_loo.subfield | html %]"
804
                                                                size="1"
805
                                                                maxlength="1"
806
                                                                class="flat"
807
                                                                tabindex="0" />
808
                                                    </span>
809
810
                                                [% UNLESS advancedMARCEditor %]
811
                                                        [% IF ( subfield_loo.mandatory ) %]
812
                                                            <span class="subfield subfield_mandatory">
813
                                                        [% ELSIF ( subfield_loo.important ) %]
814
                                                            <span class="subfield subfield_important">
815
                                                        [% ELSE %]
813
                                                        [% ELSE %]
816
                                                            <span class="subfield">
814
                                                            <label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
817
                                                        [% END %]
815
                                                        [% END %]
818
                                                        [% subfield_loo.marc_lib | $raw %]
816
                                                        [% subfield_loo.marc_lib | $raw %]
819
                                                        </span>
817
                                                        </label>
820
                                                    </label>
818
                                                    </div>
821
                                                [% END %]
819
                                                [% END %]
822
820
823
                                                [% SET mv = subfield_loo.marc_value %]
824
                                                [% IF ( mv.type == 'text' ) %]
825
                                                    [% IF ( mv.readonly == 1 ) %]
826
                                                        <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" />
827
                                                    [% ELSE %]
828
                                                        <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 -%]" />
829
                                                    [% END %]
830
821
831
                                                    [% IF ( mv.authtype ) %]
822
                                                [% SET mv = subfield_loo.marc_value %]
832
                                                        <span class="subfield_controls"><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></span>
823
                                                <div id="field_marceditor[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]" class="field_marceditor">
833
                                                    [% END %]
824
                                                    [% IF ( mv.type == 'text' ) %]
834
                                                [% ELSIF ( mv.type == 'text_complex' ) %]
825
                                                        [% IF ( mv.readonly == 1 ) %]
835
                                                    <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 -%]" />
826
                                                            <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" />
836
                                                    <span class="subfield_controls">
837
                                                        [% IF mv.noclick %]
838
                                                            <span class="buttonDot tag_editor disabled" tabindex="-1" title="Field autofilled by plugin"></span>
839
                                                        [% ELSE %]
827
                                                        [% ELSE %]
840
                                                            <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
828
                                                            <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 -%]" />
841
                                                        [% END %]
829
                                                        [% END %]
842
                                                    </span>
830
843
                                                    [% mv.javascript | $raw %]
831
                                                    [% ELSIF ( mv.type == 'text_complex' ) %]
844
                                                [% ELSIF ( mv.type == 'hidden' ) %]
832
                                                        <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 -%]" />
845
                                                    <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 -%]" />
833
846
                                                [% ELSIF ( mv.type == 'textarea' ) %]
834
                                                        [% mv.javascript | $raw %]
847
                                                    <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
835
                                                    [% ELSIF ( mv.type == 'hidden' ) %]
848
                                                [% ELSIF ( mv.type == 'select' ) %]
836
                                                        <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 -%]" />
849
                                                    <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
837
                                                    [% ELSIF ( mv.type == 'textarea' ) %]
850
                                                    [% FOREACH aval IN mv.values %]
838
                                                        <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
851
                                                        [% IF aval == mv.default %]
839
                                                    [% ELSIF ( mv.type == 'select' ) %]
852
                                                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
840
                                                        <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
853
                                                        [% ELSE %]
841
                                                        [% FOREACH aval IN mv.values %]
854
                                                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
842
                                                            [% IF aval == mv.default %]
843
                                                            <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
844
                                                            [% ELSE %]
845
                                                            <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
846
                                                            [% END %]
855
                                                        [% END %]
847
                                                        [% END %]
856
                                                    [% END %]
848
                                                        </select>
857
                                                    </select>
849
                                                    [% END  # /IF (mv.type...) %]
858
                                                [% END  # /IF (mv.type...) %]
850
                                                </div>
859
                                                [% IF ( subfield_loo.mandatory ) %]
851
                                                [% IF ( subfield_loo.mandatory ) %]
860
                                                    <span class="required">Required</span>
852
                                                    <div class="subfield_loop_mandatory">
853
                                                        <span class="required">Required</span>
854
                                                    </div>
861
                                                [% ELSIF ( subfield_loo.important ) %]
855
                                                [% ELSIF ( subfield_loo.important ) %]
862
                                                    <span class="important">Important</span>
856
                                                    <div class="subfield_loop_mandatory">
857
                                                        <span class="important">Important</span>
858
                                                    </div>
863
                                                [% END %]
859
                                                [% END %]
864
                                                <span class="subfield_controls">
860
                                                <div class="subfield_controls">
861
                                                    [% IF ( mv.type == 'text' ) %]
862
                                                        [% IF ( mv.authtype ) %]
863
                                                            <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>
864
                                                        [% END %]
865
                                                    [% ELSIF ( mv.type == 'text_complex' ) %]
866
                                                            [% IF mv.noclick %]
867
                                                                <span class="buttonDot tag_editor disabled" tabindex="-1" title="Field autofilled by plugin"></span>
868
                                                            [% ELSE %]
869
                                                                <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
870
                                                            [% END %]
871
                                                        </span>
872
                                                    [% END %]
865
                                                    [% IF ( subfield_loo.repeatable ) %]
873
                                                    [% IF ( subfield_loo.repeatable ) %]
866
                                                        <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;">
874
                                                        <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;">
867
                                                            <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
875
                                                            <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
Lines 870-876 Link Here
870
                                                            <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
878
                                                            <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
871
                                                        </a>
879
                                                        </a>
872
                                                    [% END %]
880
                                                    [% END %]
873
                                                </span>
881
                                                </div>
874
                                            </li> <!-- /.subfield_line -->
882
                                            </li> <!-- /.subfield_line -->
875
                                            <!-- End of the line -->
883
                                            <!-- End of the line -->
876
                                        [% END # /FOREACH subfield_loop %]
884
                                        [% END # /FOREACH subfield_loop %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js (-36 / +39 lines)
Lines 65-74 function ExpandField(index) { Link Here
65
        if(lis[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
65
        if(lis[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
66
            if (!lis[i].style.display) {
66
            if (!lis[i].style.display) {
67
                // first time => show all subfields
67
                // first time => show all subfields
68
                lis[i].style.display = 'block';
68
                lis[i].style.display = 'flex';
69
            } else if (lis[i].style.display == 'none') {
69
            } else if (lis[i].style.display == 'none') {
70
                // show
70
                // show
71
                lis[i].style.display = 'block';
71
                lis[i].style.display = 'flex';
72
            } else {
72
            } else {
73
                // hide
73
                // hide
74
                lis[i].style.display = 'none';
74
                lis[i].style.display = 'none';
Lines 91-97 var Select2Utils = { Link Here
91
        if ($.fn.select2) {
91
        if ($.fn.select2) {
92
            var selects = element.getElementsByTagName('select');
92
            var selects = element.getElementsByTagName('select');
93
            for (var i=0; i < selects.length; i++) {
93
            for (var i=0; i < selects.length; i++) {
94
                $(selects[i]).select2();
94
                $(selects[i]).select2({
95
                    width: "100%"
96
                });
95
            }
97
            }
96
        }
98
        }
97
    }
99
    }
Lines 124-130 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
124
    // settings all subfields
126
    // settings all subfields
125
    var divslen = divs.length;
127
    var divslen = divs.length;
126
    for( i=0; i < divslen ; i++ ){      // foreach div/li
128
    for( i=0; i < divslen ; i++ ){      // foreach div/li
127
        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
129
        if( divs[i].getAttribute("id") && divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
128
130
129
            // set the attribute for the new 'li' subfields
131
            // set the attribute for the new 'li' subfields
130
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
132
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
Lines 145-182 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
145
                    textareas[j].value = "";
147
                    textareas[j].value = "";
146
                }
148
                }
147
            }
149
            }
150
            if( inputs.length > 0 ){
151
                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
152
                inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
148
153
149
            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
154
                try {
150
            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
155
                    id_input = inputs[1].getAttribute('id')+new_key;
151
156
                    inputs[1].setAttribute('id',id_input);
152
            try {
157
                    inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
153
                id_input = inputs[1].getAttribute('id')+new_key;
158
                } catch(e) {
154
                inputs[1].setAttribute('id',id_input);
159
                    try{ // it s a select if it is not an input
155
                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
160
                        var selects = divs[i].getElementsByTagName('select');
156
            } catch(e) {
161
                        id_input = selects[0].getAttribute('id')+new_key;
157
                try{ // it s a select if it is not an input
162
                        selects[0].setAttribute('id',id_input);
158
                    var selects = divs[i].getElementsByTagName('select');
163
                        selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
159
                    id_input = selects[0].getAttribute('id')+new_key;
164
                    }catch(e2){ // it is a textarea if it s not a select or an input
160
                    selects[0].setAttribute('id',id_input);
165
                        var textareas = divs[i].getElementsByTagName('textarea');
161
                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
166
                        if( textareas.length > 0 ){
162
                }catch(e2){ // it is a textarea if it s not a select or an input
167
                            id_input = textareas[0].getAttribute('id')+new_key;
163
                    var textaeras = divs[i].getElementsByTagName('textarea');
168
                            textareas[0].setAttribute('id',id_input);
164
                    id_input = textaeras[0].getAttribute('id')+new_key;
169
                            textareas[0].setAttribute('name',textareas[0].getAttribute('name')+new_key);
165
                    textaeras[0].setAttribute('id',id_input);
170
                        }
166
                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
171
                    }
172
                }
173
                if( $(inputs[1]).hasClass('framework_plugin') ) {
174
                    olddiv= original.getElementsByTagName('li')[i];
175
                    oldcontrol= olddiv.getElementsByTagName('input')[1];
176
                    AddEventHandlers( oldcontrol,inputs[1],id_input );
167
                }
177
                }
168
            }
178
            }
169
            if( $(inputs[1]).hasClass('framework_plugin') ) {
179
            // when cloning a subfield, re set its label too.
170
                olddiv= original.getElementsByTagName('li')[i];
180
            var labels = divs[i].getElementsByTagName('label');
171
                oldcontrol= olddiv.getElementsByTagName('input')[1];
181
            labels[0].setAttribute('for', id_input);
172
                AddEventHandlers( oldcontrol,inputs[1],id_input );
173
            }
174
175
            if (advancedMARCEditor == '0') {
176
                // when cloning a subfield, re set its label too.
177
                var labels = divs[i].getElementsByTagName('label');
178
                labels[0].setAttribute('for',id_input);
179
            }
180
182
181
            // setting its '+' and '-' buttons
183
            // setting its '+' and '-' buttons
182
            try {
184
            try {
Lines 227-233 function CloneField(index, hideMarc, advancedMARCEditor) { Link Here
227
            }
229
            }
228
230
229
        } else { // it's a indicator div
231
        } else { // it's a indicator div
230
            if(divs[i].getAttribute('id').match(/^div_indicator/)){
232
            if ( divs[i].getAttribute("id") && divs[i].getAttribute('id').match(/^div_indicator/)) {
231
233
232
                // setting a new id for the indicator div
234
                // setting a new id for the indicator div
233
                divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
235
                divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
Lines 331-337 function CloneSubfield(index, advancedMARCEditor){ Link Here
331
    if(advancedMARCEditor == '0') {
333
    if(advancedMARCEditor == '0') {
332
        // when cloning a subfield, reset its label too.
334
        // when cloning a subfield, reset its label too.
333
        var label = clone.getElementsByTagName('label')[0];
335
        var label = clone.getElementsByTagName('label')[0];
334
        label.setAttribute('for',id_input);
336
        if( label ){
337
            label.setAttribute('for',id_input);
338
        }
335
    }
339
    }
336
340
337
    // setting a new id for the parent div
341
    // setting a new id for the parent div
338
- 

Return to bug 22399