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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-3 / +11 lines)
Lines 388-397 Link Here
388
[% END %]
388
[% END %]
389
389
390
[% BLOCK tab_item %]
390
[% BLOCK tab_item %]
391
    [% IF ( bt_active ) %]
391
    [% IF ( id ) %]
392
        <li role="presentation" class="active">
392
        [% IF ( bt_active ) %]
393
            <li id="[% id | html %]" role="presentation" class="active">
394
        [% ELSE %]
395
            <li id="[% id | html %]" role="presentation">
396
        [% END %]
393
    [% ELSE %]
397
    [% ELSE %]
394
        <li role="presentation">
398
        [% IF ( bt_active ) %]
399
            <li role="presentation" class="active">
400
        [% ELSE %]
401
            <li role="presentation">
402
        [% END %]
395
    [% END %]
403
    [% END %]
396
        [% IF (linktab) %]
404
        [% IF (linktab) %]
397
            <a href="?tab=[% tabname | url %]" id="[% tabname | uri %]-tab">
405
            <a href="?tab=[% tabname | url %]" id="[% tabname | uri %]-tab">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-37 / +42 lines)
Lines 115-135 Link Here
115
            [% END %]
115
            [% END %]
116
        [% END %][% END %]
116
        [% END %][% END %]
117
117
118
        <div id="subfieldtabs" class="toptabs numbered">
118
        [% WRAPPER tabs id= "subfieldtabs" %]
119
            <ul class="nav nav-tabs" role="tablist">
119
            [% WRAPPER tabs_nav %]
120
                [% FOREACH loo IN loop %]
120
                [% FOREACH loo IN loop %]
121
                    <li role="presentation" id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]">
121
                    [% outputsubfield = PROCESS outputsubfield subfieldanchor = loo.tagsubfield %]
122
                    [% WRAPPER tab_item tabname= outputsubfield id= "tab_subfield_${outputsubfield}" %]
122
                        [% IF ( loo.new_subfield ) %]
123
                        [% IF ( loo.new_subfield ) %]
123
                            <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">New</a>
124
                            <span>New</span>
124
                        [% ELSE %]
125
                        [% ELSE %]
125
                            <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">[% loo.tagsubfield | html %]</a>
126
                            [% loo.tagsubfield | html %]
126
                        [% END %]
127
                        [% END # IF loo.new_subfield%]
127
                    </li>
128
                    [% END # WRAPPER tab_item %]
128
                [% END %]
129
                [% END # FOREACH loo %]
129
            </ul>
130
            [% END # /WRAPPER tabs_nav %]
130
            <div class="tab-content">
131
132
            [% WRAPPER tab_panels %]
131
                [% FOREACH loo IN loop %]
133
                [% FOREACH loo IN loop %]
132
                    <div role="tabpanel" class="tab-pane" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field">
134
                    [% outputsubfield = PROCESS outputsubfield subfieldanchor = loo.tagsubfield %]
135
                    [% WRAPPER tab_panel tabname=outputsubfield %]
133
                        <fieldset class="rows"><ol>
136
                        <fieldset class="rows"><ol>
134
137
135
                            [% IF ( loo.new_subfield ) %]
138
                            [% IF ( loo.new_subfield ) %]
Lines 289-298 Link Here
289
                                </fieldset>
292
                                </fieldset>
290
                            </li>
293
                            </li>
291
                        </ol></fieldset><br class="clear" />
294
                        </ol></fieldset><br class="clear" />
292
                    </div>
295
                    [% END # /WRAPPER   tab_panel %]
293
                [% END %]
296
                [% END # /FOREACH loo %]
294
            </div> <!-- /.tab-content -->
297
            [% END # /WRAPPER tab_panels %]
295
        </div>
298
        [% END # /WRAPPER tabs %]
296
    </form>
299
    </form>
297
[% END %]
300
[% END %]
298
301
Lines 415-444 Link Here
415
                paginate: false
418
                paginate: false
416
            }));
419
            }));
417
420
418
            [% IF ( tagsubfield && tagsubfield == "@") %]
421
            if( $("#subfieldtabs").length > 0 ){
419
                $("#subfieldtabs a[href='#subATfield']").tab("show");
422
                [% IF ( tagsubfield && tagsubfield == "@") %]
420
            [% ELSIF ( tagsubfield && tagsubfield != "@") %]
423
                    $("#subfieldtabs a[href='#AT_panel']").tab("show");
421
                $("#subfieldtabs a[href='#sub[% tagsubfield | html %]field']").tab("show");
424
                [% ELSIF ( tagsubfield && tagsubfield != "@") %]
422
            [% ELSE  %]
425
                    $("#subfieldtabs a[href='#[% tagsubfield | html %]_panel']").tab("show");
423
                $("#subfieldtabs a:first").tab("show");
426
                [% ELSE  %]
424
            [% END %]
427
                    $("#subfieldtabs a:first").tab("show");
428
                [% END %]
425
429
426
            var subfields_list = $("#subfieldtabs > ul");
430
                var subfields_list = $("#subfieldtabs > ul");
427
            var sortable_subfields = new Sortable( subfields_list[0], {
431
                var sortable_subfields = new Sortable( subfields_list[0], {
428
                onEnd: function( e ){
432
                    onEnd: function( e ){
429
                    var old_index = e.oldIndex;
433
                        var old_index = e.oldIndex;
430
                    var new_index = e.newIndex;
434
                        var new_index = e.newIndex;
431
                    if (old_index < new_index) new_index++;
435
                        if (old_index < new_index) new_index++;
432
                    var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
436
                        var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
433
                    var content = $('#sub' + subfield_code + 'field');
437
                        var content = $( '#' + subfield_code + '_panel');
434
                    var panels = $("#subfieldtabs .tab-pane");
438
                        var panels = $("#subfieldtabs .tab-pane");
435
                    if ( new_index < $(panels).size() ){
439
                        if ( new_index < $(panels).size() ){
436
                        $(content).insertBefore( panels[new_index]);
440
                            $(content).insertBefore( panels[new_index]);
437
                    } else {
441
                        } else {
438
                        $(content).insertAfter( panels[new_index-1]);
442
                            $(content).insertAfter( panels[new_index-1]);
443
                        }
439
                    }
444
                    }
440
                }
445
                });
441
            });
446
            }
442
447
443
        });
448
        });
444
    </script>
449
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-21 / +20 lines)
Lines 110-136 Link Here
110
                                [% END %]
110
                                [% END %]
111
                            [% END %][% END %]
111
                            [% END %][% END %]
112
112
113
                            <div id="subfieldtabs" class="toptabs numbered">
113
                            [% WRAPPER tabs id= "subfieldtabs" %]
114
                                 <ul class="nav nav-tabs" role="tablist">
114
                                [% WRAPPER tabs_nav %]
115
                                    [% FOREACH loo IN loop %]
115
                                    [% FOREACH loo IN loop %]
116
                                        <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="tab-item" role="presentation">
116
                                        [% outputsubfield = PROCESS outputsubfield subfieldanchor = loo.subfieldcode %]
117
                                        [% WRAPPER tab_item tabname= outputsubfield id= "tab_subfield_${outputsubfield}" %]
117
                                            [% IF ( loo.new_subfield ) %]
118
                                            [% IF ( loo.new_subfield ) %]
118
                                                <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">New</a>
119
                                                <span>New</span>
119
                                            [% ELSE %]
120
                                            [% ELSE %]
120
                                                <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">
121
                                                [% loo.subfieldcode | html %]
121
                                                    [% loo.subfieldcode | html %]
122
                                            [% END # IF loo.new_subfield%]
122
                                                </a>
123
                                        [% END # WRAPPER tab_item %]
123
                                            [% END %]
124
                                    [% END # FOREACH loo %]
124
                                        </li>
125
                                [% END # /WRAPPER tabs_nav %]
125
                                    [% END %]
126
                                </ul>
127
128
                                <div class="tab-content">
129
126
127
                                [% WRAPPER tab_panels %]
130
                                    [% FOREACH loo IN loop %]
128
                                    [% FOREACH loo IN loop %]
131
                                        <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field">
129
                                        [% outputsubfield = PROCESS outputsubfield subfieldanchor = loo.subfieldcode %]
130
                                        [% WRAPPER tab_panel tabname=outputsubfield %]
132
                                            <input type="hidden" name="tab_id" value="[% loo.row | html %]" />
131
                                            <input type="hidden" name="tab_id" value="[% loo.row | html %]" />
133
                                            <div id="basic[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
132
                                            <div id="basic[%- outputsubfield | html -%]" class="contraints">
134
                                                <fieldset class="rows">
133
                                                <fieldset class="rows">
135
                                                    <legend>Basic constraints</legend>
134
                                                    <legend>Basic constraints</legend>
136
                                                    <ol>
135
                                                    <ol>
Lines 204-210 Link Here
204
                                                </fieldset> <!-- /.rows -->
203
                                                </fieldset> <!-- /.rows -->
205
                                            </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
204
                                            </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
206
205
207
                                            <div id="advanced[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
206
                                            <div id="advanced[%- outputsubfield | html -%]" class="contraints">
208
                                                <fieldset class="rows">
207
                                                <fieldset class="rows">
209
                                                    <legend>Advanced constraints</legend>
208
                                                    <legend>Advanced constraints</legend>
210
                                                    <ol>
209
                                                    <ol>
Lines 260-266 Link Here
260
                                                </fieldset> <!-- /.rows -->
259
                                                </fieldset> <!-- /.rows -->
261
                                            </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
260
                                            </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
262
261
263
                                            <div id="oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="constraints">
262
                                            <div id="oth[%- outputsubfield | html -%]" class="constraints">
264
                                                <fieldset class="rows">
263
                                                <fieldset class="rows">
265
                                                    <legend>Other options (choose one)</legend>
264
                                                    <legend>Other options (choose one)</legend>
266
                                                    <ol>
265
                                                    <ol>
Lines 303-313 Link Here
303
                                                        </li>
302
                                                        </li>
304
                                                    </ol>
303
                                                    </ol>
305
                                                </fieldset> <!-- /.rows -->
304
                                                </fieldset> <!-- /.rows -->
306
                                            </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%] -->
305
                                            </div> <!-- /#oth_outputsubfield -->
307
                                        </div><!-- /constraints -->
306
                                        [% END # /WRAPPER   tab_panel %]
308
                                    [% END # /FOREACH loo %]
307
                                    [% END # /FOREACH loo %]
309
                                </div> <!-- /.tab-content -->
308
                                [% END # /WRAPPER tab_panels %]
310
                            </div><!-- /subfieldtabs -->
309
                            [% END # /WRAPPER tabs %]
311
310
312
                            <fieldset class="action">
311
                            <fieldset class="action">
313
                                <input type="submit" class="btn btn-primary" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
312
                                <input type="submit" class="btn btn-primary" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js (-4 / +3 lines)
Lines 1-9 Link Here
1
/* global dataTablesDefaults tagsubfield selectBsTabByHash */
1
/* global dataTablesDefaults tagsubfield selectBsTabByHash */
2
$(document).ready(function() {
2
$(document).ready(function() {
3
    if( tagsubfield && tagsubfield == "@"){
3
    if( tagsubfield && tagsubfield == "@"){
4
        $("#subfieldtabs a[href='#subATfield']").tab("show");
4
        $("#subfieldtabs a[href='#AT_panel']").tab("show");
5
    } else if ( tagsubfield && tagsubfield != "@"){
5
    } else if ( tagsubfield && tagsubfield != "@"){
6
        $("#subfieldtabs a[href='#sub" + tagsubfield + "field'").tab("show");
6
        $("#subfieldtabs a[href='#" + tagsubfield + "_panel'").tab("show");
7
    } else {
7
    } else {
8
        $("#subfieldtabs a:first").tab("show");
8
        $("#subfieldtabs a:first").tab("show");
9
    }
9
    }
Lines 15-21 $(document).ready(function() { Link Here
15
            var new_index = e.newIndex;
15
            var new_index = e.newIndex;
16
            if (old_index < new_index) new_index++;
16
            if (old_index < new_index) new_index++;
17
            var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
17
            var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
18
            var content = $('#sub' + subfield_code + 'field');
18
            var content = $( '#' + subfield_code + '_panel');
19
            var panels = $("#subfieldtabs .tab-pane");
19
            var panels = $("#subfieldtabs .tab-pane");
20
            if ( new_index < $(panels).size() ){
20
            if ( new_index < $(panels).size() ){
21
                $(content).insertBefore( panels[new_index]);
21
                $(content).insertBefore( panels[new_index]);
22
- 

Return to bug 33178