Bug 6825 OpacNav menu hide user menu on opac-user.pl page
authorFrédéric Demians <f.demians@tamil.fr>
Wed, 31 Aug 2011 09:54:26 +0000 (11:54 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 13 Oct 2011 22:20:06 +0000 (11:20 +1300)
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>

16 files changed:
C4/Auth.pm
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt

index 7a6ec93..54fb74c 100644 (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"),
index 21bd9b9..8cfd73f 100755 (executable)
@@ -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');
index 12e67e1..744c90d 100755 (executable)
@@ -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)
index 8d6974e..07927d1 100644 (file)
@@ -150,6 +150,11 @@ OPAC:
               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
               type: textarea
index 637ed33..9cd2c12 100644 (file)
@@ -1 +1,6 @@
-[% OpacNav %]
\ No newline at end of file
+[% OpacNav %]
+[% IF IsPatronPage %]
+[% INCLUDE usermenu.inc %]
+[% END %]
+[% OpacNavBottom %]
+
index eed66d3..b28fd08 100644 (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>
index 4c51f48..93a717f 100644 (file)
 </div>
 <div class="yui-b">
 <div id="leftmenus" class="container">
-[% INCLUDE 'navigation.inc' %]
-[% INCLUDE 'usermenu.inc' %]
+[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
 </div>
 </div>
 </div>
index 16c4532..1f3025a 100644 (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>
index de34e02..b1c4d1f 100644 (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>
index 683a5bd..bedae0a 100644 (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>
index e9f6be1..6c2cd82 100644 (file)
 
 [% 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 %]
index c50cfb1..aa10dae 100644 (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 %]
index 3f3aa34..d8757bb 100644 (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>
index e99d201..e93e00a 100644 (file)
 </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>
index 9ba6c05..d9417ec 100644 (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>
index db5f7f5..58f4d2d 100644 (file)
 </div>
 <div class="yui-b">
 <div id="leftmenus" class="container">
-[% INCLUDE 'navigation.inc' %]
-[% INCLUDE 'usermenu.inc' %]
+[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
 </div>
 </div>
 </div>