Bug 6825 OpacNav menu hide user menu on opac-user.pl page

This patch add a new syspref OpacNavBottom which is placed on all pages
after OpacNav. On Patron pages, specif patron links are placed between
OpacNav and OpacNavBottom, like this:

  OpacNav
  Patron links
  OpacNavBottom

To test:

  1 Apply this patch
  2 For RM, modify kohaversion.pl and updatedatabase.pl appropriately
  3 Test that OPAC pages are displayed as before, OpacNav on the left
  4 Test OPAC patron pages: OpacNav is as before displayed after patron
    links
  5 Split OpacNav between itself and OpacNavBottom
  6 Patron pages display patron links between OpacNav and OpacNavBottom

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Frédéric Demians 2011-08-31 11:54:26 +02:00 committed by Chris Cormack
parent 6c9ab3678a
commit d7cbdd3d0b
16 changed files with 34 additions and 25 deletions

View File

@ -446,6 +446,7 @@ sub get_template_and_user {
OpacKohaUrl => C4::Context->preference("OpacKohaUrl"),
OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"),
OpacNav => "" . C4::Context->preference("OpacNav"),
OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"),
OpacPasswordChange => C4::Context->preference("OpacPasswordChange"),
OPACPatronDetails => C4::Context->preference("OPACPatronDetails"),
OPACPrivacy => C4::Context->preference("OPACPrivacy"),
@ -968,6 +969,7 @@ sub checkauth {
LibraryName => C4::Context->preference("LibraryName"),
opacuserlogin => C4::Context->preference("opacuserlogin"),
OpacNav => C4::Context->preference("OpacNav"),
OpacNavBottom => C4::Context->preference("OpacNavBottom"),
opaccredits => C4::Context->preference("opaccredits"),
OpacFavicon => C4::Context->preference("OpacFavicon"),
opacreadinghistory => C4::Context->preference("opacreadinghistory"),

View File

@ -81,6 +81,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined block of HTML in the main content area of the opac main page','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');

View File

@ -4499,6 +4499,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
}
$DBversion = "3.05.00.XXX";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','','Links after OpacNav links','70|10','Textarea')");
print "Upgrade to $DBversion done (add OpacNavBottom syspref (enh 6825): if appropriate, you can split OpacNav into OpacNav and OpacNavBottom)\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)

View File

@ -149,6 +149,11 @@ OPAC:
- pref: OpacNav
type: textarea
class: code
-
- "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:"
- pref: OpacNavBottom
type: textarea
class: code
-
- "Include the following HTML in the header of all pages in the OPAC:"
- pref: opacheader

View File

@ -1 +1,6 @@
[% OpacNav %]
[% OpacNav %]
[% IF IsPatronPage %]
[% INCLUDE usermenu.inc %]
[% END %]
[% OpacNavBottom %]

View File

@ -54,8 +54,7 @@
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -142,8 +142,7 @@
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -54,8 +54,7 @@
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -64,8 +64,7 @@
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -95,8 +95,7 @@ You have never borrowed anything from this library.
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -82,13 +82,11 @@
[% IF ( OpacNav ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div></div>
[% ELSIF ( loggedinusername ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div></div>
[% ELSE %]
[% END %]

View File

@ -601,8 +601,7 @@ $(function() {
[% IF ( OpacNav||loggedinusername ) %]
<div class="yui-b">
<div is="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
[% END %]

View File

@ -212,8 +212,7 @@ $.tablesorter.addParser({
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -131,8 +131,7 @@
</div>
[% IF ( OpacNav||loggedinusername ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div></div>
[% END %]
</div>

View File

@ -423,8 +423,7 @@ $.tablesorter.addParser({
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>

View File

@ -180,8 +180,7 @@
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
[% INCLUDE 'usermenu.inc' %]
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>