Bugzilla – Attachment 186049 Details for
Bug 20859
Enter SMS number and SMS provider during self registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20859: Add SMSalertnumber to OPAC registration page
Bug-20859-Add-SMSalertnumber-to-OPAC-registration-.patch (text/plain), 7.88 KB, created by
Magnus Enger
on 2025-09-02 14:09:02 UTC
(
hide
)
Description:
Bug 20859: Add SMSalertnumber to OPAC registration page
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2025-09-02 14:09:02 UTC
Size:
7.88 KB
patch
obsolete
>From 660851b35f829b70dbd10c1bab0ef1714d605226 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 25 May 2023 14:39:18 +0000 >Subject: [PATCH] Bug 20859: Add SMSalertnumber to OPAC registration page > >This patch adds the SMS number field to patron self registration. > >To test: >1. Apply patch. >2. Make sure an SMSSendDriver and some SMS cellular providers. >3. Go to the OPAC self registration form. >4. Notice the SMS Number and SMS provider fields now appear. >5. Use the PatronSelfRegistrationBorrowerMandatoryField and PatronSelfRegistrationBorrowerUnwantedField system preferences to ensure you can hide the fields and make them required. >6. Self register while adding a SMS number and SMS provider. Make sure that when you view the newly self-registered patron that the SMS number and SMS provider are properly populated in the staff interface. > >Rebased 2025-09-02 by Magnus Enger > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Signed-off-by: Magnus Enger <magnus@libriotech.no> >--- > .../bootstrap/en/modules/opac-memberentry.tt | 35 ++++++++++++++++++- > opac/opac-memberentry.pl | 10 +++++- > 2 files changed, 43 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 b6621ad741..118edf3143 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -222,7 +222,7 @@ > <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off"> > [% INCLUDE 'csrf-token.inc' %] > >- [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'preferred_name' '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' 'preferred_name' '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' 'smsalertnumber' 'sms_provider_id' ] %] > [% IF mandatory.defined( field ) %] > [% SET required.$field = 'required' %] > [% END %] >@@ -1169,6 +1169,39 @@ > <!-- /.row --> > [% END %] > >+ [% IF ( Koha.Preference('SMSSendDriver') ) && !hidden.defined('smsalertnumber') && !hidden.defined('sms_provider_id') && action != 'edit' %] >+ <div class="row"> >+ <div class="col"> >+ <fieldset class="rows" id="memberentry_sms"> >+ <legend id="sms_legend">SMS number</legend> >+ <ol> >+ [% UNLESS hidden.defined('smsalertnumber') %] >+ <li> >+ <label for="borrower_smsalertnumber" class="[% required.smsalertnumber | html %]">SMS number:</label> >+ <input type="text" id="borrower_smsalertnumber" name="borrower_smsalertnumber" value="[% borrower.smsalertnumber | html %]" class="[% required.smsalertnumber | html %]" /> >+ <div class="required_label [% required.smsalertnumber | html %]">Required</div> >+ <span class="hint smsalertnumber_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span> >+ </li> >+ [% END %] >+ [% UNLESS hidden.defined('sms_provider_id') %] >+ <li> >+ <label for="borrower_sms_provider_id" class="[% required.sms_provider_id | html %]">SMS provider:</label> >+ <select id="borrower_sms_provider_id" name="borrower_sms_provider_id" class="[% required.sms_provider_id | html %]"> >+ <option value="">Unknown</option> >+ [% FOREACH s IN sms_providers %] >+ <option value="[% s.id | html %]">[% s.name | html %]</option> >+ [% END %] >+ </select> >+ <div class="required_label [% required.sms_provider_id | html %]">Required</div> >+ <span class="hint sms_provider_id_help">Please contact a library staff member if you are unsure of your mobile service provider, or you do not see your provider in this list.</span> >+ </li> >+ [% END %] >+ </ol> >+ </fieldset> >+ </div> >+ </div> >+ [% END %] >+ > [% UNLESS op == 'edit' || hidden.defined('password') %] > <div class="row"> > <div class="col"> >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 14ec05e753..987123497d 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -45,6 +45,7 @@ use Koha::Patron::Images; > use Koha::Patron::Categories; > use Koha::Policy::Patrons::Cardnumber; > use Koha::AuthorisedValues; >+use Koha::SMS::Providers; > my $cgi = CGI->new; > my $dbh = C4::Context->dbh; > >@@ -102,6 +103,13 @@ if ( defined $min ) { > > my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('opacthemes') ); > >+if( C4::Context->preference("SMSSendDriver") eq 'Email' ) { >+ my @providers = Koha::SMS::Providers->search( {}, { order_by => 'name' } )->as_list; >+ $template->param( >+ sms_providers => \@providers, >+ ); >+} >+ > $template->param( > op => $op, > hidden => GetHiddenFields( $mandatory, $op ), >@@ -585,7 +593,7 @@ sub ParseCgiForBorrower { > ; # See also members/memberentry.pl > delete $borrower{$_} > for >- qw/dateenrolled dateexpiry borrowernotes opacnote sort1 sort2 sms_provider_id autorenew_checkouts gonenoaddress lost relationship/ >+ qw/dateenrolled dateexpiry borrowernotes opacnote sort1 sort2 autorenew_checkouts gonenoaddress lost relationship/ > ; # On OPAC only > delete $borrower{$_} > for split( /\s*\|\s*/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q{} ); >-- >2.43.0
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 20859
:
151688
|
152327
|
152386
| 186049 |
186050