From 42ceff1130c969a1552bd46cdb906cc9060bd0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= Date: Thu, 27 Feb 2014 17:36:34 -0500 Subject: [PATCH] Add the OpacBelowLoginBox preference which lets you set a different message to show under the OPAC login form. --- C4/Auth.pm | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt | 9 +++++++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 6 +++++- opac/opac-main.pl | 1 + 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 44edf67..d2a8a19 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1064,6 +1064,7 @@ sub checkauth { IndependentBranches=> C4::Context->preference("IndependentBranches"), AutoLocation => C4::Context->preference("AutoLocation"), wrongip => $info{'wrongip'}, + opacbelowloginbox => C4::Context->preference("OpacBelowLoginBox"), PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), persona => C4::Context->preference("Persona"), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c8e883f..4eb525f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8012,6 +8012,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OpacBelowLoginBox','', '30|10','HTML to show under the login box','Textarea');"); + print "Upgrade to $DBversion done (Add OpacBelowLoginBox preference)\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 d541440..415e4e1 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 @@ -225,6 +225,11 @@ OPAC: type: textarea class: code - + - "Include the following HTML under the login box in the OPAC." + - pref: OpacBelowLoginBox + type: textarea + class: code + - - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):' - '
Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN}, {ISSN} and {AUTHOR} will be replaced with information from the displayed record.' - pref: OPACSearchForTitleIn diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt index 7b8b8f9..b3685c4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt @@ -86,8 +86,13 @@ please choose against which one you would like to authenticate:

-
Don't have a password yet?

If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.

-
Don't have a library card?

If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or register here[% END %].

+ [% IF ( opacbelowloginbox ) %] + [% opacbelowloginbox %] + [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]Register here[% END %] + [% ELSE %] +
Don't have a password yet?

If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.

+
Don't have a library card?

If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or register here[% END %].

+ [% END %]
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 eb1e600..b5ba09f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt @@ -62,7 +62,11 @@ - +
+
+ [% opacbelowloginbox %] +
+ [% END %] [% IF persona %] Sign in with your Email diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 7c6ee36..41efb23 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -56,6 +56,7 @@ my $quote = GetDailyQuote(); # other options are to pass in an exact quote id $template->param( koha_news => $all_koha_news, koha_news_count => $koha_news_count, + opacbelowloginbox => C4::Context->preference("OpacBelowLoginBox"), display_daily_quote => C4::Context->preference('QuoteOfTheDay'), daily_quote => $quote, ); -- 1.7.2.5