From c67b397236d63cc2b94306aa1620023bf7193198 Mon Sep 17 00:00:00 2001
From: blou
Date: Fri, 4 Oct 2013 13:25:33 -0400
Subject: [PATCH] Bug 10951 - Adding NoLoginInstructions to system preferences
On a failed login, the default message is harcorded into opac-auth.tt.
It would be preferable to allow for a preference to override that message (for example: ...Please bring an ID to t
The changes modify
-opac-auth.tt to allow for custom value
-admin/preferences/opac.pref to add it to the preferences with a description
-C4/Auth.pm for the loading of the preference
-sysprefs.sql
-updatedatabase.pl
TESTING
1) in OPAC, logged out, try login in by entering no or wrong credentials. Acknowledge the "Don't have a p
2) Apply the patch
3) Regression Test: Redo step 1. Same (default) message should appear.
4) Log in to intranet,
- select NoLoginInstructions in system preferences.
- Enter new (xml) message. Possible:
Welcome to Koha, please bring your passport to the front office
- and save
5) refresh the OPAC, try login again with invalid credentials. The new message should appear.
Signed-off-by: Mark Tompsett
Signed-off-by: Jonathan Druart
---
C4/Auth.pm | 1 +
installer/data/mysql/sysprefs.sql | 1 +
installer/data/mysql/updatedatabase.pl | 7 +++++++
.../prog/en/modules/admin/preferences/opac.pref | 6 +++++-
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt | 10 ++++++++--
5 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/C4/Auth.pm b/C4/Auth.pm
index 44edf67ce2..24da09e9bc 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -1068,6 +1068,7 @@ sub checkauth {
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
persona => C4::Context->preference("Persona"),
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'},
+ NoLoginInstructions => C4::Context->preference("NoLoginInstructions"),
);
$template->param( OpacPublic => C4::Context->preference("OpacPublic"));
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 9bacfde939..b70b4cf923 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -186,6 +186,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
+('NoLoginInstructions', '
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.
', '60|10', 'Instructions when a person is not connected', 'Textarea'),
('NotesBlacklist','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'),
('NoticeCSS','',NULL,'Notices CSS url.','free'),
('NotifyBorrowerDeparture','30',NULL,'Define number of days before expiry where circulation is warned about patron account expiry','Integer'),
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index ce1c1b0c19..e9859bd958 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -8142,6 +8142,13 @@ if ( CheckVersion($DBversion) ) {
$dbh->do("ALTER TABLE aqorders CHANGE notes order_internalnote MEDIUMTEXT;");
$dbh->do("ALTER TABLE aqorders ADD COLUMN order_vendornote MEDIUMTEXT AFTER order_internalnote;");
print "Upgrade to $DBversion done (Bug 9416 - In each order, add a new note made for the vendor)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion ="3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NoLoginInstructions', '
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.
', '60|10', 'Instructions when a person is not connected', 'Textarea')");
+ print "Upgrade to $DBversion done (Bug 10951: Add NoLoginInstructions pref)\n";
SetVersion($DBversion);
}
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 038cff1c07..544f65af82 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
@@ -295,7 +295,11 @@ OPAC:
- pref: OpacMaxItemsToDisplay
class: integer
- items on the biblio detail page (if the biblio has more items than this, a link is displayed instead that allows the user to choose to display all items).
-
+ -
+ - "Show the following HTML when a person is not connected:"
+ - pref: NoLoginInstructions
+ type: textarea
+ class: code
Features:
-
- pref: opacuserlogin
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 7b8b8f9e8d..a83c8e0bd1 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,14 @@ 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 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
+[% END %]
+[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or register here[% END %].