From da20d7456bf6abe5caebd787f17ac15589d3cff9 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 19 May 2020 22:03:41 +0000 Subject: [PATCH] Bug 25100: Add sys pref OPACSelfRegistrationHeader This patch adds a system prefernce called OPACSelfRegistrationHeader which allows librarians to add HTML above the self registration form TO TEST: 1. Apply patch and updatedatabase 2. Make sure self registration is turned on. 3. Search for the new system preference 'OPACSelfRegistrationHeader'. 4. Add some HTML to the field like

TEST

5. Go to the self registration page and confirm you can see your HTML. 6. This HTML should not effect the OPAC patron modification page, go there and make sure this is the case. --- .../bug_23420_add_OPACSelfRegistrationHeader_syspref.perl | 7 +++++++ installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 6 ++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 6 +++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23420_add_OPACSelfRegistrationHeader_syspref.perl diff --git a/installer/data/mysql/atomicupdate/bug_23420_add_OPACSelfRegistrationHeader_syspref.perl b/installer/data/mysql/atomicupdate/bug_23420_add_OPACSelfRegistrationHeader_syspref.perl new file mode 100644 index 0000000000..14f57ac9d2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23420_add_OPACSelfRegistrationHeader_syspref.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACSelfRegistrationHeader', '', 'Insert HTML above the self registration form', '70|10', 'Textarea')"); + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 25100, "Add OPACSelfRegistrationHeader system preference"); +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 58bd459e94..49e53639a9 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -434,6 +434,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'), ('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'), ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • \n
  • Open Library (openlibrary.org)
  • ','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), +('OPACSelfRegistrationHeader','','70|10','Use HTML tags to add content above the self registration form','Textarea'), ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), ('opacSerialDefaultTab','subscriptions','holdings|serialcollection|subscriptions','Define the default tab for serials in OPAC.','Choice'), 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 7169962c84..2e3a997af7 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 @@ -342,6 +342,12 @@ OPAC: holdingbranch: Holding library - "is the default sort field for the holdings table" - + - "Show the following HTML above the OPAC self registration form:" + - pref: OPACSelfRegistrationHeader + type: textarea + syntax: text/html + class: code + - - pref: OpacSuggestionManagedBy choices: yes: Show diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 35af40224f..27bd3d66e2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -59,7 +59,11 @@ [% ELSE %]
    [% END %] - + [% IF Koha.Preference( 'OPACSelfRegistrationHeader' ) && action != 'edit' %] +
    + [% Koha.Preference( 'OPACSelfRegistrationHeader' ) | $raw %] +
    + [% END %] [% IF action == 'edit' %] [% UNLESS OPACPatronDetails %]
    To make changes to your record please contact the library.
    -- 2.11.0