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

(-)a/C4/Letters.pm (-1 / +11 lines)
Lines 31-36 use C4::Log; Link Here
31
use C4::SMS;
31
use C4::SMS;
32
use C4::Debug;
32
use C4::Debug;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::SMS::Provider;
35
34
use Date::Calc qw( Add_Delta_Days );
36
use Date::Calc qw( Add_Delta_Days );
35
use Encode;
37
use Encode;
36
use Carp;
38
use Carp;
Lines 738-744 sub SendQueuedMessages { Link Here
738
            _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
740
            _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
739
        }
741
        }
740
        elsif ( lc( $message->{'message_transport_type'} ) eq 'sms' ) {
742
        elsif ( lc( $message->{'message_transport_type'} ) eq 'sms' ) {
741
            _send_message_by_sms( $message );
743
            if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
744
                my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} );
745
                my $sms_provider = Koha::SMS::Provider->find( $member->{'sms_provider_id'} );
746
                $message->{to_address} .= '@' . $sms_provider->domain();
747
                _send_message_by_email( $message, $params->{'username'}, $params->{'password'}, $params->{'method'} );
748
            } else {
749
                _send_message_by_sms( $message );
750
            }
742
        }
751
        }
743
    }
752
    }
744
    return scalar( @$unsent_messages );
753
    return scalar( @$unsent_messages );
Lines 966-971 sub _send_message_by_email { Link Here
966
    }
975
    }
967
976
968
    _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
977
    _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
978
969
    if ( sendmail( %sendmail_params ) ) {
979
    if ( sendmail( %sendmail_params ) ) {
970
        _set_message_status( { message_id => $message->{'message_id'},
980
        _set_message_status( { message_id => $message->{'message_id'},
971
                status     => 'sent' } );
981
                status     => 'sent' } );
(-)a/C4/Members.pm (-1 / +6 lines)
Lines 786-793 sub ModMember { Link Here
786
            $data{password} = hash_password($data{password});
786
            $data{password} = hash_password($data{password});
787
        }
787
        }
788
    }
788
    }
789
789
    my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} );
790
    my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} );
790
    my $execute_success=UpdateInTable("borrowers",\%data);
791
792
    $data{'sms_provider_id'} = undef unless ( $data{'sms_provider_id'} );
793
794
    my $execute_success = UpdateInTable( "borrowers", \%data );
795
791
    if ($execute_success) { # only proceed if the update was a success
796
    if ($execute_success) { # only proceed if the update was a success
792
        # ok if its an adult (type) it may have borrowers that depend on it as a guarantor
797
        # ok if its an adult (type) it may have borrowers that depend on it as a guarantor
793
        # so when we update information for an adult we should check for guarantees and update the relevant part
798
        # 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.tt",
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 264-269 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
264
  `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
264
  `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
267
  `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
Lines 274-281 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
274
  KEY `surname_idx` (`surname`(255)),
275
  KEY `surname_idx` (`surname`(255)),
275
  KEY `firstname_idx` (`firstname`(255)),
276
  KEY `firstname_idx` (`firstname`(255)),
276
  KEY `othernames_idx` (`othernames`(255)),
277
  KEY `othernames_idx` (`othernames`(255)),
278
  KEY `sms_provider_id` (`sms_provider_id`),
277
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
279
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
278
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
280
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
281
  CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`)
279
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
282
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
280
283
281
--
284
--
Lines 1951-1956 CREATE TABLE sessions ( Link Here
1951
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1954
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1952
1955
1953
--
1956
--
1957
-- Table structure for table `sms_providers`
1958
--
1959
1960
DROP TABLE IF EXISTS sms_providers;
1961
CREATE TABLE `sms_providers` (
1962
  `id` int(11) NOT NULL AUTO_INCREMENT,
1963
  `name` varchar(255) NOT NULL,
1964
  `domain` varchar(255) NOT NULL,
1965
  PRIMARY KEY (`id`),
1966
  UNIQUE KEY `name` (`name`)
1967
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1968
1969
--
1954
-- Table structure for table `special_holidays`
1970
-- Table structure for table `special_holidays`
1955
--
1971
--
1956
1972
(-)a/installer/data/mysql/updatedatabase.pl (+19 lines)
Lines 8570-8575 if ( CheckVersion($DBversion) ) { Link Here
8570
    SetVersion($DBversion);
8570
    SetVersion($DBversion);
8571
}
8571
}
8572
8572
8573
$DBversion = "3.17.00.XXX";
8574
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
8575
   $dbh->do("
8576
       CREATE TABLE  sms_providers (
8577
           id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
8578
           name VARCHAR( 255 ) NOT NULL ,
8579
           domain VARCHAR( 255 ) NOT NULL ,
8580
           UNIQUE (
8581
               name
8582
           )
8583
       ) ENGINE = INNODB CHARACTER SET utf8;
8584
   ");
8585
   $dbh->do("ALTER TABLE borrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber, ADD INDEX ( sms_provider_id )");
8586
   $dbh->do("ALTER TABLE borrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES  sms_providers ( id )");
8587
8588
   print "Upgrade to $DBversion done (Add SMS via Email feature)\n";
8589
   SetVersion ($DBversion);
8590
}
8591
8573
=head1 FUNCTIONS
8592
=head1 FUNCTIONS
8574
8593
8575
=head2 TableExists($table)
8594
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (-3 / +12 lines)
Lines 98-109 Link Here
98
98
99
<h3>Additional parameters</h3>
99
<h3>Additional parameters</h3>
100
<dl>
100
<dl>
101
	<!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
101
    <!--
102
	<dd>Printers (UNIX paths).</dd> -->
102
    <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
103
    <dd>Printers (UNIX paths).</dd>
104
    -->
105
103
    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
106
    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
104
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
107
    <dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
108
105
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
109
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
106
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
110
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
111
112
    [% IF SMSSendDriver == 'Email' %]
113
        <dt><a href="/cgi-bin/koha/admin/sms_providers.pl">SMS cellular providers</a></dt>
114
        <dd>Define a list of cellular providers for sending SMS messages via email.</dd>
115
    [% END %]
107
</dl>
116
</dl>
108
</div>
117
</div>
109
118
(-)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 1367-1372 Link Here
1367
        <p><label for="SMSnumber">SMS number:</label>
1367
        <p><label for="SMSnumber">SMS number:</label>
1368
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" class="[% focusAction %]" />
1368
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" class="[% focusAction %]" />
1369
        </p>
1369
        </p>
1370
        <p>
1371
            <label for="sms_provider_id">SMS provider:</label>
1372
            <select id="sms_provider_id" name="sms_provider_id"/>
1373
                <option value="">Unknown</option>
1374
                [% FOREACH s IN sms_providers %]
1375
                    [% IF s.id == sms_provider_id %]
1376
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1377
                    [% ELSE %]
1378
                        <option value="[% s.id %]">[% s.name %]</option>
1379
                    [% END %]
1380
                [% END %]
1381
            </select>
1382
        </p>
1370
    [% END %]
1383
    [% END %]
1371
  </fieldset>
1384
  </fieldset>
1372
[% END %] [% END %]
1385
[% END %] [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt (-1 / +24 lines)
Lines 142-149 Link Here
142
    </tr>
142
    </tr>
143
    [% END %]
143
    [% END %]
144
  </table>
144
  </table>
145
[% IF ( SMSSendDriver ) %]<ol><li><label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" /></li></ol>[% END %]
146
145
146
    [% IF ( SMSSendDriver ) %]
147
        <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>
148
        <ol><li>
149
            <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
150
            <i>Please enter numbers only. <b>(123) 456-7890</b> would be entered as <b>1234567890</b>.</i>
151
        </li></ol>
152
    [% END %]
153
154
    [% IF ( SMSSendDriver == 'Email' ) %]
155
        <ol><li>
156
            <label for="sms_provider_id">SMS provider:</label>
157
            <select id="sms_provider_id" name="sms_provider_id"/>
158
                <option value="">Unknown</option>
159
                [% FOREACH s IN sms_providers %]
160
                    [% IF s.id == sms_provider_id %]
161
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
162
                    [% ELSE %]
163
                        <option value="[% s.id %]">[% s.name %]</option>
164
                    [% END %]
165
                [% END %]
166
            </select>
167
            <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>
168
        </li></ol>
169
    [% END %]
147
</fieldset>
170
</fieldset>
148
171
149
<fieldset class="action">
172
<fieldset class="action">
(-)a/members/memberentry.pl (+6 lines)
Lines 43-48 use C4::Branch; # GetBranches Link Here
43
use C4::Form::MessagingPreferences;
43
use C4::Form::MessagingPreferences;
44
use Koha::Borrower::Debarments;
44
use Koha::Borrower::Debarments;
45
use Koha::DateUtils;
45
use Koha::DateUtils;
46
use Koha::SMS::Provider;
46
47
47
use vars qw($debug);
48
use vars qw($debug);
48
49
Lines 65-70 my ($template, $loggedinuser, $cookie) Link Here
65
           debug => ($debug) ? 1 : 0,
66
           debug => ($debug) ? 1 : 0,
66
       });
67
       });
67
68
69
if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
70
    my @providers = Koha::SMS::Provider->all();
71
    $template->param( sms_providers => \@providers );
72
}
73
68
my $guarantorid    = $input->param('guarantorid');
74
my $guarantorid    = $input->param('guarantorid');
69
my $borrowernumber = $input->param('borrowernumber');
75
my $borrowernumber = $input->param('borrowernumber');
70
my $actionType     = $input->param('actionType') || '';
76
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