View | Details | Raw Unified | Return to bug 16371
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 / +5 lines)
Lines 512-524 OPAC: Link Here
512
                  no: Disable
512
                  no: Disable
513
            - browsing and paging search results from the OPAC detail page.
513
            - browsing and paging search results from the OPAC detail page.
514
        -
514
        -
515
            - Show quote of the day in the 
515
            - pref: QuoteOfTheDay
516
            - pref: QuoteOfTheDay
516
              default:
517
              multiple:
517
              class: short
518
                intranet: staff client
518
            - Quote of the Day display in Koha.
519
                opac: OPAC 
519
            - Add 'opac' to show in OPAC home page.
520
            - main page.
520
            - Add 'intranet' to show in the staff client main page.
521
            - Example 'opac intranet', displays QOTD in OPAC and the staff client.
522
        -
521
        -
523
            - pref: OPACPopupAuthorsSearch
522
            - pref: OPACPopupAuthorsSearch
524
              default: 0
523
              default: 0
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-1 / +1 lines)
Lines 141-147 Link Here
141
        [% END # IF koha_news %]
141
        [% END # IF koha_news %]
142
142
143
        [% UNLESS news_item # Don't show under single news item %]
143
        [% UNLESS news_item # Don't show under single news item %]
144
            [% IF ( display_daily_quote && daily_quote ) %]
144
            [% IF ( daily_quote ) %]
145
                <div id="daily-quote">
145
                <div id="daily-quote">
146
                    <h3>Quote of the day</h3>
146
                    <h3>Quote of the day</h3>
147
                    <div>
147
                    <div>
(-)a/t/db_dependent/Koha/GetDailyQuoteForInterface.t (-4 / +18 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# This file is part of Koha
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
3
use Modern::Perl;
18
use Modern::Perl;
4
use Test::More;
19
use Test::More;
5
use Test::More tests => 3;
20
use Test::More tests => 3;
Lines 34-40 my $expected_quote = { Link Here
34
    text        => 'Unfurl thy limbs breathless succubus<br/>How the full embosomed fog<br/>Imparts the night to us....',
49
    text        => 'Unfurl thy limbs breathless succubus<br/>How the full embosomed fog<br/>Imparts the night to us....',
35
};
50
};
36
51
37
t::lib::Mocks::mock_preference('QuoteOfTheDay', '');
52
t::lib::Mocks::mock_preference('QuoteOfTheDay', 0);
38
53
39
subtest "GetDailyQuoteForInterface" => sub {
54
subtest "GetDailyQuoteForInterface" => sub {
40
55
Lines 48-59 subtest "GetDailyQuoteForInterface" => sub { Link Here
48
    ok(not($quote), "'QuoteOfTheDay'-syspref not set so nothing returned");
63
    ok(not($quote), "'QuoteOfTheDay'-syspref not set so nothing returned");
49
64
50
    ##Set 'QuoteOfTheDay'-syspref to not include current interface 'opac'
65
    ##Set 'QuoteOfTheDay'-syspref to not include current interface 'opac'
51
    t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intra commandline sip2 api yo-mama');
66
    t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intranet');
52
    $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id});
67
    $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id});
53
    ok(not($quote), "'QuoteOfTheDay'-syspref doesn't include 'opac'");
68
    ok(not($quote), "'QuoteOfTheDay'-syspref doesn't include 'opac'");
54
69
55
    ##Set 'QuoteOfTheDay'-syspref to include current interface 'opac'
70
    ##Set 'QuoteOfTheDay'-syspref to include current interface 'opac'
56
    t::lib::Mocks::mock_preference('QuoteOfTheDay', 'intraopaccommandline');
71
    t::lib::Mocks::mock_preference('QuoteOfTheDay', 'opac,intranet');
57
    $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id});
72
    $quote = C4::Koha::GetDailyQuoteForInterface(id => $test_quote->{id});
58
    is($quote->{text}, $expected_quote->{text}, "Got the expected quote");
73
    is($quote->{text}, $expected_quote->{text}, "Got the expected quote");
59
74
60
- 

Return to bug 16371