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

(-)a/installer/data/mysql/atomicupdate/bug_30873.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "26205",
5
    description =>
6
        "Add new system preference OPACShowLibraries to control whether the libraries link appears in the OPAC",
7
    up => sub {
8
        my ($args) = @_;
9
        my $dbh = $args->{dbh};
10
11
        $dbh->do(
12
            q{
13
            INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
14
            VALUES ('OPACShowLibraries', '1', 'If enabled, a "Libraries" link appears in the OPAC pointing to a page with library information', '', 'YesNo')
15
        }
16
        );
17
    },
18
    }
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 544-549 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
544
('OPACShibOnly','0','','If ON enables shibboleth only authentication for the opac','YesNo'),
544
('OPACShibOnly','0','','If ON enables shibboleth only authentication for the opac','YesNo'),
545
('OPACShowCheckoutName','0','','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','YesNo'),
545
('OPACShowCheckoutName','0','','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','YesNo'),
546
('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'),
546
('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'),
547
('OPACShowLibraries', '1', 'If enabled, a link is shown in the OPAC pointing to a page with library information', '', 'YesNo'),
547
('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'),
548
('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'),
548
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
549
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
549
('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'),
550
('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 42-47 OPAC: Link Here
42
                  0: Disable
42
                  0: Disable
43
            - "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
43
            - "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
44
            - 'Note: This does not affect the public API, see the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RESTPublicAnonymousRequests">RESTPublicAnonymousRequests</a> to control the API.'
44
            - 'Note: This does not affect the public API, see the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RESTPublicAnonymousRequests">RESTPublicAnonymousRequests</a> to control the API.'
45
        -
46
            - pref: OPACShowLibraries
47
              choices:
48
                  1: "Show"
49
                  0: "Don't show"
50
            - "a link to a page in the OPAC showing information about each library. "
45
        -
51
        -
46
            - "Show star-ratings on"
52
            - "Show star-ratings on"
47
            - pref: OpacStarRatings
53
            - pref: OpacStarRatings
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-9 / +11 lines)
Lines 364-378 Link Here
364
                            </li>
364
                            </li>
365
                        [% END %]
365
                        [% END %]
366
                    [% END %]
366
                    [% END %]
367
                    <li class="nav-item">
367
                    [% IF ( Koha.Preference('OPACShowLibraries') ) %]
368
                        <a id="library_page" href="/cgi-bin/koha/opac-library.pl">
368
                        <li class="nav-item">
369
                            [% IF ( singleBranchMode ) %]
369
                            <a id="library_page" href="/cgi-bin/koha/opac-library.pl">
370
                                <span>Library</span>
370
                                [% IF ( singleBranchMode ) %]
371
                            [% ELSE %]
371
                                    <span>Library</span>
372
                                <span>Libraries</span>
372
                                [% ELSE %]
373
                            [% END %]
373
                                    <span>Libraries</span>
374
                        </a>
374
                                [% END %]
375
                    </li>
375
                            </a>
376
                        </li>
377
                    [% END %]
376
                    [% PROCESS koha_news_block news => OpacMoreSearches %]
378
                    [% PROCESS koha_news_block news => OpacMoreSearches %]
377
                </ul> <!-- /.nav#moresearches -->
379
                </ul> <!-- /.nav#moresearches -->
378
            </div> <!-- /.row -->
380
            </div> <!-- /.row -->
(-)a/opac/opac-library.pl (-1 / +6 lines)
Lines 29-34 my $query = CGI->new(); Link Here
29
29
30
my $branchcode = $query->param('branchcode');
30
my $branchcode = $query->param('branchcode');
31
31
32
# if OPACShowLibraries is disabled, leave immediately
33
if ( !C4::Context->preference('OPACShowLibraries') ) {
34
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
35
    exit;
36
}
37
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
38
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
39
    {
34
        template_name   => "opac-library.tt",
40
        template_name   => "opac-library.tt",
35
- 

Return to bug 30873