Bugzilla – Attachment 12981 Details for
Bug 2832
Make alphabet localizable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2832 - Make alphabet localizable
Bug-2832---Make-alphabet-localizable.patch (text/plain), 6.34 KB, created by
Mirko Tietgen
on 2012-10-20 22:17:46 UTC
(
hide
)
Description:
Bug 2832 - Make alphabet localizable
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2012-10-20 22:17:46 UTC
Size:
6.34 KB
patch
obsolete
>From 12becb964189c84fee4844e8c0ac8cdffc2c9d34 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Wed, 10 Oct 2012 16:43:19 +0200 >Subject: [PATCH] Bug 2832 - Make alphabet localizable >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Adds the "alphabet" syspref, which can hold a space separated list >of charachters, which can be expanded into browse links when needed. > >To test: >- Make sure to run updatedatabase >- Check that the "alphabet" syspref was added under "I18N/L10N preferences" >- Check that browse links are displayed Home ⺠Patrons >- Add some weird charachters like ÃÃà to "alphabet" and check that the > browse links are still displayed ok > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > .../nb-NO/1-Obligatorisk/system_preferences.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/i18n_l10n.pref | 5 +++++ > .../prog/en/modules/members/member.tt | 4 ++-- > members/members-home.pl | 3 +-- > 6 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >index 0ab90c3..88d0b23 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >@@ -25,5 +25,6 @@ UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'language'; > 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 B C D E F G H I J K L M N O P Q R S T U V W X Y Z à à Ã' WHERE variable = 'alphabet'; > > UPDATE systempreferences SET value = '<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a></li><li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a></li><li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a></li>' WHERE variable = 'OPACSearchForTitleIn'; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index a4fceea..d0ed16c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -386,3 +386,4 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'); > INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index e67bf3e..b719a80 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6011,6 +6011,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.09.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet that can be expanded into browse links, e.g. on Home > Patrons',NULL,'free')"); >+ print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >index 02b8de6..cc6700b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >@@ -31,3 +31,8 @@ I18N/L10N: > - "Enable the following languages on the OPAC:" > - pref: opaclanguages > type: opac-languages >+ - >+ - "Use the alphabet" >+ - pref: alphabet >+ class: long >+ - for lists of browsable letters. This should be a space separated list of uppercase letters. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index 64e410f..1a7079e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -24,8 +24,8 @@ > > <div class="browse"> > Browse by last name: >- [% FOREACH letter IN letters %] >- <a href="/cgi-bin/koha/members/member.pl?quicksearch=1&surname=[% letter.letter %]">[% letter.letter %]</a> >+ [% FOREACH letter IN alphabet.split(' ') %] >+ <a href="/cgi-bin/koha/members/member.pl?quicksearch=1&surname=[% letter %]">[% letter %]</a> > [% END %] > </div> > >diff --git a/members/members-home.pl b/members/members-home.pl >index 830800e..61eb83a 100755 >--- a/members/members-home.pl >+++ b/members/members-home.pl >@@ -80,7 +80,6 @@ $template->param( > "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1", > no_add => $no_add, > ); >-my @letters = map { {letter => $_} } ( 'A' .. 'Z'); >-$template->param( letters => \@letters ); >+$template->param( 'alphabet' => C4::Context->preference('alphabet') ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2832
:
12761
|
12924
| 12981 |
13021
|
13119