X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FSMS.pm;h=24580d6c9f9a47357c728d4530c640ee80f63918;hb=6d9d5581ab7bb458dcca3dcb19c7f5929fa7ea50;hp=959e407c8d9d68d16ee79ad83020c98ad2f0436f;hpb=2cae4efa0a0f3d3f960b173b3e3d2eef4ecf555e;p=koha_fer diff --git a/C4/SMS.pm b/C4/SMS.pm index 959e407c8d..24580d6c9f 100644 --- a/C4/SMS.pm +++ b/C4/SMS.pm @@ -1,5 +1,7 @@ package C4::SMS; +# Copyright 2007 Liblime +# # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the @@ -11,9 +13,9 @@ package C4::SMS; # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =head1 NAME @@ -34,12 +36,11 @@ use strict; use warnings; use C4::Context; -use SMS::Send; use vars qw( $VERSION ); BEGIN { - $VERSION = 0.03; + $VERSION = 3.07.00.049; } =head1 METHODS @@ -52,10 +53,6 @@ BEGIN { =head2 send_sms -=over4 - -=back - =cut sub send_sms { @@ -67,6 +64,12 @@ sub send_sms { return unless defined $params->{ $required_parameter }; } + eval { require SMS::Send; }; + if ( $@ ) { + # we apparently don't have SMS::Send. Return a failure. + return; + } + # This allows the user to override the driver. See SMS::Send::Test my $driver = exists $params->{'driver'} ? $params->{'driver'} : $self->driver(); return unless $driver; @@ -89,10 +92,6 @@ sub send_sms { =head2 driver -=over 4 - -=back - =cut sub driver {