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

(-)a/C4/Installer.pm (-2 / +2 lines)
Lines 474-480 sub set_version_syspref { Link Here
474
474
475
  $installer->set_languages_syspref();
475
  $installer->set_languages_syspref();
476
476
477
Add the installation language to 'language' and 'opaclanguages' system preferences
477
Add the installation language to 'language' and 'OPACLanguages' system preferences
478
if different from 'en'
478
if different from 'en'
479
479
480
=cut
480
=cut
Lines 490-496 sub set_languages_syspref { Link Here
490
    my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'");
490
    my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'");
491
    $pref->execute("en,$language");
491
    $pref->execute("en,$language");
492
    # opac
492
    # opac
493
    $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='opaclanguages'");
493
    $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='OPACLanguages'");
494
    $pref->execute("en,$language");
494
    $pref->execute("en,$language");
495
495
496
    C4::Context->clear_syspref_cache();
496
    C4::Context->clear_syspref_cache();
(-)a/C4/Languages.pm (-2 / +2 lines)
Lines 116-122 sub getTranslatedLanguages { Link Here
116
    my @enabled_languages =
116
    my @enabled_languages =
117
      ( $interface && $interface eq 'intranet' )
117
      ( $interface && $interface eq 'intranet' )
118
      ? split ",", C4::Context->preference('language')
118
      ? split ",", C4::Context->preference('language')
119
      : split ",", C4::Context->preference('opaclanguages');
119
      : split ",", C4::Context->preference('OPACLanguages');
120
120
121
    my $cache = Koha::Caches->get_instance;
121
    my $cache = Koha::Caches->get_instance;
122
    my $cache_key = "languages_${interface}_${theme}";
122
    my $cache_key = "languages_${interface}_${theme}";
Lines 609-615 sub getlanguage { Link Here
609
    my $language;
609
    my $language;
610
610
611
    my $preference_to_check =
611
    my $preference_to_check =
612
      $interface eq 'intranet' ? 'language' : 'opaclanguages';
612
      $interface eq 'intranet' ? 'language' : 'OPACLanguages';
613
    # Get the available/valid languages list
613
    # Get the available/valid languages list
614
    my @languages;
614
    my @languages;
615
    my $preference_value = C4::Context->preference($preference_to_check);
615
    my $preference_value = C4::Context->preference($preference_to_check);
(-)a/installer/data/mysql/atomicupdate/bug_27491-replace_opaclanguages_with_OPAClanguages_syspref.perl (+13 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    $dbh->do(q{UPDATE systempreferences set variable="OPACLanguages" WHERE variable="opaclanguages"});
5
6
    # or perform some test and warn
7
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
8
    #    warn "There is something wrong";
9
    # }
10
11
    # Always end with this (adjust the bug info)
12
    NewVersion( $DBversion, 27491, "Description");
13
}
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql (-1 / +1 lines)
Lines 21-27 UPDATE systempreferences SET value = 'M|Mme|Mlle' WHERE variable = 'BorrowersTit Link Here
21
UPDATE systempreferences SET value = '676a' WHERE variable = 'itemcallnumber';
21
UPDATE systempreferences SET value = '676a' WHERE variable = 'itemcallnumber';
22
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'language';
22
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'language';
23
UPDATE systempreferences SET value = 'Ma bibliothèque' WHERE variable = 'LibraryName';
23
UPDATE systempreferences SET value = 'Ma bibliothèque' WHERE variable = 'LibraryName';
24
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'opaclanguages';
24
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'OPACLanguages';
25
UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay';
25
UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay';
26
UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
26
UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
27
UPDATE systempreferences SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,ris' WHERE variable = 'OpacExportOptions';
27
UPDATE systempreferences SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,ris' WHERE variable = 'OpacExportOptions';
(-)a/installer/data/mysql/localization/de-DE/custom.sql (-1 / +1 lines)
Lines 37-41 UPDATE systempreferences SET value = '0.07|0.19|0.00' WHERE variable = 'gist'; Link Here
37
UPDATE systempreferences SET value = 'Dieser Text wird über den Systemparameter <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> konfiguriert.' where variable = 'RoutingListNote';
37
UPDATE systempreferences SET value = 'Dieser Text wird über den Systemparameter <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> konfiguriert.' where variable = 'RoutingListNote';
38
UPDATE systempreferences SET value = 'barcode stocknumber' WHERE variable = 'uniqueitemfields';
38
UPDATE systempreferences SET value = 'barcode stocknumber' WHERE variable = 'uniqueitemfields';
39
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'language';
39
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'language';
40
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'opaclanguages';
40
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'OPACLanguages';
41
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';
41
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';
(-)a/installer/data/mysql/localization/it-IT/custom.sql (-1 / +1 lines)
Lines 47-53 UPDATE systempreferences SET value = '5' WHERE variable = 'maxreserves'; Link Here
47
UPDATE systempreferences SET value = '0' WHERE variable = 'OpacAuthorities';
47
UPDATE systempreferences SET value = '0' WHERE variable = 'OpacAuthorities';
48
UPDATE systempreferences SET value = 'title' WHERE variable = 'OPACdefaultSortField';
48
UPDATE systempreferences SET value = 'title' WHERE variable = 'OPACdefaultSortField';
49
UPDATE systempreferences SET value = 'asc' WHERE variable = 'OPACdefaultSortOrder';
49
UPDATE systempreferences SET value = 'asc' WHERE variable = 'OPACdefaultSortOrder';
50
UPDATE systempreferences SET value = 'en,it-IT' WHERE variable = 'opaclanguages';
50
UPDATE systempreferences SET value = 'en,it-IT' WHERE variable = 'OPACLanguages';
51
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';
51
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';
52
UPDATE systempreferences SET value = '<h3>Benvenuto !!</h3>' WHERE variable = 'OpacMainUserBlock';
52
UPDATE systempreferences SET value = '<h3>Benvenuto !!</h3>' WHERE variable = 'OpacMainUserBlock';
53
UPDATE systempreferences SET value = 'Links importanti qui.' WHERE variable = 'OpacNav';
53
UPDATE systempreferences SET value = 'Links importanti qui.' WHERE variable = 'OpacNav';
(-)a/installer/data/mysql/localization/nb-NO/custom.sql (-1 / +1 lines)
Lines 22-28 UPDATE systempreferences SET value = 'Fru|Frøken|Herr' WHERE variable = 'Borrow Link Here
22
UPDATE systempreferences SET value = 'FR' WHERE variable = 'CurrencyFormat';
22
UPDATE systempreferences SET value = 'FR' WHERE variable = 'CurrencyFormat';
23
UPDATE systempreferences SET value = 'metric' WHERE variable = 'dateformat';
23
UPDATE systempreferences SET value = 'metric' WHERE variable = 'dateformat';
24
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'language';
24
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'language';
25
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'opaclanguages';
25
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'OPACLanguages';
26
UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock';
26
UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock';
27
UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav';
27
UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav';
28
UPDATE systempreferences SET value = '<a href="https://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a><a href="https://scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a><a href="https://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a>' WHERE variable = 'OPACSearchForTitleIn';
28
UPDATE systempreferences SET value = '<a href="https://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a><a href="https://scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a><a href="https://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a>' WHERE variable = 'OPACSearchForTitleIn';
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 412-418 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
412
('OPACItemsResultsDisplay','0','','If OFF : show only the status of items in result list.If ON : show full location of items (branch+location+callnumber) as in staff interface','YesNo'),
412
('OPACItemsResultsDisplay','0','','If OFF : show only the status of items in result list.If ON : show full location of items (branch+location+callnumber) as in staff interface','YesNo'),
413
('OpacKohaUrl','1',NULL,'Show \'Powered by Koha\' text on OPAC footer.',NULL),
413
('OpacKohaUrl','1',NULL,'Show \'Powered by Koha\' text on OPAC footer.',NULL),
414
('OpacLangSelectorMode','both','top|both|footer','Select the location to display the language selector in OPAC','Choice'),
414
('OpacLangSelectorMode','both','top|both|footer','Select the location to display the language selector in OPAC','Choice'),
415
('opaclanguages','en',NULL,'Set the default language in the OPAC.','Languages'),
415
('OPACLanguages','en',NULL,'Set the default language in the OPAC.','Languages'),
416
('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'),
416
('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'),
417
('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'),
417
('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'),
418
('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'),
418
('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'),
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 / +1 lines)
Lines 25-31 UPDATE systempreferences SET value = '1' WHERE variable = 'ExtendedPatronAttribu Link Here
25
UPDATE systempreferences SET value = '0.20' WHERE variable = 'gist';
25
UPDATE systempreferences SET value = '0.20' WHERE variable = 'gist';
26
UPDATE systempreferences SET value = '942hv' WHERE variable = 'itemcallnumber';
26
UPDATE systempreferences SET value = '942hv' WHERE variable = 'itemcallnumber';
27
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'language';
27
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'language';
28
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'opaclanguages';
28
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'OPACLanguages';
29
UPDATE systempreferences SET value = 'Добро пожаловать в АБИС Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
29
UPDATE systempreferences SET value = 'Добро пожаловать в АБИС Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
30
UPDATE systempreferences SET value = 'Здесь будут важные ссылки.' WHERE variable = 'OpacNav';
30
UPDATE systempreferences SET value = 'Здесь будут важные ссылки.' WHERE variable = 'OpacNav';
31
UPDATE systempreferences SET value = '1' WHERE variable = 'patronimages';
31
UPDATE systempreferences SET value = '1' WHERE variable = 'patronimages';
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql (-1 / +1 lines)
Lines 55-61 UPDATE systempreferences SET value='metric' WHERE variable='dateformat'; Link Here
55
55
56
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='language';
56
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='language';
57
57
58
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='opaclanguages';
58
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='OPACLanguages';
59
59
60
-- Logs - Протоколы
60
-- Logs - Протоколы
61
61
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref (-1 / +1 lines)
Lines 44-50 I18N/L10N: Link Here
44
        - patrons to change the language they see on the OPAC.
44
        - patrons to change the language they see on the OPAC.
45
    -
45
    -
46
        - "Enable the following languages on the OPAC:"
46
        - "Enable the following languages on the OPAC:"
47
        - pref: opaclanguages
47
        - pref: OPACLanguages
48
          type: opac-languages
48
          type: opac-languages
49
        - "This list can be sorted to modify the order of the languages on the interface."
49
        - "This list can be sorted to modify the order of the languages on the interface."
50
    -
50
    -
(-)a/misc/cronjobs/build_browser_and_cloud.pl (-1 / +1 lines)
Lines 135-141 if ($browser_tag) { Link Here
135
    print "inserting datas in browser table\n" unless $batch;
135
    print "inserting datas in browser table\n" unless $batch;
136
    # read existing classification table is possible
136
    # read existing classification table is possible
137
    my $classification;
137
    my $classification;
138
    if (C4::Context->preference('opaclanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') {
138
    if (C4::Context->preference('OPACLanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') {
139
        $classification = dewey_french();
139
        $classification = dewey_french();
140
    }
140
    }
141
141
(-)a/t/db_dependent/Auth.t (-1 / +1 lines)
Lines 207-213 subtest 'checkpw lockout tests' => sub { Link Here
207
    # Make sure 'EnableOpacSearchHistory' is set
207
    # Make sure 'EnableOpacSearchHistory' is set
208
    t::lib::Mocks::mock_preference('EnableOpacSearchHistory',1);
208
    t::lib::Mocks::mock_preference('EnableOpacSearchHistory',1);
209
    # Enable es-ES for the OPAC and staff interfaces
209
    # Enable es-ES for the OPAC and staff interfaces
210
    t::lib::Mocks::mock_preference('opaclanguages','en,es-ES');
210
    t::lib::Mocks::mock_preference('OPACLanguages','en,es-ES');
211
    t::lib::Mocks::mock_preference('language','en,es-ES');
211
    t::lib::Mocks::mock_preference('language','en,es-ES');
212
212
213
    # we need a session cookie
213
    # we need a session cookie
(-)a/t/db_dependent/Koha/ItemTypes.t (-1 / +1 lines)
Lines 102-108 ok( defined($type), 'second result' ); Link Here
102
is_deeply( $type->unblessed, $child2->unblessed, "We got back the same object" );
102
is_deeply( $type->unblessed, $child2->unblessed, "We got back the same object" );
103
103
104
t::lib::Mocks::mock_preference('language', 'en');
104
t::lib::Mocks::mock_preference('language', 'en');
105
t::lib::Mocks::mock_preference('opaclanguages', 'en');
105
t::lib::Mocks::mock_preference('OPACLanguages', 'en');
106
my $itemtypes = Koha::ItemTypes->search_with_localization;
106
my $itemtypes = Koha::ItemTypes->search_with_localization;
107
is( $itemtypes->count, $initial_count + 4, 'We added 4 item types' );
107
is( $itemtypes->count, $initial_count + 4, 'We added 4 item types' );
108
my $first_itemtype = $itemtypes->next;
108
my $first_itemtype = $itemtypes->next;
(-)a/t/db_dependent/Search.t (-2 / +1 lines)
Lines 137-143 $contextmodule->mock('preference', sub { Link Here
137
        return '';
137
        return '';
138
    } elsif ($pref eq 'opacthemes') {
138
    } elsif ($pref eq 'opacthemes') {
139
        return 'bootstrap';
139
        return 'bootstrap';
140
    } elsif ($pref eq 'opaclanguages') {
140
    } elsif ($pref eq 'OPACLanguages') {
141
        return 'en';
141
        return 'en';
142
    } elsif ($pref eq 'AlternateHoldingsField') {
142
    } elsif ($pref eq 'AlternateHoldingsField') {
143
        return '490av';
143
        return '490av';
144
- 

Return to bug 27491