Bugzilla – Attachment 21810 Details for
Bug 10951
Make the NoLoginInstructions a customizable field through preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10951 - Adding NoLoginInstructions to system preferences
Bug-10951---Adding-NoLoginInstructions-to-system-p.patch (text/plain), 6.83 KB, created by
Blou
on 2013-10-04 14:55:08 UTC
(
hide
)
Description:
Bug 10951 - Adding NoLoginInstructions to system preferences
Filename:
MIME Type:
Creator:
Blou
Created:
2013-10-04 14:55:08 UTC
Size:
6.83 KB
patch
obsolete
>From 90ce718cb656d235775ea6e6572b410877f17078 Mon Sep 17 00:00:00 2001 >From: blou <philippe.blouin@inlibro.com> >Date: Fri, 4 Oct 2013 10:02:27 -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: > <h5>Welcome to Koha, please bring your passport to the front office</h5> > - and save > 5) refresh the OPAC, try login again with invalid credentials. The new message should appear. >--- > C4/Auth.pm | 1 + > installer/data/mysql/sysprefs.sql | 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 | 10 ++++++++-- > 5 files changed, 23 insertions(+), 2 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 156be9d..fa0b5e6 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1044,6 +1044,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 4b0f364..9b18769 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -182,6 +182,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', '<h5>Don\'t have a password yet?</h5> <p> 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.</p> <h5>Don\'t have a library card?</h5> <p> If you don\'t have a library card, stop by your local library to sign up. </p>', '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 d88b258..a80f9c1 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7162,6 +7162,14 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion ="3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) >+ VALUES ('NoLoginInstructions', '<h5>Don\'t have a password yet\?</h5> <p> 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.</p> <h5>Don\'t have a library card\?</h5> <p> If you don\'t have a library card, stop by your local library to sign up. </p>', '60|10', 'Instructions when a person is not connected', 'Textarea')"); >+ print "Upgrade to $DBversion done (Bug 10951: Add NoLoginInstructions pref)\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 a75c7ef..317bb91 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 >@@ -280,6 +280,11 @@ OPAC: > homebranch: 'home library' > holdingbranch: 'holding library' > - "is the logged in user's library. The second tab will contain all other 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 7b8b8f9..a83c8e0 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: </p> > > <input type="submit" value="Log In" class="submit" /> > <div id="nologininstructions"> >- <h5>Don't have a password yet?</h5><p> 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.</p> >- <h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<span id="registrationinstructions"> or <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a></span>[% END %]. </p> >+[% IF NoLoginInstructions %] [% NoLoginInstructions %] >+[% ELSE %] >+ <h5>Don't have a password yet?</h5> >+ <p>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.</p> >+ <h5>Don't have a library card?</h5> >+ If you don't have a library card, stop by your local library to sign up >+[% END %] >+[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<span id="registrationinstructions"> or <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a></span>[% END %]. > </div> > </form> > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10951
:
21460
|
21510
|
21515
|
21516
|
21522
|
21524
|
21807
|
21810
|
21811
|
21812
|
21813
|
21814
|
21815
|
21816
|
21853
|
21854
|
21855
|
22711
|
22712
|
22713