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

(-)a/C4/Languages.pm (-2 / +3 lines)
Lines 206-211 sub getLanguages { Link Here
206
206
207
    my @languages_loop;
207
    my @languages_loop;
208
    my $languages_hash;
208
    my $languages_hash;
209
    my $priority_sorting = C4::Context->preference("AdvancedSearchLanguagesSort");
209
    my $dbh=C4::Context->dbh;
210
    my $dbh=C4::Context->dbh;
210
    my $default_language = 'en';
211
    my $default_language = 'en';
211
    my $current_language = $default_language;
212
    my $current_language = $default_language;
Lines 253-262 sub getLanguages { Link Here
253
        # Do not push unless valid iso639-2 code
254
        # Do not push unless valid iso639-2 code
254
        if ( $language_subtag_registry->{ iso639_2_code } and ( !$language_list || index (  $language_list, $language_subtag_registry->{ iso639_2_code } ) >= 0) ) {
255
        if ( $language_subtag_registry->{ iso639_2_code } and ( !$language_list || index (  $language_list, $language_subtag_registry->{ iso639_2_code } ) >= 0) ) {
255
            $languages_hash->{$language_subtag_registry->{ iso639_2_code }} = $language_subtag_registry;
256
            $languages_hash->{$language_subtag_registry->{ iso639_2_code }} = $language_subtag_registry;
256
            push @languages_loop, $language_subtag_registry if not $language_list;
257
            push @languages_loop, $language_subtag_registry if not $language_list or not $priority_sorting;
257
        }
258
        }
258
    }
259
    }
259
    if ($language_list) {
260
    if ($language_list and $priority_sorting) {
260
        # sort @languages_loop into order defined in AdvancedSearchLanguages preference
261
        # sort @languages_loop into order defined in AdvancedSearchLanguages preference
261
        my @adv_search_languages = split /[,|]+/, $language_list;
262
        my @adv_search_languages = split /[,|]+/, $language_list;
262
        foreach my $adv_search_lang (@adv_search_languages){
263
        foreach my $adv_search_lang (@adv_search_languages){
(-)a/installer/data/mysql/atomicupdate/Bug_14912-Sort_Advanced_Search_Languages_by_priority.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AdvancedSearchLanguagesSort', '0', NULL, 'Use AdvancedSearchLanguages to sort the drop-down list. The leftmost language has the highest priority and appears on top of the drop-down.', 'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 9-14 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
9
('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
9
('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
10
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
10
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
11
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
11
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
12
('AdvancedSearchLanguagesSort','0',NULL,'Use AdvancedSearchLanguages to sort the drop-down list. The leftmost language has the highest priority and appears on top of the drop-down.','YesNo'),
12
('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'),
13
('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'),
13
('AgeRestrictionMarker','',NULL,'Markers for age restriction indication, e.g. FSK|PEGI|Age|','free'),
14
('AgeRestrictionMarker','',NULL,'Markers for age restriction indication, e.g. FSK|PEGI|Age|','free'),
14
('AgeRestrictionOverride','0',NULL,'Allow staff to check out an item with age restriction.','YesNo'),
15
('AgeRestrictionOverride','0',NULL,'Allow staff to check out an item with age restriction.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-1 / +8 lines)
Lines 92-97 Searching: Link Here
92
            - "ISO 639-2 language codes (separate values with | or ,)."
92
            - "ISO 639-2 language codes (separate values with | or ,)."
93
            - "For example, to limit listing to French and Italian, enter <em>ita|fre</em>."
93
            - "For example, to limit listing to French and Italian, enter <em>ita|fre</em>."
94
        -
94
        -
95
            - By default, sort advanced search languages
96
            - pref: AdvancedSearchLanguagesSort
97
              type: boolean
98
              choices:
99
                  yes: by priority
100
                  no: alphabetically
101
            - '. The leftmost language in the AdvancedSearchLanguages preference has the highest priority and appears on top of the drop-down list.'
102
        -
95
            - By default,
103
            - By default,
96
            - pref: expandedSearchOption
104
            - pref: expandedSearchOption
97
              type: boolean
105
              type: boolean
98
- 

Return to bug 14912