Bug 30873: Add system preference to hide libraries link in the OPAC
Some users would prefer that the libraries link not appear in the menu of links under the OPAC's main search bar. This patch adds a preference to do so. The preference defaults to "On" since "On" is the current default behavior. To test, apply the patch and run the database update prcoess. - In the OPAC, confirm that by default the "Libraries" link appears. - In the staff interface, go to Administration -> System preferences -> OPACShowLibraries - Set the preference to "Don't show" - Return to the OPAC and confirm that the "Libraries" link isn't there. - Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should be redirected to a 404 page. Sponsored-by: Athens County Public Libraries Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
b5f122696c
commit
0d4ebe4170
5 changed files with 42 additions and 9 deletions
18
installer/data/mysql/atomicupdate/bug_30873.pl
Executable file
18
installer/data/mysql/atomicupdate/bug_30873.pl
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
use Modern::Perl;
|
||||||
|
|
||||||
|
return {
|
||||||
|
bug_number => "26205",
|
||||||
|
description =>
|
||||||
|
"Add new system preference OPACShowLibraries to control whether the libraries link appears in the OPAC",
|
||||||
|
up => sub {
|
||||||
|
my ($args) = @_;
|
||||||
|
my $dbh = $args->{dbh};
|
||||||
|
|
||||||
|
$dbh->do(
|
||||||
|
q{
|
||||||
|
INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
|
||||||
|
VALUES ('OPACShowLibraries', '1', 'If enabled, a "Libraries" link appears in the OPAC pointing to a page with library information', '', 'YesNo')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}
|
|
@ -544,6 +544,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
|
||||||
('OPACShibOnly','0','','If ON enables shibboleth only authentication for the opac','YesNo'),
|
('OPACShibOnly','0','','If ON enables shibboleth only authentication for the opac','YesNo'),
|
||||||
('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'),
|
('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'),
|
||||||
('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'),
|
('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'),
|
||||||
|
('OPACShowLibraries', '1', '', 'If enabled, a link is shown in the OPAC pointing to a page with library information', '', 'YesNo'),
|
||||||
('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'),
|
('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'),
|
||||||
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
|
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
|
||||||
('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'),
|
('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'),
|
||||||
|
|
|
@ -42,6 +42,12 @@ OPAC:
|
||||||
0: Disable
|
0: Disable
|
||||||
- "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
|
- "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
|
||||||
- '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.'
|
- '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.'
|
||||||
|
-
|
||||||
|
- pref: OPACShowLibraries
|
||||||
|
choices:
|
||||||
|
1: "Show"
|
||||||
|
0: "Don't show"
|
||||||
|
- "a link to a page in the OPAC showing information about each library."
|
||||||
-
|
-
|
||||||
- "Show star-ratings on"
|
- "Show star-ratings on"
|
||||||
- pref: OpacStarRatings
|
- pref: OpacStarRatings
|
||||||
|
|
|
@ -364,6 +364,7 @@
|
||||||
</li>
|
</li>
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
[% IF ( Koha.Preference('OPACShowLibraries') ) %]
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a id="library_page" href="/cgi-bin/koha/opac-library.pl">
|
<a id="library_page" href="/cgi-bin/koha/opac-library.pl">
|
||||||
[% IF ( singleBranchMode ) %]
|
[% IF ( singleBranchMode ) %]
|
||||||
|
@ -373,6 +374,7 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
[% END %]
|
||||||
[% PROCESS koha_news_block news => OpacMoreSearches %]
|
[% PROCESS koha_news_block news => OpacMoreSearches %]
|
||||||
</ul> <!-- /.nav#moresearches -->
|
</ul> <!-- /.nav#moresearches -->
|
||||||
</div> <!-- /.row -->
|
</div> <!-- /.row -->
|
||||||
|
|
|
@ -29,6 +29,12 @@ my $query = CGI->new();
|
||||||
|
|
||||||
my $branchcode = $query->param('branchcode');
|
my $branchcode = $query->param('branchcode');
|
||||||
|
|
||||||
|
# if OPACShowLibraries is disabled, leave immediately
|
||||||
|
if ( !C4::Context->preference('OPACShowLibraries') ) {
|
||||||
|
print $query->redirect("/cgi-bin/koha/errors/404.pl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
||||||
{
|
{
|
||||||
template_name => "opac-library.tt",
|
template_name => "opac-library.tt",
|
||||||
|
|
Loading…
Reference in a new issue