Bugzilla – Attachment 116618 Details for
Bug 19838
Add system preference for adding text to self registration form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19838: Add customizable self registration instructions to Koha news
Bug-19838-Add-customizable-self-registration-instr.patch (text/plain), 4.72 KB, created by
Lucas Gass (lukeg)
on 2021-02-09 21:26:34 UTC
(
hide
)
Description:
Bug 19838: Add customizable self registration instructions to Koha news
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-02-09 21:26:34 UTC
Size:
4.72 KB
patch
obsolete
>From 8aece111fdcc705d64d4bb8819d81618abc95f8a Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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 %]</div> > }); > }); > </script> >+ [% ELSE %] >+ <script> >+ function checkLang() { >+ if ( $('#lang').val().includes('SelfRegistrationInstructions_') ) { >+ $('#branch option[value=""]').prop('selected' , true); >+ $('#branch').prop('disabled' , true) >+ } else { >+ $('#branch').prop('disabled' , false) >+ } >+ } >+ checkLang(); >+ $('#lang').change( function() { >+ checkLang(); >+ }) >+ </script> > [% 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 %]</div> > [% END %] > [% FOREACH lang_lis IN lang_list %] > <optgroup label="[% lang_lis.language | html %]"> >- [% 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 ) %] > <div class="alert" id="extended_unique_id_failed"><a href="#patron-attr-start-[% extended_unique_id_failed_code | uri %]">[% extended_unique_id_failed_description _ ': ' | html %]</a> Value is already in use ([% extended_unique_id_failed_value | html %])</div> > [% END %] >- >+ [% IF ( selfregistrationinstructions ) %] >+ [% PROCESS koha_news_block news => selfregistrationinstructions %] >+ [% END %] > <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off"> > > [%# Following on one line for translatability %] >@@ -348,7 +352,6 @@ > [% END %] > > <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" /> >- > [% UNLESS action == 'edit' && !OPACPatronDetails %] > [% UNLESS ( mandatory.defined('dateofbirth') ) %] > <a href="#" style="font-size:85%;text-decoration:none;" class="cleardate">Clear date</a> >-- >2.11.0
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 19838
: 116618