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

(-)a/C4/SMS.pm (-1 / +14 lines)
Lines 116-124 sub send_sms { Link Here
116
            %args,
116
            %args,
117
        );
117
        );
118
118
119
        my $default_country_code = C4::Context->preference("SMSSendDefaultCountryCode");
120
        my $destination = $params->{destination};
121
122
        # Default country code set and is local phone number
123
        if ($default_country_code && $destination =~ /^[^+]/) {
124
            # Ensure country code has leading '+'
125
            $default_country_code =~ s/^[^+]/+$&/;
126
            # Strip leading zeroes
127
            $destination =~ s/^0+//;
128
            # Prepend default country code
129
            $destination = $default_country_code . $destination;
130
        }
131
119
        # Send a message
132
        # Send a message
120
        $sent = $sender->send_sms(
133
        $sent = $sender->send_sms(
121
            to   => $params->{destination},
134
            to   => $destination,
122
            text => $params->{message},
135
            text => $params->{message},
123
        );
136
        );
124
    };
137
    };
(-)a/installer/data/mysql/atomicupdate/bug-36022-add-SMSSendDefaultCountryCode-syspref.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "BUG_NUMBER",
5
    description => "Add SMSSendDefaultCountryCode system preference",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('SMSSendDefaultCountryCode ', NULL, NULL, 'Default SMS::Send driver recipient phone number country code', 'Integer') });
11
        # sysprefs
12
        say $out "Added new system preference 'SMSSendDefaultCountryCode'";
13
    },
14
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 680-685 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
680
('SIP2SortBinMapping','',NULL,'Use the following mappings to determine the sort_bin of a returned item. The mapping should be on the form \"branchcode:item field:item field value:sort bin number\", with one mapping per line.','free'),
680
('SIP2SortBinMapping','',NULL,'Use the following mappings to determine the sort_bin of a returned item. The mapping should be on the form \"branchcode:item field:item field value:sort bin number\", with one mapping per line.','free'),
681
('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'),
681
('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'),
682
('SlipCSS','',NULL,'Slips CSS url.','free'),
682
('SlipCSS','',NULL,'Slips CSS url.','free'),
683
('SMSSendDefaultCountryCode ',NULL,NULL,'Default SMS::Send driver recipient phone number country code','Integer'),
683
('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'),
684
('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'),
684
('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'),
685
('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'),
685
('SMSSendUsername', '', '', 'Username/Login used to send SMS messages', 'free'),
686
('SMSSendUsername', '', '', 'Username/Login used to send SMS messages', 'free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +5 lines)
Lines 217-222 Patrons: Link Here
217
         - driver to send SMS messages.
217
         - driver to send SMS messages.
218
         - "<br>If you would prefer to send SMS via E-mail, set SMSSendDriver to: Email"
218
         - "<br>If you would prefer to send SMS via E-mail, set SMSSendDriver to: Email"
219
         - "<br><strong>NOTE:</strong> Many mobile providers have deprecated support for this feature and it is not recommended for use unless you have a dedicated SMS to Email gateway."
219
         - "<br><strong>NOTE:</strong> Many mobile providers have deprecated support for this feature and it is not recommended for use unless you have a dedicated SMS to Email gateway."
220
     -
221
         - "Prepend the country code"
222
         - pref: SMSSendDefaultCountryCode
223
         - class: integer
224
         - "for SMS::Driver recipient phone numbers. The country code shound not include a leading \"+\"."
220
     -
225
     -
221
         - "Define a username/login"
226
         - "Define a username/login"
222
         - pref: SMSSendUsername
227
         - pref: SMSSendUsername
223
- 

Return to bug 36022