Bug 9735 - Let the language be selected through URL parameters
authorTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 3 Mar 2013 00:25:23 +0000 (21:25 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 4 Oct 2013 03:26:09 +0000 (03:26 +0000)
commit3b7c6932e57300b04d0de1288822e7aba58efc59
tree0eda61ae7b8e6f52af3670a6f3ec9b7157206b68
parent946908403f7119b7b845767f4105732474cc2356
Bug 9735 - Let the language be selected through URL parameters

Passing language=<valid_language_code> as a parameter in any Koha's URL
can be used to set the desired language.
This patch touches
 - C4::Templates
 - C4::Auth

Adds a new method getlanguagecookie that does exactly that, for use in
get_template_and_user.
Also modifies getlanguage so it checks (a) if there's a 'language'
parameter in the CGI object and (b) checks if its valid and enabled for
the desired interface.

To test:
* Without the patch
  - access any koha page
  - add ?language=code to the end of the URL (change code for a valid language code
    it needs to be installed using perl translate install code, and enabled either for
    the staff or opac interface, depending where are you testing)
  - Nothing happens with the language parameter
* With the patch
  - access any koha page
  - add ?language=code (the same as before) and hit enter
  - the language should be changed to the one you chose
  - if you browse through some links, you will see
    koha 'remembers' the language you passed as a parameter
    (i.e. the language cookie has been updated).

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Brendan <brendan@bywatersolutions.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Works very well. No errors.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
More comments on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Auth.pm
C4/Templates.pm