From 8aece111fdcc705d64d4bb8819d81618abc95f8a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 9 Feb 2021 21:11:32 +0000 Subject: [PATCH] Bug 19838: Add customizable self registration instructions to Koha news Test plan: 1. Apply patch 2. Go to /cgi-bin/koha/tools/koha-news.pl and create 'New entry' with a dsiplay location of SelfRegistrationInstructions 3. On the OPAC go to the self registration page 4. Your new content should be there. 5. Go back to the news tool and again edit the SelfRegistrationInstructions, try to set the library to something other than 'All libraries', you should not be able to. SelfRegistrationInstructions cannot be branch specific. --- .../intranet-tmpl/prog/en/modules/tools/koha-news.tt | 17 ++++++++++++++++- .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 7 +++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 8393dc00b3..c49da10387 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -344,6 +344,21 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] }); }); + [% ELSE %] + [% END %] [% UNLESS ( wysiwyg ) %] [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %] @@ -403,7 +418,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% END %] [% FOREACH lang_lis IN lang_list %] - [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacSuggestionInstructions'] %] + [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacSuggestionInstructions', 'SelfRegistrationInstructions'] %] [% IF ( location == '' ) %] [% SET location_lang = lang_lis.language %] [% location = BLOCK %]OPAC news[% END %] 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 d9ee294706..8d48558f65 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -6,6 +6,8 @@ [% USE Branches %] [% USE KohaDates %] [% USE Math %] +[% USE KohaNews %] +[% SET selfregistrationinstructions = KohaNews.get( location => "SelfRegistrationInstructions", lang => lang, library => branchcode ) %] [% SET userupdateview = 1 %] [% BLOCK streetnumber %] [% UNLESS hidden.defined('streetnumber') %] @@ -188,7 +190,9 @@ [% IF ( extended_unique_id_failed_code ) %]
[% extended_unique_id_failed_description _ ': ' | html %] Value is already in use ([% extended_unique_id_failed_value | html %])
[% END %] - + [% IF ( selfregistrationinstructions ) %] + [% PROCESS koha_news_block news => selfregistrationinstructions %] + [% END %]
[%# Following on one line for translatability %] @@ -348,7 +352,6 @@ [% END %] - [% UNLESS action == 'edit' && !OPACPatronDetails %] [% UNLESS ( mandatory.defined('dateofbirth') ) %] Clear date -- 2.11.0