Bugzilla – Attachment 103602 Details for
Bug 23495
Show SMS provider on details tab in patron account in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23495: Add SMS provider to moremember.tt
Bug-23495-Add-SMS-provider-to-moremembertt.patch (text/plain), 3.46 KB, created by
Nick Clemens (kidclamp)
on 2020-04-23 18:54:40 UTC
(
hide
)
Description:
Bug 23495: Add SMS provider to moremember.tt
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-04-23 18:54:40 UTC
Size:
3.46 KB
patch
obsolete
>From 4793503c431372707807f36763e98056d0c058d3 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 23 Apr 2020 18:50:18 +0000 >Subject: [PATCH] Bug 23495: Add SMS provider to moremember.tt > >To test: >1 - Enable SMS using the Email driver >2 - Add an SMS provider under admimistration >3 - Add an SMS number and provider to a patron >4 - Note on the patron details you don't see the provider :-( >5 - Apply patch >6 - Reload >7 - Note you do see the provider :-) >8 - prove t/db_dependent/Koha/Patrons.t >9 - Sign off! >--- > Koha/Patron.pm | 11 +++++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 4 ++++ > t/db_dependent/Koha/Patrons.t | 10 +++++++++- > 3 files changed, 24 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index fe3e80aebb..486406842a 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -431,6 +431,17 @@ sub library { > return Koha::Library->_new_from_dbic($self->_result->branchcode); > } > >+=head3 sms_provider >+ >+Returns a Koha::SMS::Provider object representing the patron's SMS provider. >+ >+=cut >+ >+sub sms_provider { >+ my ( $self ) = @_; >+ return Koha::SMS::Provider->_new_from_dbic($self->_result->sms_provider); >+} >+ > =head3 guarantor_relationships > > Returns Koha::Patron::Relationships object for this patron's guarantors >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 15ea33c9f0..82d2bf1ebc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -414,6 +414,10 @@ > <span class="label">SMS number:</span> > <a href="sms:[% patron.smsalertnumber | uri %]">[% patron.smsalertnumber | html %]</a> > </li> >+ <li> >+ <span class="label">SMS provider:</span> >+ [% patron.sms_provider.name | html %] >+ </li> > </ol> > </div> > [% END %] >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 0ca5faa717..3461bee9f4 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 40; >+use Test::More tests => 41; > use Test::Warn; > use Test::Exception; > use Test::MockModule; >@@ -88,6 +88,14 @@ subtest 'library' => sub { > is( ref($retrieved_patron_1->library), 'Koha::Library', 'Koha::Patron->library should return a Koha::Library object' ); > }; > >+subtest 'sms_provider' => sub { >+ plan tests => 2; >+ my $sms_provider = $builder->build({source => 'SmsProvider' }); >+ $retrieved_patron_1->sms_provider_id( $sms_provider->{id} )->store; >+ is_deeply( $retrieved_patron_1->sms_provider->unblessed, $sms_provider, 'Koha::Patron->sms_provider returns the correct SMS provider' ); >+ is( ref($retrieved_patron_1->sms_provider), 'Koha::SMS::Provider', 'Koha::Patron->sms_provider should return a Koha::SMS::Provider object' ); >+}; >+ > subtest 'guarantees' => sub { > plan tests => 13; > >-- >2.11.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 23495
:
103602
|
103604
|
103641
|
103642