From 3db5790462c411ac85e2e1a09741479c331d44b3 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 4 May 2021 20:48:18 +0000 Subject: [PATCH] Bug 18112: Add street type to self reg/self mod form 1. Add some values to the ROADTYPE authorized value 2. Go to PatronSelfRegistrationBorrowerUnwantedField and make sure streettype is NOT checked 3. Go the self reg form, no street type field 4. Apply patch 5. Check the self reg form, streettype should be there with all the options defined in ROADTYPE a.v. 6. Check the self modification form, street type should be there. 7. Make sure PatronSelfRegistrationBorrowerUnwantedField and PatronSelfModificationBorrowerUnwantedField hide the field correctly. 8. Make sure PatronSelfRegistrationBorrowerMandatoryField properly makes the field required. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer --- .../bootstrap/en/modules/opac-memberentry.tt | 22 +++++++++++++++++++++- opac/opac-memberentry.pl | 7 ++++++- 2 files changed, 27 insertions(+), 2 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 af7280a1ef..206fe212b4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -190,7 +190,7 @@
- [% FOREACH field = ['streetnumber' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'dateofbirth' 'initials' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' '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' ] %] + [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'dateofbirth' 'initials' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' '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' ] %] [% IF mandatory.defined( field ) %] [% SET required.$field = 'required' %] [% END %] @@ -425,6 +425,26 @@
    [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE streetnumber %][% END %] + [% IF roadtypes %] + [% UNLESS hidden.defined('streettype') %] +
  1. + + + +
    Required
    +
  2. + [% END %] + [% END %] + [% UNLESS hidden.defined('address') %]
  3. diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 17f2b480f8..0cd16d90a1 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -44,7 +44,7 @@ use Koha::Patron::Modification; use Koha::Patron::Modifications; use Koha::Patron::Categories; use Koha::Token; - +use Koha::AuthorisedValues; my $cgi = CGI->new; my $dbh = C4::Context->dbh; @@ -118,6 +118,11 @@ foreach my $attr (@$attributes) { } } +my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' ); +$template->param( + roadtypes => $roadtypes, +); + if ( $action eq 'create' ) { my %borrower = ParseCgiForBorrower($cgi); -- 2.11.0