From cbf0f2c67f78aa0cfbae58f8181755d743957bbf 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 00eeeef..77ec060 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1052,6 +1052,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 19893b4..e735e58 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7824,6 +7824,14 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OpacBelowLoginBox','', '30|10','Texte à afficher en dessous de la boite de login','Textarea');"); + print "Upgrade to $DBversion done (Add OpacBelowLoginBox preference)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS 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 a75c7ef..648e6f2 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..1b1f5b5 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