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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 230-235 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
230
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
230
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
231
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
231
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
232
('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'),
232
('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'),
233
('NewsArchiveEnabled','0',NULL,'Enables users to view expired news items.','YesNo'),
233
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
234
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
234
('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
235
('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
235
('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
236
('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref (+8 lines)
Lines 21-23 Tools: Link Here
21
                  staff: "Staff client only"
21
                  staff: "Staff client only"
22
                  both: "Both OPAC and staff client"
22
                  both: "Both OPAC and staff client"
23
            -
23
            -
24
        -
25
            -
26
            - pref: NewsArchiveEnabled
27
              choices:
28
                  yes: "Enable"
29
                  no: "Disable"
30
            - the news archive for expired items.
31
        -
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (+4 lines)
Lines 16-21 Link Here
16
            <li><a href="#">
16
            <li><a href="#">
17
            [% SWITCH news_type    %]
17
            [% SWITCH news_type    %]
18
                [% CASE 'news_item'    %]News item
18
                [% CASE 'news_item'    %]News item
19
                [% CASE 'news_archive' %]News archive
19
            [% END %]
20
            [% END %]
20
            </a>
21
            </a>
21
        [% END %]
22
        [% END %]
Lines 62-67 Link Here
62
                [% SET branchcode = Branches.GetLoggedInBranchcode() %]
63
                [% SET branchcode = Branches.GetLoggedInBranchcode() %]
63
                <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
64
                <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
64
                RSS feed for [% IF ( loggedinusername ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
65
                RSS feed for [% IF ( loggedinusername ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
66
67
                [% IF ( Koha.Preference( 'NewsArchiveEnabled' ) ) %]
68
                <a href="/cgi-bin/koha/opac-main.pl?news_id=all" style="float: right">Archived news</a>[% END %]
65
            </div>
69
            </div>
66
        [% END %]
70
        [% END %]
67
71
(-)a/opac/opac-main.pl (-4 / +9 lines)
Lines 55-63 if (C4::Context->userenv) { Link Here
55
my $news_id = $input->param('news_id');
55
my $news_id = $input->param('news_id');
56
my ($all_koha_news, $koha_news_count, $news_type);
56
my ($all_koha_news, $koha_news_count, $news_type);
57
if (defined $news_id && length $news_id) {
57
if (defined $news_id && length $news_id) {
58
    $all_koha_news = &GetNewsToDisplay($news_lang, $homebranch, undef, $news_id);
58
    if ($news_id eq 'all' && C4::Context->preference('NewsArchiveEnabled')) {
59
    $koha_news_count = 1;
59
        $all_koha_news = get_opac_news(undef, $news_lang, $homebranch);
60
    $news_type = 'news_item';
60
        $koha_news_count = scalar @$all_koha_news;
61
        $news_type = 'news_archive';
62
    } else {
63
        $all_koha_news = [ get_opac_new($news_id) ];
64
        $koha_news_count = 1;
65
        $news_type = 'news_item';
66
    }
61
} else {
67
} else {
62
    $all_koha_news = &GetNewsToDisplay($news_lang, $homebranch);
68
    $all_koha_news = &GetNewsToDisplay($news_lang, $homebranch);
63
    $koha_news_count = scalar @$all_koha_news;
69
    $koha_news_count = scalar @$all_koha_news;
64
- 

Return to bug 15385