From 4a0a9a72ca342863e48afdb24235051a9b29f3b4 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Mon, 5 Aug 2024 17:57:36 +0000 Subject: [PATCH] Bug 36430: Allow self-reg users to set userid This patch adds the ability for patrons to set their userid when self registering. It also gives patrons the ability to request changes to their user id from the OPAC. To test: 1) Apply patch, restart_all 2) Make sure the 'PatronSelfRegistration' system pref is set to allow and make sure you have a 'PatronSelfRegistrationDefaultCategory' category set. 3) Visit the OPAC main page and select 'Create an account' 4) Under the 'Library' section, you should see a new 'Username: ' input. Fill out the required information and leave the username blank. 5) Submit the form. Your userid should automatically be set. Copy/remember this userid that was given to you 6) Create a new account, this time fill in a custom userid with the value given to the patron you just created 7) When submitting, you will see an error message, as the userid is not unique. 8) Change the userid to somethign different and submit the form. 9) Form submits successfully and gives you the desired userid. Log into this account 10) Click the 'Personal details' tab and submit an update request for the username. Ensure this works correctly. 11) Play around with the other self registration system preferences ('PatronSelfRegistration'...) to attempt to hide/require the userid field and ensure they all work properly. Signed-off-by: Shi Yao Wang --- .../bootstrap/en/modules/opac-memberentry.tt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 f96165ddde..d383c95e66 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -136,7 +136,7 @@
  • There were problems processing your registration. Please contact your library for help.

    [% IF error_type == 'Koha::Exceptions::Patron::InvalidUserid' %] -

    Error: Userid is not valid

    +

    Error: Username already exists or could not create unique new one.

    [% ELSE %]

    Error [% error_type | html %]: [% error_info | html %]

    [% END %] @@ -212,7 +212,7 @@
    [% INCLUDE 'csrf-token.inc' %] - [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'middle_name' 'dateofbirth' 'initials' 'pronouns' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_streetnumber' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' 'lang' ] %] + [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'middle_name' 'dateofbirth' 'initials' 'pronouns' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_streetnumber' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' 'lang' 'userid'] %] [% IF mandatory.defined( field ) %] [% SET required.$field = 'required' %] [% END %] @@ -255,13 +255,13 @@
  • [% END %] - [% IF op != 'new' %] - [% UNLESS hidden.defined('userid') %] -
  • - - [% borrower.userid | html %] -
  • - [% END %] + [% UNLESS hidden.defined('userid') %] +
  • + + + +
    Required
    +
  • [% END %] [% UNLESS hidden.defined('dateexpiry') %] -- 2.34.1