From 124e52370ee7502dce26ab064b8a7ce5c7a8be50 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 Tools -> HTML customizations 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 HTML customizations and edit your SelfRegistrationInstructions entry, try to set the library to something other than 'All libraries', you should not be able to. SelfRegistrationInstructions cannot be branch specific. --- .../prog/en/modules/tools/additional-contents.tt | 14 +++++++++++++- .../bootstrap/en/modules/opac-memberentry.tt | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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 68eea231805..8565762f7f2 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 @@ -689,7 +689,15 @@ $(".customization_note").hide(); $( "#" + location + "_notes" ).show(); } - + function checkLang() { + if ( $('#lang').val().includes('SelfRegistrationInstructions_') ) { + $('#branch option[value=""]').prop('selected' , true); + $('#branch').prop('disabled' , true) + } else { + $('#branch').prop('disabled' , false) + } + } + checkLang(); $(document).ready(function() { [% IF category == 'news' %] $("#add_additional_content").validate({ @@ -727,6 +735,10 @@ }); $("#location").select2({ width: '50%' }); + + $('#lang').change( function() { + checkLang(); + }); }); [% 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 b785e6ad2f4..2776d48998c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -11,6 +11,7 @@ [% PROCESS 'html_helpers.inc' %] [% 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 selfregistrationinstructions = AdditionalContents.get( location => "SelfRegistrationInstructions", lang => lang, library => branchcode ) %] [% SET userupdateview = 1 %] [% BLOCK streetnumber %] [% UNLESS hidden.defined('streetnumber') %] @@ -235,6 +236,10 @@ > [% END %] + [% IF ( selfregistrationinstructions ) %] + [% PROCESS koha_news_block news => selfregistrationinstructions %] + [% END %] +
[% INCLUDE 'csrf-token.inc' %] -- 2.39.5