Bugzilla – Attachment 157563 Details for
Bug 34889
Convert PatronSelfRegistrationAdditionalInstructions system preference to HTML customization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34889: Convert PatronSelfRegistrationAdditionalInstructions system preference to HTML customization
Bug-34889-Convert-PatronSelfRegistrationAdditional.patch (text/plain), 9.97 KB, created by
Owen Leonard
on 2023-10-20 18:38:52 UTC
(
hide
)
Description:
Bug 34889: Convert PatronSelfRegistrationAdditionalInstructions system preference to HTML customization
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-10-20 18:38:52 UTC
Size:
9.97 KB
patch
obsolete
>From 479af666e74c44addc0a868c7b4027bf9519c4d8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 22 Sep 2023 15:27:11 +0000 >Subject: [PATCH] Bug 34889: Convert > PatronSelfRegistrationAdditionalInstructions system preference to HTML > customization > >This patch moves the PatronSelfRegistrationAdditionalInstructions system >preference into HTML customizations, making it possible to have >language- and library-specific content. > >To test you should have some content in the >PatronSelfRegistrationAdditionalInstructions system preference before >applying the patch. Apply the patch and run the database update process. > > - In the staff client, go to Tools -> HTML customizations and verify > that the content previously in the > PatronSelfRegistrationAdditionalInstructions preference is > now stored there. > - The HTML customization entry form should offer > PatronSelfRegistrationAdditionalInstructions as a choice under > "Display location." > - Go to Administration -> System preferences and enable > "PatronSelfRegistration." Set "PatronSelfRegistrationVerifyByEmail" > to "Don't require." > - Go to the OPAC and click "Register here." > - Submit a new registration and confirm that the content that was > previously stored in the system preference is shown correctly on the > registration confirmation page. > - Update and reinstall active translations (for instance fr-FR): > - cd misc/translator/ > - perl translate update fr-FR > - perl translate install fr-FR > - Enable the translation if necessary under Administration -> System > preferences -> language. > - Enable the "opaclanguagesdisplay" preference if necessary. > - Edit the PatronSelfRegistrationAdditionalInstructions HTML > customization and add unique content to the "fr-FR" tab. > - Go to the OPAC and switch to your updated translation. > Complete the online registration process again to confirm that the > content you added for your translation shows up correctly on the > confirmation page. > - Go to Administration -> System preferences and confirm that the > PatronSelfRegistrationAdditionalInstructions preference has been > removed. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > ...onalInstructions-to-additional-contents.pl | 32 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../en/modules/admin/preferences/opac.pref | 6 ---- > .../en/modules/tools/additional-contents.tt | 2 +- > .../modules/opac-registration-confirmation.tt | 7 +++- > 5 files changed, 39 insertions(+), 9 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl >new file mode 100755 >index 0000000000..442092df37 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl >@@ -0,0 +1,32 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "34889", >+ description => "Move PatronSelfRegistrationAdditionalInstructions to additional contents", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the PatronSelfRegistrationAdditionalInstructions system preference >+ my ($patronselfregistrationadditionalinstructions) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='PatronSelfRegistrationAdditionalInstructions'; >+ | >+ ); >+ if ($patronselfregistrationadditionalinstructions) { >+ >+ # Insert any values found from system preference into additional_contents >+ foreach my $lang ('default') { >+ $dbh->do( >+ "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'PatronSelfRegistrationAdditionalInstructions', 'PatronSelfRegistrationAdditionalInstructions', NULL, ?, ?, ?, CAST(NOW() AS date) )", >+ undef, "PatronSelfRegistrationAdditionalInstructions $lang", >+ $patronselfregistrationadditionalinstructions, $lang >+ ); >+ } >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='PatronSelfRegistrationAdditionalInstructions'"); >+ say $out "Bug 34889 update done"; >+ } >+ } >+ } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 8a7aec0d27..383ce07b79 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -567,7 +567,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'), > ('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'), > ('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'), >-('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'), > ('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'), > ('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'), > ('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'), >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 39815ecf72..1ce1246f6f 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 >@@ -811,12 +811,6 @@ OPAC: > type: modalselect > source: borrowers > exclusions: sort1|sort2|gonenoaddress|lost|flags >- - >- - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):" >- - pref: PatronSelfRegistrationAdditionalInstructions >- type: textarea >- syntax: text/html >- class: html > - > - pref: PatronSelfRegistrationEmailMustBeUnique > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index f9cfb6768d..abeaf9e90a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -520,7 +520,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', ] %] >+ [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'PatronSelfRegistrationAdditionalInstructions' ] %] > <optgroup label="OPAC"> > [% FOREACH l IN opac_available_options.sort %] > [% IF l == location %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >index dc5e3a7388..83455b592e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >@@ -4,6 +4,7 @@ > [% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => news_lang, library => logged_in_user.branchcode || default_branch ) %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >+[% SET PatronSelfRegistrationAdditionalInstructions = AdditionalContents.get( location => "PatronSelfRegistrationAdditionalInstructions", lang => lang, library => branchcode || default_branch ) %] > [% INCLUDE 'doc-head-open.inc' %] > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -74,7 +75,11 @@ > </p> > [% END %] > >- <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions | $raw %]</div> >+ [% IF ( PatronSelfRegistrationAdditionalInstructions ) %] >+ <div id="PatronSelfRegistrationAdditionalInstructions"> >+ [% PROCESS koha_news_block news => PatronSelfRegistrationAdditionalInstructions %] >+ </div> >+ [% END %] > </div> <!-- /#registration-complete --> > </div> <!-- / .col-7/9 --> > >-- >2.30.2
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 34889
:
156111
|
156136
|
156680
|
157563
|
157808
|
157809
|
157826
|
157827
|
157828
|
157910
|
157911
|
157912
|
158447
|
158448
|
158449