From: Paul Poulain Date: Wed, 20 Jun 2012 21:11:06 +0000 (+0200) Subject: Bug 3708 - Add another customizable region to the OPAC: right sidebar nav X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=a163be4113c4c5d29811b9725e50c2957d410739;p=koha.git Bug 3708 - Add another customizable region to the OPAC: right sidebar nav This patch creates a new system preference, OpacNavRight, in which the librarian can add HTML which will appear on the OPAC main page under the login form. If the user is logged in the content will appear in place of the login form. Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- diff --git a/C4/Auth.pm b/C4/Auth.pm index 66e70bd447..143fe3ff23 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -428,6 +428,7 @@ sub get_template_and_user { OpacKohaUrl => C4::Context->preference("OpacKohaUrl"), OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), OpacNav => "" . C4::Context->preference("OpacNav"), + OpacNavRight => "" . C4::Context->preference("OpacNavRight"), OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), OPACPatronDetails => C4::Context->preference("OPACPatronDetails"), @@ -964,6 +965,7 @@ sub checkauth { LibraryName => C4::Context->preference("LibraryName"), opacuserlogin => C4::Context->preference("opacuserlogin"), OpacNav => C4::Context->preference("OpacNav"), + OpacNavRight => C4::Context->preference("OpacNavRight"), OpacNavBottom => C4::Context->preference("OpacNavBottom"), opaccredits => C4::Context->preference("opaccredits"), OpacFavicon => C4::Context->preference("OpacFavicon"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 934427a8ac..6c6d91bc75 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -82,6 +82,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
','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('OpacNavRight','','Show the following HTML in the right hand column of the main page under the main login form','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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7bc73b0a26..d06a1883a9 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5385,6 +5385,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.09.00.017"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacNavRight', '', '70|10', 'Show the following HTML in the right hand column of the main page under the main login form', 'Textarea');"); + print "Upgrade to $DBversion done (Add customizable OpacNavRight region to the OPAC main page)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 4f9092bc58..7ca4692623 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -171,6 +171,11 @@ OPAC: - pref: OpacNav type: textarea class: code + - + - "Show the following HTML in the right hand column of the main page under the main login form:" + - pref: OpacNavRight + 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 diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt index a89c473fd1..d291b2a226 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt @@ -12,17 +12,14 @@
[% IF ( opacuserlogin ) %] [% IF ( loggedinusername ) %] -
-
+
[% ELSE %] -
-
+
[% END %] [% ELSE %] -
-
+
[% END %] - +
[% IF ( koha_news_count ) %]
@@ -43,11 +40,12 @@ - [% IF ( opacuserlogin ) %] + [% IF ( opacuserlogin || OpacNavRight ) %] +
+ [% IF ( opacuserlogin ) %] [% UNLESS ( loggedinusername ) %] [% UNLESS ( casAuthentication ) %] -
-
+
@@ -60,11 +58,12 @@
-
[% END %] [% END %] - -[% END %] + [% END %] + [% IF ( OpacNavRight ) %]
[% OpacNavRight %]
[% END %] +
+ [% END %]