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

(-)a/installer/data/mysql/atomicupdate/bug_34075.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "34075",
5
    description => "Add DefaultAuthorityTab system preference",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
11
            ('DefaultAuthorityTab','0','0|1|2|3|4|5|6|7|8|9','Default tab to shwo when displaying authorities','Choice')
12
        });
13
        say $out "Added new system preference 'DefaultAuthorityTab'";
14
    },
15
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 172-177 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
172
('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'),
172
('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'),
173
('decreaseLoanHighHoldsIgnoreStatuses', '', 'damaged|itemlost|notforloan|withdrawn', "Ignore items with these statuses for dynamic high holds checking", 'Choice'),
173
('decreaseLoanHighHoldsIgnoreStatuses', '', 'damaged|itemlost|notforloan|withdrawn', "Ignore items with these statuses for dynamic high holds checking", 'Choice'),
174
('decreaseLoanHighHoldsValue',NULL,'','Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)','Integer'),
174
('decreaseLoanHighHoldsValue',NULL,'','Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)','Integer'),
175
('DefaultAuthorityTab','0','0|1|2|3|4|5|6|7|8|9','Default tab to shwo when displaying authorities','Choice'),
175
('DefaultClassificationSource','ddc',NULL,'Default classification scheme used by the collection. E.g., Dewey, LCC, etc.','ClassSources'),
176
('DefaultClassificationSource','ddc',NULL,'Default classification scheme used by the collection. E.g., Dewey, LCC, etc.','ClassSources'),
176
('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 of MARC21 - Place of publication, production, or execution. See <a href=\"http://www.loc.gov/marc/countries/countries_code.html\">MARC Code List for Countries</a>','Free'),
177
('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 of MARC21 - Place of publication, production, or execution. See <a href=\"http://www.loc.gov/marc/countries/countries_code.html\">MARC Code List for Countries</a>','Free'),
177
('DefaultHoldExpirationdate','0','','Automatically set expiration date for holds','YesNo'),
178
('DefaultHoldExpirationdate','0','','Automatically set expiration date for holds','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref (-1 / +16 lines)
Lines 75-81 Authorities: Link Here
75
              default: "Work cat."
75
              default: "Work cat."
76
              type: textarea
76
              type: textarea
77
              class: code
77
              class: code
78
78
        -
79
            - When viewing authority details default to the
80
            - pref: DefaultAuthorityTab
81
              default: "0"
82
              choices:
83
                  "0": 0XX
84
                  "1": 1XX
85
                  "2": 2XX
86
                  "3": 3XX
87
                  "4": 4XX
88
                  "5": 5XX
89
                  "6": 6XX
90
                  "7": 7XX
91
                  "8": 8XX
92
                  "9": 9XX
93
            - tab. If the selected tab does not exist, the view will default to the first tab.
79
    Linker:
94
    Linker:
80
        -
95
        -
81
            - Use the
96
            - Use the
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt (-2 / +13 lines)
Lines 1-4 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Koha %]
2
[% USE Asset %]
3
[% USE Asset %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
4
[% PROCESS 'authorities.inc' %]
5
[% PROCESS 'authorities.inc' %]
Lines 132-138 Link Here
132
    <script>
133
    <script>
133
        $(document).ready(function() {
134
        $(document).ready(function() {
134
            if( $("#authoritiestabs .tab-pane.active").length < 1 ){
135
            if( $("#authoritiestabs .tab-pane.active").length < 1 ){
135
                $("#authoritiestabs a:first").tab("show");
136
                [% SET DefaultAuthorityTab = Koha.Preference('DefaultAuthorityTab') %]
137
                [% IF DefaultAuthorityTab %]
138
                    let default_tab = "#tab" + [% DefaultAuthorityTab %] + "XX-tab";
139
                    let tab_object = $("#authoritiestabs "+default_tab)
140
                    if( tab_object.length > 0 ){
141
                        tab_object.tab("show");
142
                    } else {
143
                        $("#authoritiestabs a:first").tab("show");
144
                    }
145
                [% ELSE %]
146
                    $("#authoritiestabs a:first").tab("show");
147
                [% END %]
136
            }
148
            }
137
149
138
            var editAuth = $("#editAuth");
150
            var editAuth = $("#editAuth");
139
- 

Return to bug 34075