Bugzilla – Attachment 102969 Details for
Bug 16371
Quote of the Day (QOTD) for the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16371: Use multi-select on syspref and remove 'display_daily_quote' condition
0001-Bug-16371-Use-multi-select-on-syspref-and.patch (text/plain), 4.61 KB, created by
Emmi Takkinen
on 2020-04-15 08:01:06 UTC
(
hide
)
Description:
Bug 16371: Use multi-select on syspref and remove 'display_daily_quote' condition
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-04-15 08:01:06 UTC
Size:
4.61 KB
patch
obsolete
>From 225a6d276a6e9973d2a77c14d407833038dda5c4 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@outlook.com> >Date: Tue, 14 Apr 2020 12:51:50 +0300 >Subject: [PATCH] Bug 16371: Use multi-select on syspref and remove > 'display_daily_quote' condition > >This patch replaces textbox with multi-select dropdown on >syspref 'QuoteOfTheDay' and changes tests to match this change. > >Also removes condition 'display_daily_quite' from opac-main.tt >since it's no longer needed and prevents quotes showing in OPAC. > >Sponsored-by: Koha-Suomi Oy >--- > .../en/modules/admin/preferences/opac.pref | 11 +++++----- > .../bootstrap/en/modules/opac-main.tt | 2 +- > .../Koha/GetDailyQuoteForInterface.t | 21 ++++++++++++++++--- > 3 files changed, 24 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 437a96b410..5e14d3360e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -512,13 +512,12 @@ OPAC: > no: Disable > - browsing and paging search results from the OPAC detail page. > - >+ - Show quote of the day in the > - pref: QuoteOfTheDay >- default: >- class: short >- - Quote of the Day display in Koha. >- - Add 'opac' to show in OPAC home page. >- - Add 'intranet' to show in the staff client main page. >- - Example 'opac intranet', displays QOTD in OPAC and the staff client. >+ multiple: >+ intranet: staff client >+ opac: OPAC >+ - main page. > - > - pref: OPACPopupAuthorsSearch > default: 0 >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 e113357cca..7a8699a8b2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -141,7 +141,7 @@ > [% END # IF koha_news %] > > [% UNLESS news_item # Don't show under single news item %] >- [% IF ( display_daily_quote && daily_quote ) %] >+ [% IF ( daily_quote ) %] > <div id="daily-quote"> > <h3>Quote of the day</h3> > <div> >diff --git a/t/db_dependent/Koha/GetDailyQuoteForInterface.t b/t/db_dependent/Koha/GetDailyQuoteForInterface.t >index da4507df55..47966e86d3 100644 >--- a/t/db_dependent/Koha/GetDailyQuoteForInterface.t >+++ b/t/db_dependent/Koha/GetDailyQuoteForInterface.t >@@ -1,5 +1,20 @@ > #!/usr/bin/perl > >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > use Test::More; > use Test::More tests => 3; >@@ -34,7 +49,7 @@ my $expected_quote = { > text => 'Unfurl thy limbs breathless succubus<br/>How the full embosomed fog<br/>Imparts the night to us....', > }; > >-t::lib::Mocks::mock_preference('QuoteOfTheDay', ''); >+t::lib::Mocks::mock_preference('QuoteOfTheDay', 0); > > subtest "GetDailyQuoteForInterface" => sub { > >@@ -48,12 +63,12 @@ subtest "GetDailyQuoteForInterface" => sub { > ok(not($quote), "'QuoteOfTheDay'-syspref not set so nothing returned"); > > ##Set 'QuoteOfTheDay'-syspref to not include current interface 'opac' >- t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intra commandline sip2 api yo-mama'); >+ t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intranet'); > $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); > ok(not($quote), "'QuoteOfTheDay'-syspref doesn't include 'opac'"); > > ##Set 'QuoteOfTheDay'-syspref to include current interface 'opac' >- t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intraopaccommandline'); >+ t::lib::Mocks::mock_preference('QuoteOfTheDay', 'opac,intranet'); > $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id}); > is($quote->{text}, $expected_quote->{text}, "Got the expected quote"); > >-- >2.17.1 >
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 16371
:
102515
|
102516
|
102517
|
102969
|
103019
|
103329
|
103330
|
103331
|
103332
|
103333
|
103334
|
103732
|
103973
|
103974
|
103975
|
103976
|
103977
|
103978
|
103979
|
106818
|
106819
|
106820
|
106858
|
106859
|
106860
|
106861
|
106862
|
106863
|
106864
|
106865
|
106866
|
106867
|
106868
|
106894
|
106895
|
106896
|
106897
|
106898
|
106899
|
106900
|
106901
|
106902
|
106903
|
108097
|
108098
|
108160
|
108163