View | Details | Raw Unified | Return to bug 9021
Collapse All | Expand All

(-)a/C4/Letters.pm (-1 / +10 lines)
Lines 30-35 use C4::Log; Link Here
30
use C4::SMS;
30
use C4::SMS;
31
use C4::Debug;
31
use C4::Debug;
32
use Date::Calc qw( Add_Delta_Days );
32
use Date::Calc qw( Add_Delta_Days );
33
use Koha::SMS::Provider;
33
use Encode;
34
use Encode;
34
use Carp;
35
use Carp;
35
36
Lines 749-755 sub SendQueuedMessages { Link Here
749
            _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
750
            _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
750
        }
751
        }
751
        elsif ( lc( $message->{'message_transport_type'} ) eq 'sms' ) {
752
        elsif ( lc( $message->{'message_transport_type'} ) eq 'sms' ) {
752
            _send_message_by_sms( $message );
753
            if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
754
                my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} );
755
                my $sms_provider = Koha::SMS::Provider->find( $member->{'sms_provider_id'} );
756
                $message->{to_address} .= '@' . $sms_provider->domain();
757
                _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
758
            } else {
759
                _send_message_by_sms( $message );
760
            }
753
        }
761
        }
754
    }
762
    }
755
    return scalar( @$unsent_messages );
763
    return scalar( @$unsent_messages );
Lines 962-967 sub _send_message_by_email { Link Here
962
    }
970
    }
963
971
964
    _update_message_to_address($message->{'message_id'},$to_address) unless $message->{to_address}; #if initial message address was empty, coming here means that a to address was found and queue should be updated
972
    _update_message_to_address($message->{'message_id'},$to_address) unless $message->{to_address}; #if initial message address was empty, coming here means that a to address was found and queue should be updated
973
965
    if ( sendmail( %sendmail_params ) ) {
974
    if ( sendmail( %sendmail_params ) ) {
966
        _set_message_status( { message_id => $message->{'message_id'},
975
        _set_message_status( { message_id => $message->{'message_id'},
967
                status     => 'sent' } );
976
                status     => 'sent' } );
(-)a/C4/Members.pm (-1 / +5 lines)
Lines 722-728 sub ModMember { Link Here
722
            $data{password} = md5_base64($data{password});
722
            $data{password} = md5_base64($data{password});
723
        }
723
        }
724
    }
724
    }
725
	my $execute_success=UpdateInTable("borrowers",\%data);
725
726
    $data{'sms_provider_id'} = undef unless ( $data{'sms_provider_id'} );
727
728
    my $execute_success=UpdateInTable("borrowers",\%data);
729
726
    if ($execute_success) { # only proceed if the update was a success
730
    if ($execute_success) { # only proceed if the update was a success
727
        # ok if its an adult (type) it may have borrowers that depend on it as a guarantor
731
        # ok if its an adult (type) it may have borrowers that depend on it as a guarantor
728
        # so when we update information for an adult we should check for guarantees and update the relevant part
732
        # so when we update information for an adult we should check for guarantees and update the relevant part
(-)a/Koha/SMS/Provider.pm (+157 lines)
Line 0 Link Here
1
package Koha::SMS::Provider;
2
3
# Copyright 2012 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
=head1 NAME
21
22
Koha::SMS::Provider - class to manage sms providers
23
24
=head1 SYNOPSIS
25
26
Object-oriented class that encapsulates sms providers in Koha.
27
28
=head1 DESCRIPTION
29
30
SMS::Provider data.
31
32
=cut
33
34
use Modern::Perl;
35
36
use C4::Context;
37
38
use base qw(Class::Accessor);
39
40
__PACKAGE__->mk_accessors(qw( id name domain ));
41
42
=head2 new
43
44
    my $provider = Koha::SMS::Provider->new($data);
45
46
Create a new Koha::SMS::Provider object based on the provided record.
47
48
=cut
49
50
sub new {
51
    my $class = shift;
52
    my $data  = shift;
53
54
    my $self = $class->SUPER::new($data);
55
56
    bless $self, $class;
57
    return $self;
58
}
59
60
=head2 store
61
62
    Creates or updates the object in the database
63
64
=cut
65
66
sub store {
67
    my $self = shift;
68
69
    if ( $self->id ) {
70
        return C4::Context->dbh->do( "UPDATE sms_providers SET name = ?, domain = ? WHERE id = ?", undef, ( $self->name, $self->domain, $self->id ) );
71
    } else {
72
        return C4::Context->dbh->do( "INSERT INTO sms_providers ( name, domain ) VALUES ( ?, ? )", undef, ( $self->name, $self->domain ) );
73
    }
74
}
75
76
=head2 delete
77
78
=cut
79
80
sub delete {
81
    my $self = shift;
82
83
    return C4::Context->dbh->do( "DELETE FROM sms_providers WHERE id = ?", undef, ( $self->id ) );
84
}
85
86
=head2 all
87
88
    my $providers = Koha::SMS::Provider->all();
89
90
=cut
91
92
sub all {
93
    my $class = shift;
94
95
    my $query = "SELECT * FROM sms_providers ORDER BY name";
96
    my $sth   = C4::Context->dbh->prepare($query);
97
    $sth->execute();
98
99
    my @providers;
100
    while ( my $row = $sth->fetchrow_hashref() ) {
101
        my $p = Koha::SMS::Provider->new($row);
102
        push( @providers, $p );
103
    }
104
105
    return @providers;
106
}
107
108
=head2 find
109
110
  my $provider = Koha::SMS::Provider->find( $id );
111
112
=cut
113
114
sub find {
115
    my $class = shift;
116
    my $id    = shift;
117
118
    my $query = "SELECT * FROM sms_providers WHERE ID = ?";
119
    my $sth   = C4::Context->dbh->prepare($query);
120
    $sth->execute($id);
121
122
    my $row = $sth->fetchrow_hashref();
123
    my $p   = Koha::SMS::Provider->new($row);
124
125
    return $p;
126
}
127
128
=head2 search
129
130
  my @providers = Koha::SMS::Provider->search({ [name => $name], [domain => $domain] });
131
132
=cut
133
134
sub search {
135
    my $class  = shift;
136
    my $params = shift;
137
138
    my $query = "SELECT * FROM sms_providers WHERE ";
139
140
    my @params = map( $params->{$_}, keys %$params );
141
    $query .= join( " AND ", map( "$_ = ?", keys %$params ) );
142
143
    $query .= " ORDER BY name";
144
145
    my $sth = C4::Context->dbh->prepare($query);
146
    $sth->execute(@params);
147
148
    my @providers;
149
    while ( my $row = $sth->fetchrow_hashref() ) {
150
        my $p = Koha::SMS::Provider->new($row);
151
        push( @providers, $p );
152
    }
153
154
    return @providers;
155
}
156
157
1;
(-)a/admin/admin-home.pl (-1 / +4 lines)
Lines 34-39 my ($template, $loggedinuser, $cookie) Link Here
34
			     debug => 1,
34
			     debug => 1,
35
			     });
35
			     });
36
36
37
$template->param( SearchEngine => C4::Context->preference('SearchEngine') );
37
$template->param(
38
    SearchEngine => C4::Context->preference('SearchEngine'),
39
    SMSSendDriver => C4::Context->preference('SMSSendDriver'),
40
);
38
41
39
output_html_with_http_headers $query, $cookie, $template->output;
42
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/admin/sms_providers.pl (+59 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2012 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
use CGI;
23
24
use C4::Context;
25
use C4::Auth;
26
use C4::Output;
27
28
use Koha::SMS::Provider;
29
30
my $cgi = new CGI;
31
32
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
    {   template_name   => "admin/sms_providers.tmpl",
34
        query           => $cgi,
35
        type            => "intranet",
36
        authnotrequired => 0,
37
        flagsrequired   => { parameters => 'parameters_remaining_permissions' },
38
        debug           => 1,
39
    }
40
);
41
42
my $op = $cgi->param('op');
43
my $id = $cgi->param('id');
44
my $name = $cgi->param('name');
45
my $domain = $cgi->param('domain');
46
47
if ( $op eq 'add_update' ) {
48
    if ( $name && $domain ) {
49
        Koha::SMS::Provider->new({ id => $id, name => $name, domain => $domain })->store();
50
    }
51
} elsif ( $op eq 'delete' ) {
52
    Koha::SMS::Provider->find( $id )->delete();
53
}
54
55
my @providers = Koha::SMS::Provider->all();
56
57
$template->param( providers => \@providers );
58
59
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/installer/data/mysql/kohastructure.sql (-1 / +17 lines)
Lines 262-267 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
262
  `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
262
  `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
263
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
263
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
264
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
264
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
265
  `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
265
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
266
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
266
  UNIQUE KEY `cardnumber` (`cardnumber`),
267
  UNIQUE KEY `cardnumber` (`cardnumber`),
267
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
268
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
Lines 269-276 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
269
  KEY `branchcode` (`branchcode`),
270
  KEY `branchcode` (`branchcode`),
270
  KEY `userid` (`userid`),
271
  KEY `userid` (`userid`),
271
  KEY `guarantorid` (`guarantorid`),
272
  KEY `guarantorid` (`guarantorid`),
273
  KEY `sms_provider_id` (`sms_provider_id`)
272
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
274
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
273
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
275
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
276
  CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`)
274
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
277
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
275
278
276
--
279
--
Lines 1817-1822 CREATE TABLE sessions ( Link Here
1817
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1820
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1818
1821
1819
--
1822
--
1823
-- Table structure for table `sms_providers`
1824
--
1825
1826
DROP TABLE IF EXISTS sms_providers;
1827
CREATE TABLE `sms_providers` (
1828
  `id` int(11) NOT NULL AUTO_INCREMENT,
1829
  `name` varchar(255) NOT NULL,
1830
  `domain` varchar(255) NOT NULL,
1831
  PRIMARY KEY (`id`),
1832
  UNIQUE KEY `name` (`name`)
1833
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1834
1835
--
1820
-- Table structure for table `special_holidays`
1836
-- Table structure for table `special_holidays`
1821
--
1837
--
1822
1838
(-)a/installer/data/mysql/updatedatabase.pl (+19 lines)
Lines 6346-6351 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6346
    SetVersion($DBversion);
6346
    SetVersion($DBversion);
6347
}
6347
}
6348
6348
6349
$DBversion = "3.11.00.XXX";
6350
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6351
   $dbh->do("
6352
       CREATE TABLE  sms_providers (
6353
           id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
6354
           name VARCHAR( 255 ) NOT NULL ,
6355
           domain VARCHAR( 255 ) NOT NULL ,
6356
           UNIQUE (
6357
               name
6358
           )
6359
       ) ENGINE = INNODB CHARACTER SET utf8;
6360
   ");
6361
   $dbh->do("ALTER TABLE borrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber, ADD INDEX ( sms_provider_id )");
6362
   $dbh->do("ALTER TABLE borrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES  sms_providers ( id )");
6363
6364
   print "Upgrade to $DBversion done (Add SMS via Email feature)\n";
6365
   SetVersion ($DBversion);
6366
}
6367
6349
=head1 FUNCTIONS
6368
=head1 FUNCTIONS
6350
6369
6351
=head2 TableExists($table)
6370
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (-5 / +13 lines)
Lines 101-114 Link Here
101
101
102
<h3>Additional parameters</h3>
102
<h3>Additional parameters</h3>
103
<dl>
103
<dl>
104
	[% IF ( NoZebra ) %]<dt><a href="/cgi-bin/koha/admin/stopwords.pl">Stop words</a></dt>
104
    [% IF ( NoZebra ) %]<dt><a href="/cgi-bin/koha/admin/stopwords.pl">Stop words</a></dt>
105
	<dd>Words ignored during search.</dd>[% END %]
105
        <dd>Words ignored during search.</dd>
106
	<!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
106
    [% END %]
107
	<dd>Printers (UNIX paths).</dd> -->
107
    <!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
108
    <dd>Printers (UNIX paths).</dd> -->
109
108
    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
110
    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
109
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
111
    <dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
112
110
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
113
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
111
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
114
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
115
116
    [% IF SMSSendDriver == 'Email' %]
117
        <dt><a href="/cgi-bin/koha/admin/sms_providers.pl">SMS cellular providers</a></dt>
118
        <dd>Define a list of cellular providers for sending SMS messages via email.</dd>
119
    [% END %]
112
</dl>
120
</dl>
113
</div>
121
</div>
114
122
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt (+102 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; SMS cellular providers</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<script type="text/javascript">
7
$(document).ready(function() {
8
    $('#submit_update').hide();
9
    $("#name").focus();
10
});
11
12
function edit_provider( id ) {
13
    cancel_edit();
14
15
    $("#id").val( id );
16
    $("#name").val( $("#name_" + id).text() );
17
    $("#domain").val( $("#domain_" + id).text() );
18
19
    $("#name_" + id).parent().addClass("warn");
20
21
    $("#submit_save").hide();
22
    $("#submit_update").show();
23
24
    $("#name").focus();
25
}
26
27
function cancel_edit() {
28
    $("#id").val("");
29
    $("#name").val("");
30
    $("#domain").val("");
31
32
    $("tr").removeClass("warn");
33
34
    $("#submit_update").hide();
35
    $("#submit_save").show();
36
37
}
38
39
function delete_provider( id ) {
40
    if ( confirm( _("Are you sure you want to delete ") + $("#name_" + id).html() + _("?") ) ) {
41
        $("#op").val('delete');
42
        $("#id").val( id );
43
        $("#sms_form").submit();
44
    }
45
}
46
</script>
47
<body id="admin_sms_providers" class="admin">
48
[% INCLUDE 'header.inc' %]
49
50
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; SMS cellular providers</div>
51
52
<div id="doc3" class="yui-t2">
53
    <div id="bd">
54
        <div id="yui-main">
55
     <div class="yui-b">
56
                <h2>SMS cellular providers</h2>
57
58
                <table>
59
                    <thead>
60
                        <tr>
61
                            <th>Name</th>
62
                            <th>Domain</th>
63
                            <th>&nbsp;</th>
64
                            <th>&nbsp;</th>
65
                        </tr>
66
                    </thead>
67
68
                    <tbody>
69
                        [% FOREACH p IN providers %]
70
                            <tr>
71
                                <td id="name_[% p.id %]">[% p.name %]</td>
72
                                <td id="domain_[% p.id %]">[% p.domain %]</td>
73
                                <td><a href="#" id="edit_[% p.id %]" class="edit" onclick="edit_provider( [% p.id %] );">Edit</td>
74
                                <td><a href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %] );">Delete</td>
75
                            </tr>
76
                        [% END %]
77
                    </tbody>
78
79
                    <tfoot>
80
                        <form id="sms_form" action="sms_providers.pl" method="post">
81
                            <input type="hidden" id="id" name="id" value="" />
82
                            <input type="hidden" id="op" name="op" value="add_update" />
83
                            <tr>
84
                                <td><input type="text" id="name" name="name" /></td>
85
                                <td><input type="text" id="domain" name="domain" size="40"/></td>
86
                                <td>
87
                                    <input id="submit_save" type="submit" value="Add new">
88
                                    <input id="submit_update" type="submit" value="Update">
89
                                </td>
90
                                <td><a id="cancel" href="#" onclick="cancel_edit()">Cancel</a></td>
91
                            </tr>
92
                        </form>
93
                    </tfoot>
94
                </table>
95
            </div>
96
        </div>
97
        <div class="yui-b">
98
            [% INCLUDE 'admin-menu.inc' %]
99
        </div>
100
    </div>
101
</div>
102
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+13 lines)
Lines 1441-1446 Link Here
1441
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1441
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1442
        [% END %]
1442
        [% END %]
1443
        </p>
1443
        </p>
1444
        <p>
1445
            <label for="sms_provider_id">SMS provider:</label>
1446
            <select id="sms_provider_id" name="sms_provider_id"/>
1447
                <option value="">Unknown</option>
1448
                [% FOREACH s IN sms_providers %]
1449
                    [% IF s.id == sms_provider_id %]
1450
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1451
                    [% ELSE %]
1452
                        <option value="[% s.id %]">[% s.name %]</option>
1453
                    [% END %]
1454
                [% END %]
1455
            </select>
1456
        </p>
1444
    [% END %]
1457
    [% END %]
1445
  </fieldset>
1458
  </fieldset>
1446
[% END %] [% END %]
1459
[% END %] [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt (-1 / +24 lines)
Lines 143-150 Link Here
143
    </tr>
143
    </tr>
144
    [% END %]
144
    [% END %]
145
  </table>
145
  </table>
146
[% IF ( SMSSendDriver ) %]<ol><li><label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" /></li></ol>[% END %]
147
146
147
    [% IF ( SMSSendDriver ) %]
148
        <ol><li><label>Notice:</label>Some charges for text messages may be incurred when using this service. Please check with your mobile service provider if you have questions.</li></ol>
149
        <ol><li>
150
            <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
151
            <i>Please enter numbers only. <b>(123) 456-7890</b> would be entered as <b>1234567890</b>.</i>
152
        </li></ol>
153
    [% END %]
154
155
    [% IF ( SMSSendDriver == 'Email' ) %]
156
        <ol><li>
157
            <label for="sms_provider_id">SMS provider:</label>
158
            <select id="sms_provider_id" name="sms_provider_id"/>
159
                <option value="">Unknown</option>
160
                [% FOREACH s IN sms_providers %]
161
                    [% IF s.id == sms_provider_id %]
162
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
163
                    [% ELSE %]
164
                        <option value="[% s.id %]">[% s.name %]</option>
165
                    [% END %]
166
                [% END %]
167
            </select>
168
            <i>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.</i>
169
        </li></ol>
170
    [% END %]
148
</fieldset>
171
</fieldset>
149
172
150
<fieldset class="action">
173
<fieldset class="action">
(-)a/members/memberentry.pl (+7 lines)
Lines 41-46 use C4::Log; Link Here
41
use C4::Letters;
41
use C4::Letters;
42
use C4::Branch; # GetBranches
42
use C4::Branch; # GetBranches
43
use C4::Form::MessagingPreferences;
43
use C4::Form::MessagingPreferences;
44
use Koha::SMS::Provider;
44
45
45
use vars qw($debug);
46
use vars qw($debug);
46
47
Lines 62-67 my ($template, $loggedinuser, $cookie) Link Here
62
           flagsrequired => {borrowers => 1},
63
           flagsrequired => {borrowers => 1},
63
           debug => ($debug) ? 1 : 0,
64
           debug => ($debug) ? 1 : 0,
64
       });
65
       });
66
67
if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
68
    my @providers = Koha::SMS::Provider->all();
69
    $template->param( sms_providers => \@providers );
70
}
71
65
my $guarantorid    = $input->param('guarantorid');
72
my $guarantorid    = $input->param('guarantorid');
66
my $borrowernumber = $input->param('borrowernumber');
73
my $borrowernumber = $input->param('borrowernumber');
67
my $actionType     = $input->param('actionType') || '';
74
my $actionType     = $input->param('actionType') || '';
(-)a/opac/opac-messaging.pl (-2 / +8 lines)
Lines 54-60 if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { Link Here
54
    # If they've modified the SMS number, record it.
54
    # If they've modified the SMS number, record it.
55
    if ( ( defined $query->param('SMSnumber') ) && ( $query->param('SMSnumber') ne $borrower->{'mobile'} ) ) {
55
    if ( ( defined $query->param('SMSnumber') ) && ( $query->param('SMSnumber') ne $borrower->{'mobile'} ) ) {
56
        ModMember( borrowernumber => $borrowernumber,
56
        ModMember( borrowernumber => $borrowernumber,
57
                   smsalertnumber => $query->param('SMSnumber') );
57
                   smsalertnumber => $query->param('SMSnumber'),
58
                   sms_provider_id => $query->param('sms_provider_id')
59
                 );
58
        $borrower = GetMemberDetails( $borrowernumber );
60
        $borrower = GetMemberDetails( $borrowernumber );
59
    }
61
    }
60
62
Lines 70-73 $template->param( BORROWER_INFO => [ $borrower ], Link Here
70
                  SMSSendDriver                =>  C4::Context->preference("SMSSendDriver"),
72
                  SMSSendDriver                =>  C4::Context->preference("SMSSendDriver"),
71
                  TalkingTechItivaPhone        =>  C4::Context->preference("TalkingTechItivaPhoneNotification") );
73
                  TalkingTechItivaPhone        =>  C4::Context->preference("TalkingTechItivaPhoneNotification") );
72
74
75
if ( C4::Context->preference("SMSSendDriver") eq 'Email' ) {
76
    my @providers = Koha::SMS::Provider->all();
77
    $template->param( sms_providers => \@providers, sms_provider_id => $borrower->{'sms_provider_id'} );
78
}
79
73
output_html_with_http_headers $query, $cookie, $template->output;
80
output_html_with_http_headers $query, $cookie, $template->output;
74
- 

Return to bug 9021