@@ -, +, @@
'display_daily_quote' condition
---
.../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(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
+++ a/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
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt
+++ a/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 ) %]
Quote of the day
--- a/t/db_dependent/Koha/GetDailyQuoteForInterface.t
+++ a/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 .
+
use Modern::Perl;
use Test::More;
use Test::More tests => 3;
@@ -34,7 +49,7 @@ my $expected_quote = {
text => 'Unfurl thy limbs breathless succubus
How the full embosomed fog
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");
--