Bugzilla – Attachment 152386 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.93 KB, created by
Emily Lamancusa (emlam)
on 2023-06-15 15:24:17 UTC
(
hide
)
Description:
Bug 20859: Add SMSalertnumber to OPAC registration page
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2023-06-15 15:24:17 UTC
Size:
7.93 KB
patch
obsolete
>From 17e78f85940050b62bd0645cff27a9a37877fdbf 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. > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > .../bootstrap/en/modules/opac-memberentry.tt | 34 ++++++++++++++++++- > opac/opac-memberentry.pl | 10 +++++- > 2 files changed, 42 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 89a9e841e0..99d3efe87a 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' 'smsalertnumber' 'sms_provider_id' ] %] > [% IF mandatory.defined( field ) %] > [% SET required.$field = 'required' %] > [% END %] >@@ -902,7 +902,39 @@ > </div> <!-- /.col --> > </div> <!-- /.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 action == 'edit' || hidden.defined('password') %] > <div class="row"> > <div class="col"> >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index d18e5f542b..7ded651ff8 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::Token; > use Koha::AuthorisedValues; >+use Koha::SMS::Providers; > my $cgi = CGI->new; > my $dbh = C4::Context->dbh; > >@@ -98,6 +99,13 @@ if ( defined $min ) { > > my $defaultCategory = Koha::Patron::Categories->find(C4::Context->preference('PatronSelfRegistrationDefaultCategory')); > >+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( > action => $action, > hidden => GetHiddenFields( $mandatory, $action ), >@@ -562,7 +570,7 @@ sub ParseCgiForBorrower { > $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/dateenrolled dateexpiry borrowernotes opacnote sort1 sort2 sms_provider_id autorenew_checkouts gonenoaddress lost relationship/; # On OPAC only >+ delete $borrower{$_} for 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{} ); > > return %borrower; >-- >2.34.1
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