Bug 14252: (Followup) Fixed issues pointed to in comment #40

Based on Mark's inputs in comment #40 -

[1] selected 'mast' (short of 'masthead') and updated :
   (a) bug_14252-OpacLangSelectorMode_syspref.sql
   (b) sysprefs.sql
   (c) opac.pref
[2] Reduced the calls to Koha.Preference() from :
   (a) masthead.inc
   (b) opac-bottom.inc

After applying this patch, update the database once for it to pick
up the new option values -'both|mast|foot'.

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@theke.io>
This commit is contained in:
Indranil Das Gupta 2015-06-01 05:26:31 +05:30 committed by Tomas Cohen Arazi
parent a2478a708b
commit 8da9d099c6
5 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
-- --
-- Adds OpacLangSelectorMode syspref for bug 14252 -- Adds OpacLangSelectorMode syspref for bug 14252
-- --
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLangSelectorMode','both','both|head|foot','Select the location to display the language selector','Choice'); INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLangSelectorMode','both','both|mast|foot','Select the location to display the language selector','Choice');

View file

@ -269,7 +269,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'), ('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
('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'), ('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), ('OpacKohaUrl','1',NULL,'Show \'Powered by Koha\' text on OPAC footer.',NULL),
('OpacLangSelectorMode','both','both|head|foot','Select the location to display the language selector','Choice'), ('OpacLangSelectorMode','both','both|mast|foot','Select the location to display the language selector','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'), ('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'), ('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'),

View file

@ -322,7 +322,7 @@ OPAC:
- pref: OpacLangSelectorMode - pref: OpacLangSelectorMode
choices: choices:
both: "both masthead and footer" both: "both masthead and footer"
head: "only header" mast: "only masthead"
foot: "only footer" foot: "only footer"
Features: Features:
- -

View file

@ -1,4 +1,5 @@
[% USE Koha %] [% USE Koha %]
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
<div id="wrap"> <div id="wrap">
<div id="header-region" class="noprint"> <div id="header-region" class="noprint">
<div class="navbar navbar-inverse navbar-static-top"> <div class="navbar navbar-inverse navbar-static-top">
@ -71,7 +72,7 @@
<a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a> <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
<div id="members"> <div id="members">
<ul class="nav pull-right"> <ul class="nav pull-right">
[% IF ( Koha.Preference( 'OpacLangSelectorMode' ) == 'both' ) || ( Koha.Preference( 'OpacLangSelectorMode' ) == 'head' ) %] [% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'mast' %]
[% IF ( opaclanguagesdisplay ) %] [% IF ( opaclanguagesdisplay ) %]
[% IF ( languages_loop && opaclanguagesdisplay ) %] [% IF ( languages_loop && opaclanguagesdisplay ) %]
[% UNLESS ( one_language_enabled ) %] [% UNLESS ( one_language_enabled ) %]

View file

@ -1,4 +1,5 @@
[% UNLESS ( is_popup ) %] [% UNLESS ( is_popup ) %]
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
[% IF ( opaccredits ) %] [% IF ( opaccredits ) %]
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
@ -29,7 +30,7 @@
[% END # / OpacKohaUrl %] [% END # / OpacKohaUrl %]
</div> <!-- / #wrap in masthead.inc --> </div> <!-- / #wrap in masthead.inc -->
[% IF ( Koha.Preference( 'OpacLangSelectorMode' ) == 'both' ) || ( Koha.Preference( 'OpacLangSelectorMode' ) == 'foot' ) %] [% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'foot' %]
[% IF ( opaclanguagesdisplay ) %] [% IF ( opaclanguagesdisplay ) %]
[% IF ( languages_loop && opaclanguagesdisplay ) %] [% IF ( languages_loop && opaclanguagesdisplay ) %]
[% UNLESS ( one_language_enabled ) %] [% UNLESS ( one_language_enabled ) %]