From 7298a58d933a1a83c86e30f83ca20ac96d932160 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 26 Feb 2023 11:59:56 +0000 Subject: [PATCH] Bug 25590: Street number is missing from the alternate address in the OPAC This patch adds the street number field to the alternate address section in the OPAC, matching the layout of the address in the staff interface. To test: 1) Check that you are unable to add a street number to the Alternate address when logged into the OPAC 2) Apply the patch 3) Check that you can now add and edit the streetnumber field. 4) Check that it also works correctly in patron self-registration. 5) Make the field mandatory and verify this works as expected (PatronSelfRegistrationBorrowerMandatoryField and PatronSelfModificationBorrowerMandatoryField) 6) Hide the field from the form (PatronSelfRegistrationBorrowerUnwantedField and PatronSelfModificationBorrowerUnwantedField) 7) Change the AddressFormat system preference to German 8) Verify that the street number field moved after the first address line matching the first address in the form. Signed-off-by: Owen Leonard --- .../bootstrap/en/modules/opac-memberentry.tt | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 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 04c8c3e655..5b33c3ea9f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -15,11 +15,21 @@
  • - +
    Required
  • [% END %] [% END %] +[% BLOCK B_streetnumber %] + [% UNLESS hidden.defined('B_streetnumber') %] +
  • + + + +
    Required
    +
  • + [% END %] +[% END %] [% INCLUDE 'doc-head-open.inc' %] [% IF action == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog @@ -193,7 +203,7 @@
    - [% 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_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' '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' ] %] [% IF mandatory.defined( field ) %] [% SET required.$field = 'required' %] [% END %] @@ -661,13 +671,15 @@ [% END %] [%# Following on one line for translatability %] - [% UNLESS hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') && hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_country') && hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote') %] + [% UNLESS hidden.defined('B_streetnumber') && hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') && hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_country') && hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote') %]
    Alternate address
      + [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE B_streetnumber %][% END %] + [% SET roadtypes = AuthorisedValues.GetAuthValueDropbox('ROADTYPE') %] [% IF roadtypes.count %] [% UNLESS hidden.defined('B_streettype') %] @@ -697,6 +709,8 @@ [% END %] + [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %] + [% UNLESS hidden.defined('B_address2') %]
    1. -- 2.30.2