Bugzilla – Attachment 154001 Details for
Bug 34438
OPAC self registration form does not include lang (preferred language for notices) field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34438: Add lang field to OPAC patron self registration form
Bug-34438-Add-lang-field-to-OPAC-patron-self-regis.patch (text/plain), 7.96 KB, created by
Lucas Gass (lukeg)
on 2023-07-27 20:48:02 UTC
(
hide
)
Description:
Bug 34438: Add lang field to OPAC patron self registration form
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-07-27 20:48:02 UTC
Size:
7.96 KB
patch
obsolete
>From 7ed0fa521604ce6b42ac91a5414338a59bdba8d1 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 27 Jul 2023 20:32:14 +0000 >Subject: [PATCH] Bug 34438: Add lang field to OPAC patron self registration > form > >--- > .../bootstrap/en/modules/opac-memberentry.tt | 32 ++++++++++++++++++- > opac/opac-memberentry.pl | 7 ++-- > 2 files changed, 36 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 89a9e841e0..168d344da6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -214,7 +214,7 @@ > > <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off"> > >- [% 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' ] %] >+ [% 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' ] %] > [% IF mandatory.defined( field ) %] > [% SET required.$field = 'required' %] > [% END %] >@@ -683,6 +683,36 @@ > </select> > [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %] > </li> >+ [% UNLESS hidden.defined('lang') %] >+ <li> >+ [% IF ( mandatory.defined('lang') ) %] >+ <label for="borrower_lang" class="required">Preferred language for notices: </label> >+ [% ELSE %] >+ <label for="borrower_lang">Preferred language for notices: </label> >+ [% END %] >+ <select id="borrower_lang" name="borrower_lang"> >+ <option value="default">Default</option> >+ [% FOR language IN languages %] >+ [% FOR sublanguage IN language.sublanguages_loop %] >+ [% IF language.plural %] >+ [% IF sublanguage.rfc4646_subtag == borrower.lang %] >+ <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >+ [% ELSE %] >+ <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >+ [% END %] >+ [% ELSE %] >+ [% IF sublanguage.rfc4646_subtag == borrower.lang %] >+ <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >+ [% ELSE %] >+ <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >+ [% END %] >+ [% END # /IF language.plural %] >+ [% END # /FOR sublanguage %] >+ [% END #/FOR language %] >+ </select> <!-- /#lang --> >+ [% IF ( mandatory.defined('lang') ) %]<div class="required_label required">Required</div>[% END %] >+ </li> >+ [% END %] > [% END %] > </ol> > </fieldset> >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index d18e5f542b..3723546a44 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -98,13 +98,16 @@ if ( defined $min ) { > > my $defaultCategory = Koha::Patron::Categories->find(C4::Context->preference('PatronSelfRegistrationDefaultCategory')); > >+my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') ); >+ > $template->param( > action => $action, > hidden => GetHiddenFields( $mandatory, $action ), > mandatory => $mandatory, > libraries => $libraries, > OPACPatronDetails => C4::Context->preference('OPACPatronDetails'), >- defaultCategory => $defaultCategory, >+ defaultCategory => $defaultCategory, >+ languages => $translated_languages, > ); > > my $attributes = ParsePatronAttributes($borrowernumber,$cgi); >@@ -561,7 +564,7 @@ sub ParseCgiForBorrower { > # Replace checkbox 'agreed' by datetime in gdpr_proc_consent > $borrower{gdpr_proc_consent} = dt_from_string if $borrower{gdpr_proc_consent} && $borrower{gdpr_proc_consent} eq 'agreed'; > >- delete $borrower{$_} for qw/borrowernumber date_renewed debarred debarredcomment flags privacy privacy_guarantor_fines privacy_guarantor_checkouts checkprevcheckout updated_on lastseen lang login_attempts overdrive_auth_token anonymized/; # See also members/memberentry.pl >+ delete $borrower{$_} for qw/borrowernumber date_renewed debarred debarredcomment flags privacy privacy_guarantor_fines privacy_guarantor_checkouts checkprevcheckout updated_on lastseen login_attempts overdrive_auth_token anonymized/; # See also members/memberentry.pl > delete $borrower{$_} for qw/dateenrolled dateexpiry borrowernotes opacnote sort1 sort2 sms_provider_id autorenew_checkouts gonenoaddress lost relationship/; # On OPAC only > delete $borrower{$_} for split( /\s*\|\s*/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q{} ); > >-- >2.30.2
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 34438
:
154001
|
154002
|
155775
|
155776
|
158152
|
158153
|
158154
|
158155
|
158156
|
158157
|
158158
|
158159
|
158181
|
158182
|
158183
|
158184
|
158196
|
158197
|
158198
|
158199