Bug 6864 - add a syspref to allow custom text for OPAC user/pass information
Summary: add a syspref to allow custom text for OPAC user/pass information
Status: CLOSED DUPLICATE of bug 10951
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Frédérick Capovilla
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-12 05:11 UTC by Mason James
Modified: 2022-08-05 09:31 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
image (100.81 KB, image/png)
2011-09-12 05:11 UTC, Mason James
Details
Add the OpacBelowLoginBox preference. (5.79 KB, patch)
2014-02-27 22:41 UTC, Frédérick Capovilla
Details | Diff | Splinter Review
New version of the patch. Rebase on current master and fixed. (5.86 KB, patch)
2014-03-07 15:53 UTC, Frédérick Capovilla
Details | Diff | Splinter Review
New version of the patch, removing code in opac-main and adding missing syspref line. (5.63 KB, patch)
2014-03-19 18:44 UTC, Frédérick Capovilla
Details | Diff | Splinter Review
Bug 6864 - Corrected alphabetical order of sysprefs.sql (2.26 KB, patch)
2014-04-03 01:14 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Added missing bootstrap template changes. (2.56 KB, patch)
2014-04-03 01:20 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Corrected alphabetical order of sysprefs.sql (2.48 KB, patch)
2014-04-03 02:07 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED OFF] Add OpacBelowLoginBox preference to add custom text below the login box. (7.58 KB, patch)
2014-04-03 02:25 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Corrected alphabetical order of sysprefs.sql (2.48 KB, patch)
2014-04-03 02:25 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Added missing bootstrap template changes. (2.56 KB, patch)
2014-04-03 02:25 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Bootstrap OpacBelowLoginBox (3.09 KB, patch)
2014-04-03 02:46 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 6864 - Bootstrap OpacBelowLoginBox (3.09 KB, patch)
2014-04-03 02:49 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2011-09-12 05:11:19 UTC
Created attachment 5401 [details]
image
Comment 1 Mason James 2011-09-12 05:13:59 UTC
some libraries may want to change the default text regarding the assigning of patron cards and passwords, depending on a library's policy

adding a syspref would allow them to do this...
Comment 2 Frédérick Capovilla 2014-02-27 22:41:04 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2014-02-28 16:28:40 UTC
Comment on attachment 25714 [details] [review]
Add the OpacBelowLoginBox preference.

Review of attachment 25714 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/updatedatabase.pl
@@ +7825,5 @@
>  }
>  
> +$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');");

I believe the text should be in English.

::: koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
@@ +87,5 @@
>  <input type="submit" value="Log In" class="submit" />
>  <div id="nologininstructions">
> +    [% IF ( opacbelowloginbox ) %]
> +        [% opacbelowloginbox %]
> +        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<span id="registrationinstructions"><a href="/cgi-bin/koha/opac-memberentry.pl">Register here</a></span>[% END %]

Kind of strange to have the self-registration stuff in both IF and ELSE clauses. Put it after the IF/ELSE.

::: koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
@@ +62,5 @@
>  
>  	 </fieldset></fieldset>
>  	</form>
> +    <br style="clear:both" />
> +    <div>

div's should have id's or classes or some way of being able to affect them via Javascript, in my opinion.
Comment 4 Frédérick Capovilla 2014-03-07 15:53:55 UTC Comment hidden (obsolete)
Comment 5 Mark Tompsett 2014-03-07 16:27:24 UTC
Sorry. I missed mentioning that you forgot to update installer/data/mysql/sysprefs.sql as well.
Comment 6 Mark Tompsett 2014-03-07 16:40:39 UTC
Comment on attachment 25938 [details] [review]
New version of the patch. Rebase on current master and fixed.

Review of attachment 25938 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
@@ +64,5 @@
>  	</form>
> +    <br style="clear:both" />
> +    <div id="opacbelowloginbox">
> +        [% opacbelowloginbox %]
> +    </div>

I like the id, but I'm not sure I see a need for this functionality.

::: opac/opac-main.pl
@@ +56,4 @@
>  $template->param(
>      koha_news           => $all_koha_news,
>      koha_news_count     => $koha_news_count,
> +    opacbelowloginbox => C4::Context->preference("OpacBelowLoginBox"),

So you really want something under the login area in the right side of the OPAC screen? I think it is ugly.
Comment 7 Mark Tompsett 2014-03-07 16:45:38 UTC
If you do want something under the login area displayed on the main screen, perhaps it would be shorter or different than the other login area reached by clicking 'Log in to your account'?
Comment 8 Mark Tompsett 2014-03-07 17:11:07 UTC
Comment on attachment 25938 [details] [review]
New version of the patch. Rebase on current master and fixed.

Review of attachment 25938 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
@@ +64,5 @@
>  	</form>
> +    <br style="clear:both" />
> +    <div id="opacbelowloginbox">
> +        [% opacbelowloginbox %]
> +    </div>

With PatronSelfRegistration turned on, it gets uglier.
The div is in the wrong place. It should be above line 61, I think.
Comment 9 Frédérick Capovilla 2014-03-19 18:44:26 UTC Comment hidden (obsolete)
Comment 10 Mark Tompsett 2014-03-19 18:57:22 UTC
Comment on attachment 26465 [details] [review]
New version of the patch, removing code in opac-main and adding missing syspref line.

Review of attachment 26465 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/sysprefs.sql
@@ +427,5 @@
>  ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
>  ('yuipath','local','local|http://yui.yahooapis.com/2.5.1/build','Insert the path to YUI libraries, choose local if you use koha offline','Choice'),
>  ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
> +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
> +('OpacBelowLoginBox','', '30|10','HTML to show under the login box','Textarea')

Please try to keep this alphabetical.
Comment 11 Mark Tompsett 2014-03-19 22:48:57 UTC
Also, bootstrap. You only tweaked prog opactheme.
Comment 12 David Cook 2014-03-26 06:58:08 UTC
We have the same local enhancement. This would be another one that could benefit from using a WYSIWYG editor on the syspref.
Comment 13 Mark Tompsett 2014-04-03 01:14:05 UTC Comment hidden (obsolete)
Comment 14 Mark Tompsett 2014-04-03 01:20:52 UTC Comment hidden (obsolete)
Comment 15 Mark Tompsett 2014-04-03 02:07:18 UTC Comment hidden (obsolete)
Comment 16 Mark Tompsett 2014-04-03 02:25:33 UTC
Created attachment 26780 [details] [review]
[SIGNED OFF] Add OpacBelowLoginBox preference to add custom text below the login box.

This patch file adds the ability to customize the text below
the login area which appears when 'Log in to your account'
in clicked in the top right of the OPAC.

TEST PLAN
----------
 0) Back up your data if you care about it.
 1) Open a staff client in your browser.
 2) Make sure the OPAC system preference opacthemes is set
     to 'prog'.
 3) Make sure the OPAC system preference opacuserlogin is
     set to 'Allow'.
NOTE: Required to make the 'Log in to your account' in the top
      left of OPAC appear.
 4) Make sure the OPAC system preference PatronSelfRegistration
     is set to 'Allow'.
 5) Make sure the OPAC system preference
     PatronSelfRegistrationDefaultCategory is set to a value
     of patron category that exists (eg. PT is a sample one)
NOTE: These are required to make the 'Register here' links
      appear after the text.
 6) Open the OPAC in another tab.
 7) Click the 'Log in to your account' link.
 8) Note the text below the login area.
 9) Apply the patch and run an update.
    (git bz apply 6864 -- interactive just this one)
    (./installer/data/mysql/updatedatabase.pl)
10) Refresh the OPAC page.
    -- the text should be identical.
11) In the staff client, modify the OPAC system preference
     OpacBelowLoginText to have some text, and save.
12) Refresh the OPAC page.
    -- the text should reflect what was entered in the
       OpacBelowLoginText system preference.
13) Open your mysql.
14) Drop and recreate the koha database.
15) Do a web install by going to the staff client URL.
16) Log in as the system user.
17) Confirm the OPAC system preference OpacBelowLoginBox
     exists.
18) Modify its value (blank, non-blank) and confirm that
     the OPAC page reflects the default message or custom
     message as expected each reload.
19) Run the Koha QA Test Tool
    -- This will FAIL on the system preferences SQL file.
       The next patch by me, Mark Tompsett, will fix it.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 17 Mark Tompsett 2014-04-03 02:25:50 UTC
Created attachment 26781 [details] [review]
Bug 6864 - Corrected alphabetical order of sysprefs.sql

Original patch lazily added OpacBelowLoginBox to the end. This
puts it in proper alphabetical order location.

TEST PLAN
---------
1) Apply only the first patch
2) Run the Koha QA Test tool
   -- FAILED on the system preferences SQL file.
3) Apply only the second patch (this one)
4) Run the Koha QA Test tool
   -- Everything OK now.
Comment 18 Mark Tompsett 2014-04-03 02:25:59 UTC Comment hidden (obsolete)
Comment 19 Mark Tompsett 2014-04-03 02:46:11 UTC Comment hidden (obsolete)
Comment 20 Mark Tompsett 2014-04-03 02:49:09 UTC
Created attachment 26784 [details] [review]
Bug 6864 - Bootstrap OpacBelowLoginBox

This adds OpacBelowLoginBox to bootstrap.
It also corrects the placement of setting the opacbelowloginbox
template parameter, so that it will work under bootstrap.

TEST PLAN
---------
Run steps similar to the first patch except with opacthemese
set to 'bootstrap'.
Comment 21 Owen Leonard 2014-04-11 19:11:01 UTC
A couple of comments:

The system preference name "OpacBelowLoginBox" refers to where it goes rather than what it is. It would be a lot better to have something descriptive, like "OpacLoginHelp" or something like that.

The change to the bootstrap theme modifies a different page than the change to the prog theme. I think the change to the prog theme is in the right place: On the full-page login screen where there is currently text about logging in, opac-auth.tt. (It might be good to link to this page directly from the bootstrap theme's login modal so that patrons can read the help text if they want to?)
Comment 22 Eric Bégin 2014-07-30 18:45:48 UTC
I think this may be a duplicate of 10951
Comment 23 Mark Tompsett 2014-07-30 18:54:32 UTC
10951 is only partially what this was supposed to cover, as far as I can tell.
This should be reworked to use the system preference in 10951.
Comment 24 Fridolin Somers 2015-08-11 07:59:28 UTC
For me, this is a complete duplicate of Bug 10951

*** This bug has been marked as a duplicate of bug 10951 ***