Browse Source

Bug 27491: Rename system preference opaclanguages to OPACLanguages

Test Plan:

1. Go to Administration
2. Go to System Preferences
3. Find 'opaclanguages' (note the lack of capitalisation)
4. Apply patch
5. Repeat step 1 and 2
6. Find 'OPACLanguages' (note the use of capitalisation)

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Mazen Khallaf 3 years ago
committed by Jonathan Druart
parent
commit
c90ee1be60
  1. 4
      C4/Installer.pm
  2. 4
      C4/Languages.pm
  3. 13
      installer/data/mysql/atomicupdate/bug_27491-replace_opaclanguages_with_OPAClanguages_syspref.perl
  4. 2
      installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql
  5. 2
      installer/data/mysql/localization/de-DE/custom.sql
  6. 2
      installer/data/mysql/localization/it-IT/custom.sql
  7. 2
      installer/data/mysql/localization/nb-NO/custom.sql
  8. 2
      installer/data/mysql/mandatory/sysprefs.sql
  9. 2
      installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
  10. 2
      installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql
  11. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref
  12. 2
      misc/cronjobs/build_browser_and_cloud.pl
  13. 2
      t/db_dependent/Auth.t
  14. 2
      t/db_dependent/Koha/ItemTypes.t
  15. 2
      t/db_dependent/Search.t

4
C4/Installer.pm

@ -474,7 +474,7 @@ sub set_version_syspref {
$installer->set_languages_syspref();
Add the installation language to 'language' and 'opaclanguages' system preferences
Add the installation language to 'language' and 'OPACLanguages' system preferences
if different from 'en'
=cut
@ -490,7 +490,7 @@ sub set_languages_syspref {
my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'");
$pref->execute("en,$language");
# opac
$pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='opaclanguages'");
$pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='OPACLanguages'");
$pref->execute("en,$language");
C4::Context->clear_syspref_cache();

4
C4/Languages.pm

@ -116,7 +116,7 @@ sub getTranslatedLanguages {
my @enabled_languages =
( $interface && $interface eq 'intranet' )
? split ",", C4::Context->preference('language')
: split ",", C4::Context->preference('opaclanguages');
: split ",", C4::Context->preference('OPACLanguages');
my $cache = Koha::Caches->get_instance;
my $cache_key = "languages_${interface}_${theme}";
@ -609,7 +609,7 @@ sub getlanguage {
my $language;
my $preference_to_check =
$interface eq 'intranet' ? 'language' : 'opaclanguages';
$interface eq 'intranet' ? 'language' : 'OPACLanguages';
# Get the available/valid languages list
my @languages;
my $preference_value = C4::Context->preference($preference_to_check);

13
installer/data/mysql/atomicupdate/bug_27491-replace_opaclanguages_with_OPAClanguages_syspref.perl

@ -0,0 +1,13 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
$dbh->do(q{UPDATE systempreferences set variable="OPACLanguages" WHERE variable="opaclanguages"});
# or perform some test and warn
# if( !column_exists( 'biblio', 'biblionumber' ) ) {
# warn "There is something wrong";
# }
# Always end with this (adjust the bug info)
NewVersion( $DBversion, 27491, "Description");
}

2
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql

@ -21,7 +21,7 @@ UPDATE systempreferences SET value = 'M|Mme|Mlle' WHERE variable = 'BorrowersTit
UPDATE systempreferences SET value = '676a' WHERE variable = 'itemcallnumber';
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'language';
UPDATE systempreferences SET value = 'Ma bibliothèque' WHERE variable = 'LibraryName';
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'OPACLanguages';
UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay';
UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
UPDATE systempreferences SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,ris' WHERE variable = 'OpacExportOptions';

2
installer/data/mysql/localization/de-DE/custom.sql

@ -37,5 +37,5 @@ UPDATE systempreferences SET value = '0.07|0.19|0.00' WHERE variable = 'TaxRates
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';
UPDATE systempreferences SET value = 'barcode stocknumber' WHERE variable = 'uniqueitemfields';
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'language';
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'OPACLanguages';
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';

2
installer/data/mysql/localization/it-IT/custom.sql

@ -47,7 +47,7 @@ UPDATE systempreferences SET value = '5' WHERE variable = 'maxreserves';
UPDATE systempreferences SET value = '0' WHERE variable = 'OpacAuthorities';
UPDATE systempreferences SET value = 'title' WHERE variable = 'OPACdefaultSortField';
UPDATE systempreferences SET value = 'asc' WHERE variable = 'OPACdefaultSortOrder';
UPDATE systempreferences SET value = 'en,it-IT' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 'en,it-IT' WHERE variable = 'OPACLanguages';
UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay';
UPDATE systempreferences SET value = '<h3>Benvenuto !!</h3>' WHERE variable = 'OpacMainUserBlock';
UPDATE systempreferences SET value = 'Links importanti qui.' WHERE variable = 'OpacNav';

2
installer/data/mysql/localization/nb-NO/custom.sql

@ -22,7 +22,7 @@ UPDATE systempreferences SET value = 'Fru|Frøken|Herr' WHERE variable = 'Borrow
UPDATE systempreferences SET value = 'FR' WHERE variable = 'CurrencyFormat';
UPDATE systempreferences SET value = 'metric' WHERE variable = 'dateformat';
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'language';
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'OPACLanguages';
UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock';
UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav';
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';

2
installer/data/mysql/mandatory/sysprefs.sql

@ -412,7 +412,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('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'),
('OpacKohaUrl','1',NULL,'Show \'Powered by Koha\' text on OPAC footer.',NULL),
('OpacLangSelectorMode','both','top|both|footer','Select the location to display the language selector in OPAC','Choice'),
('opaclanguages','en',NULL,'Set the default language in the OPAC.','Languages'),
('OPACLanguages','en',NULL,'Set the default language in the OPAC.','Languages'),
('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'),
('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'),
('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'),

2
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql

@ -25,7 +25,7 @@ UPDATE systempreferences SET value = '1' WHERE variable = 'ExtendedPatronAttribu
UPDATE systempreferences SET value = '0.20' WHERE variable = 'TaxRates';
UPDATE systempreferences SET value = '942hv' WHERE variable = 'itemcallnumber';
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'language';
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'OPACLanguages';
UPDATE systempreferences SET value = 'Добро пожаловать в АБИС Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
UPDATE systempreferences SET value = 'Здесь будут важные ссылки.' WHERE variable = 'OpacNav';
UPDATE systempreferences SET value = '1' WHERE variable = 'patronimages';

2
installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql

@ -55,7 +55,7 @@ UPDATE systempreferences SET value='metric' WHERE variable='dateformat';
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='language';
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='opaclanguages';
UPDATE systempreferences SET value='ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable='OPACLanguages';
-- Logs - Протоколы

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref

@ -44,7 +44,7 @@ I18N/L10N:
- patrons to change the language they see on the OPAC.
-
- "Enable the following languages on the OPAC:"
- pref: opaclanguages
- pref: OPACLanguages
type: opac-languages
- "This list can be sorted to modify the order of the languages on the interface."
-

2
misc/cronjobs/build_browser_and_cloud.pl

@ -135,7 +135,7 @@ if ($browser_tag) {
print "inserting datas in browser table\n" unless $batch;
# read existing classification table is possible
my $classification;
if (C4::Context->preference('opaclanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') {
if (C4::Context->preference('OPACLanguages') =~ m/^fr/i && $browser_tag eq '676' & $browser_subfield eq 'a') {
$classification = dewey_french();
}

2
t/db_dependent/Auth.t

@ -207,7 +207,7 @@ subtest 'checkpw lockout tests' => sub {
# Make sure 'EnableOpacSearchHistory' is set
t::lib::Mocks::mock_preference('EnableOpacSearchHistory',1);
# Enable es-ES for the OPAC and staff interfaces
t::lib::Mocks::mock_preference('opaclanguages','en,es-ES');
t::lib::Mocks::mock_preference('OPACLanguages','en,es-ES');
t::lib::Mocks::mock_preference('language','en,es-ES');
# we need a session cookie

2
t/db_dependent/Koha/ItemTypes.t

@ -102,7 +102,7 @@ ok( defined($type), 'second result' );
is_deeply( $type->unblessed, $child2->unblessed, "We got back the same object" );
t::lib::Mocks::mock_preference('language', 'en');
t::lib::Mocks::mock_preference('opaclanguages', 'en');
t::lib::Mocks::mock_preference('OPACLanguages', 'en');
my $itemtypes = Koha::ItemTypes->search_with_localization;
is( $itemtypes->count, $initial_count + 4, 'We added 4 item types' );
my $first_itemtype = $itemtypes->next;

2
t/db_dependent/Search.t

@ -137,7 +137,7 @@ $contextmodule->mock('preference', sub {
return '';
} elsif ($pref eq 'opacthemes') {
return 'bootstrap';
} elsif ($pref eq 'opaclanguages') {
} elsif ($pref eq 'OPACLanguages') {
return 'en';
} elsif ($pref eq 'AlternateHoldingsField') {
return '490av';

Loading…
Cancel
Save