Bugzilla – Attachment 96209 Details for
Bug 22880
Convert opacheader system preference to news block
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22880: (follow-up) Use global language variable for news language
Bug-22880-follow-up-Use-global-language-variable-f.patch (text/plain), 3.51 KB, created by
Owen Leonard
on 2019-12-11 13:47:07 UTC
(
hide
)
Description:
Bug 22880: (follow-up) Use global language variable for news language
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-12-11 13:47:07 UTC
Size:
3.51 KB
patch
obsolete
>From f3a7dc7918cc6bd82e610dbe339dfbeb12cc36e6 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 11 Dec 2019 13:42:09 +0000 >Subject: [PATCH] Bug 22880: (follow-up) Use global language variable for news > language > >This patch removes news-specific code for defining the language of news >items queried for the OPAC home page. An identical language variable is >already defined globally. > >Previous to this patch an 'opacheader' news item would only appear on >the OPAC home page. Now it should appear on all OPAC pages. >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 2 +- > opac/opac-main.pl | 7 +------ > 3 files changed, 3 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 4add129977c..2b0aa405e54 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -4,7 +4,7 @@ > [% USE Categories %] > [% USE KohaNews %] > [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] >-[% SET OpacHeader = KohaNews.get( location => "opacheader", lang => news_lang, library => branchcode, blocktitle => 0 ) %] >+[% SET OpacHeader = KohaNews.get( location => "opacheader", lang => lang, library => branchcode, blocktitle => 0 ) %] > <div id="wrap"> > <div id="header-region" class="noprint"> > <div class="navbar navbar-inverse navbar-static-top"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 01508816236..e113357ccad 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -42,7 +42,7 @@ > </div> > [% END %] > >- [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %] >+ [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %] > [% IF ( OpacNav || OpacNavBottom ) && (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %] > <div class="span7"> > [% ELSIF (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %] >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index 4af6f1a8181..de5ad8e9455 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -48,10 +48,6 @@ $template->param( > casAuthentication => $casAuthentication, > ); > >-# display news >-# use cookie setting for language, bug default to syspref if it's not set >-my ($theme, $news_lang, $availablethemes) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input); >- > my $homebranch; > if (C4::Context->userenv) { > $homebranch = C4::Context->userenv->{'branch'}; >@@ -74,7 +70,7 @@ if (defined $news_id){ > $template->param( single_news_error => 1 ); > } > } else { >- @all_koha_news = &GetNewsToDisplay($news_lang,$homebranch); >+ @all_koha_news = &GetNewsToDisplay( $template->lang, $homebranch); > } > > my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha >@@ -104,7 +100,6 @@ if ( $patron ) { > > $template->param( > koha_news => @all_koha_news, >- news_lang => $news_lang, > branchcode => $homebranch, > display_daily_quote => C4::Context->preference('QuoteOfTheDay'), > daily_quote => $quote, >-- >2.11.0
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 22880
:
89517
|
90495
|
92207
|
92208
|
92592
|
92593
|
92594
|
92600
|
92601
|
92602
|
96209
|
96210
|
96219
|
98773
|
98775
|
98985
|
98986
|
98987
|
98988
|
98989
|
99362
|
99363
|
99364
|
99365
|
99366
|
99367
|
99490
|
99491
|
99492
|
99493
|
99494
|
99495
|
99496
|
99497
|
99498