From c82eac8247eea764d53d71f3dbef6c5f549abbfb Mon Sep 17 00:00:00 2001
From: Alex Buckley <alexbuckley@catalyst.net.nz>
Date: Mon, 25 May 2020 04:27:10 +0000
Subject: [PATCH] Bug 25090: Remove references to
 PatronSelfRegistrationVerifyByEmail syspref

PatronSelfRegistrationVerifyByEmail has been replaced with:

* PatronSelfRegistrationVerifyByEmailToPatron
* PatronSelfRegistrationVerifyByEmailToLibrary

Test plan:
1. Go to Administration > Patron attribute types
2. Add a new patron attribute type and observe the 'Editable in OPAC'
checkbox references PatronSelfRegistrationVerifyByEmail
3. Apply patch
4. Refresh page and observe the said field references/links are replaced
with references/links to PatronSelfRegistrationVerifyByEmailToPatron and PatronSelfRegistrationVerifyByEmailToLibrary
5. Select 'Display in OPAC' and 'Editable in OPAC'
6. Make sure both new PatronSelfRegistration sysprefs are disabled
7. Go to your patron detail page in OPAC and click on 'your personal
details' tab
8. Observe under 'Additional information' the patron attribute is
visible and editable

[Check display logic]
9. Observe when either one of the PatronSelfRegistrationVerify sysprefs is
enabled the attribute is hidden in the OPAC page
10. Observe when both PatronSelfRegistrationVerify sysprefs are enabled the
attribute is hidden in OPAC

Sponsored-By: Mental Health Education Resource Centre, NZ
---
 koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt | 2 +-
 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
index 84db9c25fb1..f76ed058902 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
@@ -117,7 +117,7 @@
           [% ELSE %]
             <input type="checkbox" id="opac_editable" name="opac_editable" />
           [% END %]
-            <span>Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above, does not work during <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=PatronSelfRegistration" target="_blank">self-registration</a>.)</span>
+          <span>Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above, does not work with <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=PatronSelfRegistrationVerifyByEmailToPatron" target="_blank">PatronSelfRegistrationVerifyByEmailToPatron</a> or <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=PatronSelfRegistrationVerifyByEmailToLibrary" target="_blank">PatronSelfRegistrationVerifyByEmailToLibrary</a>.)</span>
        </li>
        <li><label for="staff_searchable">Searchable: </label>
           [% IF attribute_type AND attribute_type.staff_searchable %]
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 60eaa583791..090a19845fc 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
@@ -936,7 +936,7 @@
                         </div> <!-- /.row -->
                    [% END %]
 
-                    [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && action != 'new' ) %]
+                    [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && action != 'new' && !Koha.Preference('PatronSelfRegistrationVerifyByEmailToPatron') && !Koha.Preference('PatronSelfRegistrationVerifyByEmailToLibrary') ) %]
                         <div class="row">
                             <div class="col">
                                 [% FOREACH pa_class IN patron_attribute_classes %]
-- 
2.11.0