Bugzilla – Attachment 64019 Details for
Bug 18718
Language selector in staff header menu similar to OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18718: Language selector in staff header menu similar to OPAC
SIGNED-OFF-Bug-18718-Language-selector-in-staff-he.patch (text/plain), 10.16 KB, created by
Josef Moravec
on 2017-06-06 04:31:11 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18718: Language selector in staff header menu similar to OPAC
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-06-06 04:31:11 UTC
Size:
10.16 KB
patch
obsolete
>From 40c884a10dae08b8d6e96179376783a71349e8c5 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 2 Jun 2017 12:11:47 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 18718: Language selector in staff header > menu similar to OPAC > >This patch adds a language selector menu to the top menu of staff client >similar to the OPAC. >Display of language selectors at top, bottom or both can be configured >with system preference StaffLangSelectorModer. It defaults to bottom. > >To test: >- Apply patch >- Udate database >- Restart plack and memchached >- Go to staff client, verify that language selector displays at > the bottom of the page (as before) >- Go to system preferences, verify that there is a new preference > StaffLanguageSelectorMode (name similar to the sypref ror OPAC), and > that it is set to 'footer' >- Change mode for top, both and footer and verify, go to staff client > and verify for each that the language selector displays as appropriate > >(Amended for comment #2 2017-06-02 mv) > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > ...icupdate_bug_18718_Language_Selector_Staff.perl | 13 +++++++++ > installer/data/mysql/sysprefs.sql | 3 ++- > .../intranet-tmpl/prog/en/includes/header.inc | 1 + > .../prog/en/includes/intranet-bottom.inc | 4 +-- > .../prog/en/includes/langmenu-staff-top.inc | 31 ++++++++++++++++++++++ > .../en/modules/admin/preferences/staff_client.pref | 7 +++++ > 6 files changed, 56 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/atomicupdate_bug_18718_Language_Selector_Staff.perl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/langmenu-staff-top.inc > >diff --git a/installer/data/mysql/atomicupdate/atomicupdate_bug_18718_Language_Selector_Staff.perl b/installer/data/mysql/atomicupdate/atomicupdate_bug_18718_Language_Selector_Staff.perl >new file mode 100644 >index 0000000..8a49955 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/atomicupdate_bug_18718_Language_Selector_Staff.perl >@@ -0,0 +1,13 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do("INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff client','Choice')" ); >+ >+ # or perform some test and warn >+ # if( !column_exists( 'biblio', 'biblionumber' ) ) { >+ # warn "There is something wrong"; >+ # } >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 18718 - Language selector in staff header menu similar to OPAC )\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 0bd8cac..c04d77d 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -337,7 +337,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), > ('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','Choice'), >+('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'), > ('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'), >@@ -493,6 +493,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'), > ('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'), > ('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'), >+('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff client','Choice'), > ('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), > ('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'), > ('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 2c88c6c..7573ac2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -97,6 +97,7 @@ > </li> > </ul> > </li> >+ [% INCLUDE 'langmenu-staff-top.inc' %] > <li> > <a class="toplinks" href="/cgi-bin/koha/help.pl" id="helper">Help</a> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >index fb6ffbb..5361307 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >@@ -1,6 +1,6 @@ >+[% USE Koha %] > </div> >- >-[% IF ( languages_loop && ! popup_window ) %] >+[% IF ( ( languages_loop ) && ( ! popup_window ) && ( Koha.Preference('StaffLangSelectorMode') == 'both' || Koha.Preference('StaffLangSelectorMode') == 'footer') ) %] > [% UNLESS ( one_language_enabled ) %] > <div id="changelanguage" class="navbar navbar-default navbar-fixed-bottom"> > <div class="container-fluid"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/langmenu-staff-top.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/langmenu-staff-top.inc >new file mode 100644 >index 0000000..11a06ac >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/langmenu-staff-top.inc >@@ -0,0 +1,31 @@ >+ >+[% IF ( ( ! one_language_enabled ) && ( languages_loop ) && ( Koha.Preference('StaffLangSelectorMode') == 'both' || Koha.Preference('StaffLangSelectorMode') == 'top') ) %] >+<li class="dropdown"> >+ <a href="#" title="Switch languages" class="dropdown-toggle" id="langmenu" data-toggle="dropdown" role="button"><i class="icon-flag icon-white"></i> <span class="langlabel">Languages</span> <b class="caret"></b></a> >+ <ul aria-labelledby="langmenu" role="menu" class="dropdown-menu dropdown-menu-right"> >+ [% FOREACH languages_loo IN languages_loop.sort('rfc4646_subtag') %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.plural ) %] >+ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >+ [% IF ( sublanguages_loo.enabled ) %] >+ [% IF ( sublanguages_loo.sublanguage_current ) %] >+ <li role="presentation"> <a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] <i class="icon-ok"></i></a></li> >+ [% ELSE %] >+ <li role="presentation"><a href="/cgi-bin/koha/changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]</a></li> >+ [% END %] >+ [% END # / IF sublanguages_loo.enabled %] >+ [% END # / FOREACH sublanguages_loo %] >+ [% ELSE %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.current ) %] >+ <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <i class="icon-ok"></i></a></li> >+ [% ELSE %] >+ <li role="presentation"><a href="/cgi-bin/koha/changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</a></li> >+ [% END %] >+ [% END # / IF languages_loo.current %] >+ [% END # / IF ( languages_loo.plural ) %] >+ [% END # / IF ( languages_loo.group_enabled ) %] >+ [% END # / FOREACH languages_loo IN languages_loop %] >+ </ul> <!-- /# .dropdown-menu --> >+</li> <!-- / .dropdown --> >+[% END # / IF opaclanguagedisplay %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >index e7da2e8..636753b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >@@ -1,6 +1,13 @@ > Staff Client: > Appearance: > - >+ - "Display language selector on " >+ - pref: StaffLangSelectorMode >+ choices: >+ both: "both top and footer" >+ top: "top" >+ footer: "only footer" >+ - > - Use the > - pref: template > choices: staff-templates >-- >2.1.4
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 18718
:
63936
|
63938
|
64019
|
66689