Commit graph

56 commits

Author SHA1 Message Date
Bernardo Gonzalez Kriegel
b9c4061479 Bug 12616: Locale in subscriptions not preselecting correctly
There is a problem if a language is present but
don't have ISO639-2 code. Locale pulldown on serial
suscription is malformed.

To reproduce on master:
a) remove some entries on language_rfc4646_to_iso639
b) go to Serials > New suscription
c) Put any value on Vendor and record, press Next>>
d) Look at locale pulldown, it must default to last
removed lang from a), also other langs has no value
and are also 'selected' on html

To test:
1) Reproduce the problem
2) Apply the patch
3) Add New suscription, pulldown must be fixed

NOTE: Deleted Urdu and Chinese.
      Master had both "selected" in the HTML.
      Applied patch, neither were added.
      Defaults to first item, which is blank meaning English.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-22 11:52:35 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Bernardo Gonzalez Kriegel
c3c7068709 Bug 12534 - PROG/CCSR deprecation: Make getlanguages() theme independent for opac
This patch removes a reference to prog theme on getlanguages()
when ENV var HTTP_ACCEPT_LANGUAGE is checked.

Changed to use sysprefs to find theme for opac and intranet

To test:
1) Apply the patch
2) Translate for a couple of languages: de-DE, fr-FR, es-ES, etc
3) Enable those languages for OPAC on I18N prefs
4) Using Firefox, clean all history/cookies
5) Change variable intl.accept_languages (will do several times)
 a) got to about:config
 b) search 'lang'
 c) look for the variable, double click, change to 'de-DE'
6) Go to opac page, must load in german
7) Repeat for each translated lang: clean > change val > reload opac
   On each case opac must load on configured language
8) Just to test, set variable on untranslated lang, opac page
must load on first value of list of enabled languages
9) prove t/Languages.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-14 09:01:08 -03:00
Mark Tompsett
bd3cab4a93 Bug 7841: quell warnings in C4::Languages
This patch removes some sources of warning messages thrown by
C4::Languages, particular getTranslatedLanguages() when running
Koha's web installer.

TEST PLAN
---------
1) Apply first patch
2) prove -v t/db_dependent/Languages.t
   -- There will be uninitialized string messages, etc.
3) Apply second patch (this one)
4) prove -v t/db_dependent/Languages.t
   -- Only one carp message will remain.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, no warnings, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 16:41:50 +00:00
Julian Maurice
76e39750b7 Bug 11848: Move language detection function in C4::Languages
Also store interface (intranet, opac) in context to not have to pass it
as parameter.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 04:29:34 +00:00
Galen Charlton
97bf5f258a Bug 10986: (follow-up) improve POD
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-19 17:40:35 +00:00
Jonathan Druart
3950a9c9eb Bug 10986: QA followup - fix various issues
This patch fixes some qa issues:

 FAIL   C4/Languages.pm
   FAIL   critic
        # Variables::ProhibitConditionalDeclarations: Got 1 violation(s).
 FAIL   installer/data/mysql/updatedatabase.pl
   FAIL   forbidden patterns
        forbidden pattern: merge marker (<<<<<<<) (line 7157)

 FAIL   installer/data/mysql/sysprefs.sql
   FAIL   sysprefs_order
        Not blocker: Sysprefs AdvancedSearchLanguages is bad placed (see bug 10610)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-19 17:20:38 +00:00
blou
92d021f989 Bug 10986: add system preference to limit the list of languages in advanced search
In Advanced Search, the list of available language is long and will only
get longer.  For a library offering books in 2-3 languages, that is
offering too many options to the user (most of the small libraries we
deal with only offer documents in two languages).

Code changes:
Languages.pm: Extract getAllLanguages to make a more customizable
getLanguages (have getAllLanguage call it, so rest of codebase is
oblivious to the change).  Build array returned based on system pref if
corresponding argument is set.

search.pl and opac-search.pl: call getLanguages instead of
getAllLanguages.

TESTING
0) All language codes are iso 639-2 (three characters)
1) in OPAC, Advanced search, open Language box, acknowledge 30+ items.
2) in Intranet, go to system preferences AdvancedSearchLanguages,
   enter "ita|eng"
3) back in OPAC, refresh screen, acknowledge only Italian and English
   are listed.
4) in Intranet, click Search then click "More options" to make the
   Language box appear.  Acknowledge limited options.
5) Regression Test: Back to the preference, empty the field then save.
   Go back to the OPAC and Intranet search, refresh the page, then the
   Language drop-box will now contain 30+ items.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-19 17:18:32 +00:00
eb92d94be1 Bug 10309 - New OPAC theme based on Bootstrap
The goal of this theme is to provide a fully-responsive OPAC which
offers a high level of functionality across multiple devices with varied
viewport sizes. Its style is based on the CCSR theme, with elements of
the Bootstrap framework providing default styling of buttons, menus,
modals, etc.

The Bootstrap grid is used everywhere, but Bootstrap's default
responsive breakpoints have been expanded to allow for better
flexibility for our needs.

All non-translation-depended files are in the root directory of this new
theme:

css, images, itemtypeimg, js, less, and lib. Languages.pm has been
modified to ignore the new directories when parsing the theme language
directories.

This theme introduces the use of LESS (http://lesscss.org/) to build
CSS. Three LESS files can be found in the "less" directory: mixins.less,
opac.less, and responsive.less. These three files are compiled into one
CSS file for production: opac.css. "Base" theme styles are found in
opac.less. A few "mixins" (http://lesscss.org/#-mixins) are found in
mixins.less. Any CSS which is conditional on specific media queries is
found in responsive.less.

At the template level some general sturctural changes have been made.
For the most part JavaScript is now at the end of each template as is
recommended for performance reasons. JavaScript formerly in
doc-head-close.inc is now in opac-bottom.inc.

In order to be able to maintain this structure and accommodate
page-specific scripts at the same time the use of BLOCK and PROCESS are
added. By default opac-bottom.inc will PROCESS a "jsinclude" block:

[% PROCESS jsinclude %]

Each page template in the theme must contain this block, even if it is
empty:

[% BLOCK jsinclude %][% END %]

Pages which require that page-specific JavaScript be inserted can add it
to the jsinclude block and it will appear correctly at the bottom of the
rendered page.

The same is true for page-specific CSS. Each page contains a cssinclude
block:

[% BLOCK cssinclude %][% END %]

...which is processed in doc-head-close.inc:

[% PROCESS cssinclude %]

Using these methods helps us maintain a strict separation of CSS links
and blocks (at the top of each page) and JavaScript (at the bottom). A
few exceptions are made for some JavaScript which must be processed
sooner: respond.js (https://github.com/scottjehl/Respond, conditionally
applied to Internet Explorer versions < 9 to allow for layout
responsiveness), the _() function required for JS translatability, and
Modernizr (http://modernizr.com/, a script which detects browser
features and allows us to conditionally load JavaScript based on
available features--or lack thereof).

Another new JavaScript dependency in this theme is enquire.js
(http://wicky.nillia.ms/enquire.js/), which lets us trigger JavaScript
events based on viewport size.

I have made an effort to re-indent the templates in a sane way,
eliminating trailing spaces and tabs. However, I have not wrapped lines
at a specific line length. In order to improve template legibility I
have also tried to insert comments indicating the origin of closing tags
like <div> or template directives like [% END %]:

</div> <!-- / .container-fluid -->

[% END # / IF ( OpacBrowseResults && busc ) %]

TESTING

Proper testing of this theme is no easy task: Every template has been
touched. Each page should work reasonable well at a variety of screen
dimensions. Pages should be tested under many conditions which are
controlled by toggling OPAC system preferences on and off. A variety of
devices, platforms, and browsers should be tested.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-14 23:13:05 +00:00
Mathieu Saby
8718629c5c Bug 8954: Make languages list in advanced search translatable (revision 1)
In opac-search.pl and search.pl, this patch moves the $lang variable from the end to the begining of the script, and use it as a parameter for getAllLanguages.
In Languages.pm, getAllLanguages function is modified :
- if no parameter is passed to the function, it returns english languages names
- if a $lang parameter conforming to RFC4646 syntax is passed :
-- the function returns languages names translated in $lang if possible
-- if a language name is not translated in $lang in database, the function returns english language name
To test, set your opac and staff interface in english and in other languages and check search.pl and opac-search.pl :
- If language names in your languages_description table are translated in the same language you use for your GUI, the language names in dropdown list will be translated in this language (+native name).
- If your GUI is in english, or in a language into whitch languages names are not translated in languages_description, the dropdown list will stay in english (+native name).

Signed-off-by: Marc Veron <veron@veron.ch>

Patch behaves as expected.

With Opac language set to French I got all languages with French language name.
With German (de-DE), I got only a few with German language names (and all other with English ones),
this was due to missing entries for de-DE in table language_descriptions.
This behaviour is consistent with the description above.

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

Tested language list in OPAC and staff advanced search is translated
properly after applying the patch. Checked that language switcher still
works like it should.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Fixed typo in POD.
2012-11-20 14:39:56 -05:00
Paul Poulain
e2cf59ac58 Bug 8997: Unnecessary call to getAllLanguages
In C4/Language, getTranslatedLanguages calls getAllLanguage, passes it
to _build_languages_arrayref, that does nothing of it. Removing this
dead code will clean & reduce SQL overhead

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
I tried switching between languages and enabling and disabling
languages, and could not see any change with the patch applied.

Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-20 07:19:55 -05:00
Paul Poulain
8449b14dcb Revert "Bug 8089: Use Koha::Cache for all caching"
This reverts commit 215abc8024.

The 3 patches for bug 8089 have been reverted, because they break
jenkins & Koha.
A follow-up has been provided, but it does not solve the problem on my
test server, it just changes the error message.

After a discussion with jared, Dobrica should work on another patch, so
the best option is to revert.
2012-09-12 14:12:41 +02:00
Paul Poulain
1d1615f918 Revert "Bug 8089: Correct cache timeout to 1000"
This reverts commit eefeef0c1f.
2012-09-12 13:45:40 +02:00
Jared Camins-Esakov
eefeef0c1f Bug 8089: Correct cache timeout to 1000
There was a typo in the original patch for bug 8089 which set the cache
timeout on getAllLanguages to 10000. Correct it to 1000.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-07 16:28:33 +02:00
Jared Camins-Esakov
215abc8024 Bug 8089: Use Koha::Cache for all caching
1. Replace all instances of memoize_memcached with appropriate calls
into Koha::Cache:
* reports/guided_reports.pl
* C4::Biblio::GetMarcStructure
* C4::Languages::getFrameworkLanguages
* C4::Languages::getAllLanguages
* C4::SQLHelper::GetPrimaryKeys
* C4::SQLHelper::_get_columns

2. Replace all references to memcached with the appropriate calls into
Koha::Cache in C4::Context.

Test plan :
* have DEBUG env set to 1
* reach addbiblio page to test the patch in Biblio.pm, or setup more than 1
  language
* you should see in the logs that you're reading and writing from cache
* run the test suite twice both with and without the following environment
  variables set:
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA
export CACHING_SYSTEM=memcached

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

I'm unsure about some of the caching times 10000 is a long long time,
but other than that, works fine.
2012-09-07 16:28:29 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
52afe06ddd Bug 6193 - Follow up: use SetEnv and remove memcached from koha-conf.xml
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Confirmed that memcached is still being used after the memcached configuration
in koha-conf.xml was removed, and the following two lines were added to
both virtual hosts in koha-httpd.conf:
SetEnv MEMCACHED_SERVERS "127.0.0.1:11211"
SetEnv MEMCACHED_NAMESPACE "KOHA"
2012-02-20 23:24:02 +01:00
Chris Cormack
efd26a44d5 Bug 7432 : Fixing caching for C4::Languages
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-15 10:26:26 +01:00
166f1668d8 Bug 6755 Web browser default lang != syspref selected langs
When Web browser default selected language doesn't belong to selected
languages list defined by syspref (language / opaclanguages), web pages
are returned in this language, which is wrong...

This patch get this behavior:

- If selected by user language is available (cookie), it is used.
- Otherwise, language is set to default web browser language.
- If this language doesn't belong to languages list (syspref),
  English is selected

Some code cleanup.

To test properly: don't forget to delete your cookies, and to test what
happens without and with cookie.
2011-09-26 23:26:09 +13:00
1457256b98 bug 4188: move PDF templates for printed purchase orders
The PDF templates for purchase orders now live in the
directory koha-tmpl/intranet-tmpl/prog/pdf to separate
them from code.  As no automatic translation system for
PDF files is currently implemented, I'm keeping them out
of the language subdirectories for now.

At present, there are two choices of templates for printing
purchase orders (AKA basket groups), controlled by setting
the OrderPdfFormat syspref:

pdfformat::layout2pages (two-page layout)
pdfformat::layout3pages (three-page layout)

To customize a template or to add a new one requires two steps:

* modifying the PDF; note that OpenOffice source files
  are included as a way of generating the PDF
* modifying the code in acqui/pdfformat/layout*.pm to
  position the order text onto the template

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-07-02 08:49:44 -04:00
Andrew Elwell
aa9b4d92cd POD Cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 08:38:59 -04:00
Donovan Jones
593a7d8e6a Bug 2505 - Add commented use warnings where missing in *.pm 2010-04-21 20:28:51 +12:00
Lars Wirzenius
7279f55b60 Fix FSF address in directory C4/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:56 -04:00
3d16451ac5 bug 1080 follow-up: make sure 'sound' isn't listed as a language
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-18 12:06:59 -05:00
6b24ddf91c graceful degradation if memcached option is not configured in koha-conf.xml
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-24 07:53:59 -04:00
32e65e451f Failing gracefully if Memoize::Memcached is not installed
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-24 07:33:02 -04:00
2c82872dcb Starting work on memoizing expensive functions with Memoize::Memcached
A patch will follow with the changes to the koha-conf.xml and with instructions on installing memcached

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-24 07:32:58 -04:00
8246a7dce8 Bugfix 3176 - Browser selected languages are not use by OPAC
This patch uses HTTP_ACCEPT_LANGUAGE web browser variable
to select OPAC available language.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-11 09:13:24 -05:00
Galen Charlton
786a1aa36a bug 3161: don't display blank language chooser
If more than one translation is installed but only one is active, a blank div
is displayed at the bottom of all pages in the intranet (and in the OPAC if the
opacchangelanguages system preference is ON), taking a bit of vertical real
estate needlessly.

Changed so that <div> for the language chooser is output
only if there is more than one enabled language.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-27 06:54:42 -05:00
Joshua Ferraro
9b41cf3b3e Fix for 2184 2008-07-14 08:39:14 -05:00
c4072c8fe9 Fixing some typos, including, I believe, Bug 2174 ("spelling error in web installer")
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 10:01:07 -05:00
Joshua Ferraro
faa9a39694 adding famfamfam iconset, improving isbn for amazon content, etc.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-07 21:20:22 -05:00
Joshua Ferraro
9a461cad22 don't show famfamfam for a language
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-04 16:17:55 -05:00
Joshua Ferraro
a7dbbe7697 fixes bug 1924: Language selection lists English only and that several times.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-18 00:10:48 -05:00
Joshua Ferraro
ed39d5bee4 remove warnings from Languages.pm
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-17 21:48:05 -05:00
Joshua Ferraro
2b28689ae8 fixing bug 1754: Hide language chooser if only one translation is available
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-17 21:28:31 -05:00
Joshua Ferraro
5bb6d117c5 handling multiple languages gracefully in sysprefs, allow the user to enable specific languages (and language groups)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-08 06:20:12 -06:00
Joshua Ferraro
802b13e5f5 fix for 1754; fixing I18N BiDi, improvements to handling of language
TODO: clean up the OPAC similarly

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-10 08:32:48 -06:00
Joe Atzberger
d50e96d50a Languages.pm - add a carp for bad arg, return undef upon failure
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:04:57 -06:00
Joe Atzberger
e660a339a8 Members.pm - BEGIN block VERSION and vars related to export.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:34 -06:00
Joe Atzberger
b98bbef809 Languages.pm - BEGIN block VERSION and vars related to export.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:32 -06:00
14b0381408 Fixes two bugs affecting Web installer when used with Unimarc/French
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:17 -06:00
Mason James
cf459b6ddd language_script_bidi table typo
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 02:04:45 -06:00
Joshua Ferraro
c7f22f84ad additional updates to language support
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:59:47 -06:00
Joshua Ferraro
678b52a2f2 refactoring changelanguage, better var names, etc.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:59:38 -06:00
Joshua Ferraro
922386c6a0 fix the 'current language' change language display
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:59:16 -06:00
Joshua Ferraro
6072ccc28e Improvements to handling language subtags
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:59:10 -06:00
Joshua Ferraro
aabd1c57a0 rename internal function
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:59:04 -06:00
Joshua Ferraro
b0dc874d4b Switching Languages.pm to EXPORT_OK -- don't export
all functions by default. Adding languages_loop to all
templates

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-05 02:58:41 -06:00
Joshua Ferraro
f66d9131bf fixing problem with adv search on staff client
Issue was that language limit was being set with a
relation (=) but no operand

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-28 12:47:17 -06:00